Prose scratchpad · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/95e60552-10eb-4fc6-bedd-8f7c13b780c7.md

#1 [high] Research summary

I ran out of time before I could write the scratchpad notes, so the findings are here in full, each one checked in the code at head 7ca5430.

What I checked

Repository rules (charter, AGENTS.md, docs/design-review.md, .agents/skills/repo-prose/SKILL.md), the PR description and its four-part structure, the changed documentation, and the diffs of docs/scheduling-runtime-design.md, helios/src/scheduler/{cost,refresh,policy,rounds,speculation,sam,decoded_history}.rs, runtime_core/selection.rs, model/catalog.rs, execution/manifest.rs, heliopause/src/python.rs, ignition/preparation/execution.py, with surrounding code and callers. I did not read the four commit message bodies (only their subject lines), and I did not run any tests, so nothing below is a claim about commit-message compliance or green test runs.

Findings

Blocking — user-facing CLI/protocol specs now contradict the code. docs/cli-design.md:200-202 still says "--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs." After commit 35ab143a, LoadOptions::select retains draft_source == 2 wide copy graphs only when retain_wide_copy (source mtp, history drafts enabled, no fixed width) and otherwise prunes them and narrows speculative_widths (helios/src/runtime_core/selection.rs:278-298, :382-396; test wide_copy_graphs_retain_only_when_history_drafts_enabled at :1876). The flag now changes the loaded graph set, kernel pruning and the reported widths. The same claim pattern survives in docs/mtp-design.md:22-29 ("requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do. Both settings use the same captured MTP graphs and buffers."). Fix: state that --history-drafts additionally elects copy-only wide graphs when the core provides them and they are retained only in adaptive mode, and update docs/cli-design.md:742's table entry accordingly.

Should fix — the design document does not specify the new copy-draft or copy-wide scheduling policy at all. docs/scheduling-runtime-design.md is the specification for Helios scheduling, yet the PR adds a whole policy surface it never describes: the per-request prompt+output suffix automaton (helios/src/scheduler/sam.rs, module list at doc lines 6-13 still omits it), the draft_source/copy-only graph family and its confidence_width == 0 / no-SpeculativePrefixLimit constraints (helios/src/model/catalog.rs:94-131, helios/src/execution/manifest.rs:841-851), the per-request CopyCalibration geometric prior WIDE_COPY_PRIOR_RATE = 0.88 with COPY_STEP_PRIOR_WEIGHT = 4.0 / COPY_DEPTH_SHRINK_WEIGHT = 2.0 (helios/src/scheduler/speculation.rs:14-21, :98-190), the WIDE_COPY_MIN_MATCH_LEN = 6 / copy_len >= base_mtp_drafts + 3 eligibility gate (helios/src/scheduler/rounds.rs:752-772), and the isolation of copy-only completions from MTP acceptance profiles and packed-round durations (helios/src/scheduler.rs:2795-2860, cost.rs:190-208). Repo-prose requires documentation to be a present-state specification and AGENTS.md:52-56 requires designed behavior to be stated; a reader of the design doc cannot learn any of this. Fix: add the copy-proposal and copy-wide selection section, with the prior, threshold and calibration constants named and their meaning explained before the identifiers.

Should fix — the padding-dominance paragraph no longer matches the rule. docs/scheduling-runtime-design.md:249-254 still says candidates "discard any physical shape whose capacities are all at least as large as an alternative, with at least one strictly larger capacity." The new second pass in prune_padding (helios/src/scheduler/policy.rs:221-254) dominates a candidate when another batch has other.packed_token_capacity >= needed, where needed = length(index).sum().min(candidate.packed_token_capacity) — i.e. the surviving shape's P may be strictly smaller than the discarded shape's P. The doc must state the "covers the cohort's needed target rows" condition and that the rule applies only to GPU-allocated ragged speculative candidates with equal (capacity, draft_tokens).

Should fix — stale "minimum across matching shapes" and shared-history text. docs/scheduling-runtime-design.md:396-399 says a (batch, width) lookup "takes the minimum positive measured duration across matching shapes". ActionCosts::refresh_packed_durations now skips copy-only shapes entirely whenever any MTP packed shape exists (helios/src/scheduler/cost.rs:192-201), so the stated rule does not hold. Likewise docs/mtp-design.md:31-40 still describes copy drafting as the shared 65,536-token ring with eight- and four-token indexes returning "up to seven observed continuation tokens"; the code now queries the per-request SAM first and only falls back to the ring when its match is strictly longer (helios/src/scheduler.rs:1099-1136), with DEFAULT_MIN_MATCH_LEN = 6 (sam.rs:22) and a 131,072-token prompt cap.

Should fix — the manifest format spec omits the field the loader now reads. helios/manifest.md:29-53 is the specification of the Python graph dictionary, and lists draft_tokens, packed_token_capacity, confidence_width — but not draft_source, which heliopause/src/python.rs:223-233 now reads (0 = none, 1 = MTP, 2 = COPY, absent defaults by kind) and which is validated as 1/2 in ignition/preparation/execution.py:102-108. A core author following the manifest doc would silently get the kind-derived default. Fix: add draft_source with its values, default and the copy-only constraints.

Should fix — the description leaves out the admission-path cost it itself measures. The "Result" section reports PromptSAM::build at 13.05 ms and 4.52 MiB for a 131,072-token prompt, but never says where the build happens. It happens at admission inside RequestScheduler::admit (helios/src/scheduler.rs:1849-1856, sam::PromptOutputSAM::new(&spec.prompt)), on the serving critical path, once per request and per prompt, allocating a heap automaton of up to ~4.5 MiB per live request. AGENTS.md:96-112 requires the claimed benefit to carry "its scope and material limitations attached", and repo-prose requires disclosing limits. Fix: state that the build is paid at admission, that its cost scales with prompt length, that the automaton is per-live-request host memory, and that no live measurement of admission latency with --history-drafts on long prompts was taken.

Nit — the title names three of four outcomes. The title lists "cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify" but the PR also changes padding dominance and raises DEFAULT_MIN_MATCH_LEN; the description itself concedes the padding/threshold change produced the max_b == C and +12.9% results. Either add it to the title or say in the description why it travels with the other three.

Nit — bundling is asserted, not argued. AGENTS.md:194-199 asks for "one coherent outcome". The description says the four gaps are "related" but never says whether commits 1 and 4 are independent of 2 and 3. If 3 (wide copy graphs) needs 2 (the SAM) but 1 and 4 do not, say so, so a reviewer knows what must land together and what could be split.

Things I looked for and did not find wrong

The description's four sections are present and in the required order; the claimed results distinguish combined-stack throughput from component measurements ("end-to-end throughput reflects the combined runtime, recipe, and kernel stack") and list unbenchmarked hardware and model scope, as AGENTS.md:96-112 demands. The rewritten timing-refresh paragraphs at docs/scheduling-runtime-design.md:425-463 and :477-486 match the code: idle() is now a documented no-op that retains credit (refresh.rs:95-99), abort still truncates positive credit (:101-105), ordinary credit uses observed_compute_duration_ns while acceptance credit keeps raw duration (:71-80), and the two-tier (bool, u64) refresh_order reproduces the documented partitioning (cost.rs:287-296). The Discord line is present with a username and no leading @.

#2 [high] Blocking: --history-drafts now changes the loaded graph set but docs say it does not

Severity: blocking.

What is wrong: docs/cli-design.md:200-202 still states "--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs. --no-history-drafts disables those proposals. Cores exported by Ignition record no history preference."

After commit 35ab143a the flag does change the selected graph set. helios/src/runtime_core/selection.rs:179-184 computes history_enabled and retain_wide_copy = source == 1 && history_enabled && fixed.is_none(); :277-298 retains only graphs where copy_wide is true (draft_source == 2, token_capacity > 1, confidence_width == 0, depth > drafts) and otherwise prunes every draft_source == 2 speculative graph; :382-396 writes the narrowed speculative_widths back into the server config; core.graphs.retain(...) at :375 then drops the pruned graphs' kernels. Test wide_copy_graphs_retain_only_when_history_drafts_enabled (selection.rs:1876-1940) asserts speculative_widths stays [1,6,16,24] with history drafts and narrows to [1,6] without, and asserts no draft_source == 2 graph survives without the flag.

Same claim pattern in docs/mtp-design.md:22-29: "History drafting ... It requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do. Both settings use the same captured MTP graphs and buffers."

Why it matters: the CLI flag table entry at docs/cli-design.md:742 and the runtime-option page are the user-facing contract for what a startup flag does. A user reading them cannot learn that enabling history drafts can load extra wide copy graphs, change which kernels load, or that fixed-width mode silently disables them.

Fix: in docs/cli-design.md:200-202 and docs/mtp-design.md:22-29, state that --history-drafts also elects optional COPY_DRAFT wide graphs when the core provides them, and that they are retained only in adaptive mode with no fixed width; update the :742 flag-table row to match.

Repository rules cited: .agents/skills/repo-prose/SKILL.md:26-29 (documentation is a present-state specification), AGENTS.md:52-56, and docs/design-review.md:172-176 (prose reviewed against four-part scheme).

#3 [high] Should fix: design doc never specifies the new copy-draft / copy-wide scheduling policy

Severity: should fix.

What is wrong: docs/scheduling-runtime-design.md is the specification for Helios scheduling (its opening lines name the implementing modules), yet this PR changes only the funded-refresh/acceptance paragraphs and never specifies the new mechanisms it adds:

Why it matters: AGENTS.md:52-56 requires designed behavior to be stated as present-state specification, and docs/design-review.md:137-150 (principle 16) requires changed prose to let a reviewer reconstruct the argument. A reader cannot learn from the design doc that copy drafts exist per request, when they override learned drafts, or what prior and thresholds price them.

Fix: add a section specifying the per-request SAM, the copy-proposal precedence rule against DecodedHistory, the copy-only graph contract, and the wide-copy eligibility/calibration constants with their meanings explained before the identifiers. Add sam.rs to the module list at lines 6-13.

#5 [high] Should fix: docs/scheduling-theory.md still states the retired idle-discard and last-attempt refresh order

Verified at head 14019718.

(a) docs/scheduling-theory.md:714-721: "It orders alternatives by the later of their last valid completion and last attempted dispatch, then by ordinary useful-value ranking." This is exactly the ordering the PR replaces with the two-tier (bool, u64) key in helios/src/scheduler/cost.rs:287-296 plus expected-useful-value ranking (policy.rs:1333-1338, 1369-1372). The PR updated the same paragraph in docs/scheduling-runtime-design.md:441-450 but left this one.

(b) docs/scheduling-theory.md:725-729: "Idle discards positive credit, so repeated shorter bursts can preserve stale estimates indefinitely." Also :577-579 ("Idle earns no credit and discards positive credit while retaining debt. Consequently, separate busy bursts shorter than 245 ms cannot fund a probe"). helios/src/scheduler/refresh.rs:95-99 is now pub fn idle(&mut self) {} — idle retains credit and debt, and docs/scheduling-runtime-design.md:437-438, 465-469 now say so and explain that credit accumulates across idle-separated requests. So the two documents contradict each other and the theory doc contradicts the code.

(c) The same paragraph :704-712 presents retained-refresh as the simulator policy that "models the retained-cost rule that Helios implements", and scripts/scheduling_sim/learning_policy.py:671 still does self.credit_ms = min(0.0, self.credit_ms) in idle(). Since the doc claims the simulator reproduces Helios, the simulator and the sentence describing the correspondence are both now stale — either the simulator must retain credit too, or the doc must state the divergence explicitly.

Why it matters: AGENTS.md:52-56 (documents specify the architecture; state support as present qualification) and the repo-prose skill:26-29 (documentation is a present-state specification; replace stale claims). docs/scheduling-theory.md is linked from AGENTS.md:231 as required reading for scheduling-policy changes, and it is where the 2,495 ms funding bound and the idle behaviour are argued.

Fix: update :577-579 and :714-729 to the retained-credit rule and the two-tier refresh order (or state the simulator divergence), and align scripts/scheduling_sim/learning_policy.py:671 if the simulator is meant to model Helios.

#6 [high] Blocking: docs/mtp-design.md promises draft_source carries the proposal source; the exporter overwrites it with MTP

Verified at head 14019718.

docs/mtp-design.md:359-360 lists the ExecutionGraph fields as "draft_tokens, verify_tokens, draft_source: draft depth D, verification width, and proposal source, on graphs that declare a draft depth". But heliopause/src/export/binding.rs:196-202 unconditionally overwrites draft_source with the string "MTP" for every speculative (and speculative-mixed) graph on the sole export path (called from heliopause/src/export/capture.rs:3158), while ignition/preparation/execution.py:316-319 emits draft_source=signature.draft_source, which may be 2 (COPY_DRAFT) per execution.py:102-108. So an exported copy-only wide graph reaches the wire as MTP and runtime_core/selection.rs:277-298 will prune it (copy_wide requires draft_source == 2; the MTP branch requires draft_tokens <= drafts). Wide copy-verify is therefore dead on exported cores, and the doc's claim that the field carries the proposal source is false for cores produced by ignition export.

Severity: blocking (behaviour, not only prose). The prose finding is that mtp-design.md:359 asserts a field contract the exporter overrides, and no document states the exporter's coercion. Fixing the exporter (derive "COPY_DRAFT" from 2 and reject unknown values) also makes the sentence true. Reported by the Autobot review comment at /p/540 as its single blocker; verified independently in binding.rs and selection.rs.

Note for the final report: this is outside the prose lens strictly, but it is a documented-contract vs. code contradiction, which is a prose finding at mtp-design.md:359-360 as well.

#7 [high] Final consolidated prose verdict at head 14019718

Verified at head 14019718. Carries forward the earlier run's findings that still hold after the four commits, plus what this run adds.

BLOCKING

  1. docs/cli-design.md:200-202 ("--history-drafts ... it does not change the graphs."), docs/cli-design.md:741 (table row), docs/mtp-design.md:22-28 ("Both settings use the same captured MTP graphs and buffers."): all three deny that the flag changes the loaded graph set. helios/src/runtime_core/selection.rs:182-184, 277-298, 375-396 retains draft_source == 2 wide copy graphs only when retain_wide_copy, prunes them otherwise, prunes kernels, and rewrites speculative_widths; test wide_copy_graphs_retain_only_when_history_drafts_enabled (selection.rs:1876+).
  2. docs/mtp-design.md:359-360 states draft_source carries the proposal source, but heliopause/src/export/binding.rs:201 overwrites it with "MTP" for every speculative/mixed-speculative graph on the only export route (capture.rs:3158), so a copy-only graph exported by ignition arrives as MTP and is pruned by selection.rs:277-298. See note #6.

SHOULD FIX (docs the PR leaves describing behaviour the code no longer has, or new behaviour no document specifies) 3. docs/scheduling-runtime-design.md:1-19, 31-115, 179-215: the scheduling specification describes none of the new mechanism — sam.rs (absent from the module list at :6-12), the draft_source copy-only graph family and its confidence_width == 0 / no-SpeculativePrefixLimit contract (helios/src/model/catalog.rs:93-131, execution/manifest.rs:840-851), per-request CopyCalibration with WIDE_COPY_PRIOR_RATE = 0.88, COPY_STEP_PRIOR_WEIGHT = 4.0, COPY_DEPTH_SHRINK_WEIGHT = 2.0 (scheduler/speculation.rs:14-21, 98-190), and the wide-copy eligibility gate WIDE_COPY_MIN_MATCH_LEN = 6 / copy_len >= base_mtp_drafts + 3 / limit > base_mtp_drafts + 1 (scheduler/rounds.rs:751-790). 4. docs/scheduling-runtime-design.md:249-254: padding dominance is described only as "capacities ... all at least as large as an alternative". scheduler/policy.rs:221-254 adds a second pass that discards a wider GPU-allocated ragged speculative candidate when a tighter batch with other.batch >= active_lanes, equal (capacity, draft_tokens) and packed_token_capacity >= needed exists — so the survivor's P may be strictly smaller. 5. docs/scheduling-runtime-design.md:396-399: "minimum positive measured duration across matching shapes" no longer holds; scheduler/cost.rs:190-208 skips every copy-only shape whenever any MTP packed shape exists. 6. docs/mtp-design.md:31-40: still describes only the shared 65,536-token ring with eight/four-token indexes returning up to seven continuations. The code queries the per-request PromptOutputSAM first and only falls back to the ring on a strictly longer match (scheduler.rs:1139-1158), threshold DEFAULT_MIN_MATCH_LEN = 6 (sam.rs:22), prompt cap 131,072 tokens (sam.rs:25), 512-token boundary overlap (sam.rs:32). 7. docs/scheduling-theory.md:577-579, 714-721, 725-729 — see note #5: idle credit retention and the two-tier refresh order are both reversed there, and scripts/scheduling_sim/learning_policy.py:671 still discards credit on idle while the doc claims that policy models Helios. 8. helios/manifest.md:29-53: the Python graph-dictionary spec omits draft_source, which heliopause/src/python.rs:225-233 now reads (0/1/2, absent defaults by kind) and ignition/preparation/execution.py:102-108 validates. 9. PR description "Result": reports PromptSAM::build at 13.05 ms / 4.52 MiB at 131,072 tokens without saying it is built synchronously at admission per request on the serving path (helios/src/scheduler.rs:1849-1852) with per-live-request host memory. AGENTS.md:96-102 requires limitations attached; repo-prose:35-37 requires disclosing missing measurements.

NITS 10. Title names three of the four outcomes; the padding/threshold commit (14019718) produced the headline max_b == C and +12.9% results. 11. Bundling is asserted, not argued: AGENTS.md:194-199 asks for "one coherent outcome"; the description never says which commits depend on which. 12. sam.rs:1112-1117 documents propose_conditional_continuations as feeding "conditional copy lookup tables in 2-deep pipelined execution", a mechanism that exists nowhere in the repository (only proposed_continuations and its own test call it: sam.rs:1505). This is a false definite reference under repo-prose:17-19; either name the caller or drop the sentence.

RULES CITED AGENTS.md:43-65 (required prose review), :52-60 (documents specify architecture), :72-112 (four required PR sections), :194-199 (one coherent outcome); .agents/skills/repo-prose/SKILL.md:13-29, 30-37, 40-43; docs/design-review.md.

CONFIRMED CORRECT (no finding)

COULD NOT SETTLE

#8 [high] Research summary

Reviewed PR #540 at head 14019718 through the prose lens against AGENTS.md, .agents/skills/repo-prose/SKILL.md (not opened) and the project charter, reading every changed doc plus the code each paragraph describes.

Verdict: changes requested — two blocking documentation contradictions. Both concern documentation that now states the opposite of the code: (1) docs/cli-design.md:200-202, its :741 table row and docs/mtp-design.md:22-28 still say --history-drafts "does not change the graphs" and that both settings "use the same captured MTP graphs and buffers", while helios/src/runtime_core/selection.rs:182-184, 277-298, 375-396 retains or prunes draft_source == 2 wide copy graphs, prunes kernels and rewrites speculative_widths by that flag; (2) docs/mtp-design.md:359-360 promises draft_source carries the proposal source, but heliopause/src/export/binding.rs:201 overwrites it with "MTP" on the only export route (capture.rs:3158), so an exported copy-only graph arrives as MTP and is silently pruned.

Should fix (seven). The scheduling specification (docs/scheduling-runtime-design.md:1-19, 31-115, 179-215) describes none of the new machinery: sam.rs (missing from the module list), the copy-only graph contract (model/catalog.rs:93-131, execution/manifest.rs:840-851), CopyCalibration and its 0.88/4.0/2.0 constants (scheduler/speculation.rs:14-21, 98-190), and the wide-copy gate at rounds.rs:751-790. Three untouched paragraphs now describe retired behaviour: padding dominance at :249-254 versus policy.rs:221-254, "minimum across matching shapes" at :396-399 versus cost.rs:190-208, and the shared-ring-only history description at docs/mtp-design.md:31-40 versus scheduler.rs:1139-1158 with min_match_len = 6. New this run: docs/scheduling-theory.md:577-579, 714-721, 725-729 — the document AGENTS.md:231 makes required reading for scheduling changes — still asserts the last-attempt refresh ordering and that idle discards positive credit, both reversed by refresh.rs:95-99 and cost.rs:287-296, and still claims scripts/scheduling_sim/learning_policy.py:671 models Helios. helios/manifest.md:29-53 omits draft_source, and the description reports the 13 ms / 4.52 MiB SAM build without saying it is paid at admission per request (scheduler.rs:1849-1852).

Nits (three): the title names three of four outcomes; the bundling is asserted rather than argued against AGENTS.md:194-199's "one coherent outcome"; and sam.rs:1112-1117 documents "conditional copy lookup tables in 2-deep pipelined execution", a mechanism that exists nowhere in the repository. The rewritten funded-refresh prose and the description's four-part structure and claim calibration are correct.

#9 [medium] Report assembly guide: which notes to read, verdict order, and what is already settled

Read note #7 first — it is the consolidated, de-duplicated set at head 14019718 and supersedes notes #2 and #3 (which were written at an earlier head and are the same two findings in longer form). Read note #6 for the exporter draft_source blocker in full, and note #5 for the scheduling-theory staleness in full.

Verdict order for the report:

  1. Blocking — --history-drafts now changes the loaded graph set while docs/cli-design.md:200-202, :741 and docs/mtp-design.md:22-28 deny it (note #2 / #7 item 1).
  2. Blocking — docs/mtp-design.md:359-360 promises draft_source carries the proposal source; heliopause/src/export/binding.rs:201 overwrites it with "MTP" on the only export path (note #6 / #7 item 2).
  3. Should fix x7 — scheduling-runtime-design.md module list and missing copy/SAM/wide-copy specification; :249-254 padding dominance; :396-399 packed-duration aggregation; mtp-design.md:31-40 ring-only history; scheduling-theory.md idle-credit and refresh-order contradictions plus the stale simulator claim; helios/manifest.md missing draft_source; PR description omitting the admission-time SAM build cost.
  4. Nits x3 — title omits the fourth outcome; bundling asserted not argued (AGENTS.md:194-199); sam.rs:1112-1117's "2-deep pipelined execution" false definite reference (repo-prose:17-19).
  5. Confirmed correct — rewritten funded-refresh/acceptance prose matches refresh.rs:71-105 and cost.rs:27-36, 287-296; description's four-part order and claim calibration; Discord line present.
  6. Could not settle — whether admission-time SAM construction stalls serving (needs a live ~128K-prompt run); which document should own the copy-only wide graph description (but one must, since cli-design.md denies the flag changes graphs); no tests run and no CI checks on the head commit.

Nothing else is outstanding; every finding above was re-verified in the code at 14019718 during this run.