Prose report · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/f28528fc-3c18-447c-8e9a-48daf0fde575.md

Prose review — PR #540 (helios: cost-refresh recovery, prompt+output SAM copy-drafts, calibrated wide copy-verify)

Reviewed at head 14019718 against AGENTS.md:43-65 (required prose review), AGENTS.md:72-112 (required PR description sections), AGENTS.md:188-199 (focused outcome, validation, limitations), .agents/skills/repo-prose/SKILL.md:13-37 (not opened) (present-state specification, no false definite references, disclose missing measurements) and the project charter. Every finding below was re-read in the code at this head.

Key findings


Blocking

1. docs/cli-design.md:200-201, docs/cli-design.md:741, docs/mtp-design.md:22-28 — the docs deny the one thing commit 9caba2c7 makes the flag do

docs/cli-design.md:200-201 reads:

--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs.

The flag table repeats the narrower claim at :741 ("requires enabled speculation and captured history inputs, as Qwen Flash provides"), and docs/mtp-design.md:22-28 says "Both settings use the same captured MTP graphs and buffers."

At this head the flag is a load-time graph selector. helios/src/runtime_core/selection.rs:277-298 computes copy_wide = retain_wide_copy && graph.kind == "speculative" && graph.draft_source == 2 && graph.token_capacity > 1 && graph.confidence_width == 0 && graph.draft_tokens > drafts, keeps those graphs only when retain_wide_copy is set, and then requires copy_wide for them to survive the width, fixed-width and mtp_verification_token_budget filters. Graphs that do not pass are removed from execution.graphs and their kernels are not loaded. The behaviour is pinned by wide_copy_graphs_retain_only_when_history_drafts_enabled in the same file.

Why it matters: AGENTS.md:52-56 makes every repository document a present-state specification, and repo-prose/SKILL.md:26-29 says to replace stale claims rather than layer new ones on top. cli-design.md and mtp-design.md are where an operator learns what a launch flag costs in GPU memory and what core it needs; both now understate what --history-drafts does (it selects a different graph set, and therefore a different GPU memory footprint and a different core requirement).

Fix: state that --history-drafts selects copy-only wide speculative graphs when the core provides them, that those graphs are pruned when the flag is off, that it remains a no-op on cores without them, and amend the :741 row and mtp-design.md:22-28 to match.

2. docs/mtp-design.md:359-360 — draft_source is documented as the proposal source, and the exporter overwrites it

docs/mtp-design.md:359-360 lists the manifest field as:

draft_tokens, verify_tokens, draft_source: draft depth D, verification width, and proposal source, on graphs that declare a draft depth

The producer side supports that reading: ignition/preparation/execution.py:102-108 validates draft_source in (1, 2) with 2 meaning COPY_DRAFT and rejects copy-only graphs that declare confidence_width != 0 or speculative_prefix_limits; heliopause/src/python.rs:225-233 decodes 0 to None, 1 to Mtp, 2 to Copy, defaulting by graph kind.

The export path destroys it. heliopause/src/export/binding.rs:201 does graph.insert("draft_source".into(), "MTP".into()); unconditionally for every speculative (and speculative-mixed) graph, on the only route into a core (called from heliopause/src/export/capture.rs:3158). A copy-only graph produced by ignition therefore reaches the wire as MTP, copy_wide is false at selection.rs:278-283, and the MTP branch at :291-293 rejects it because its draft_tokens exceeds the learned depth. Wide copy-verify is dead on exported cores.

This is primarily a behaviour bug, but it is squarely a prose finding too: mtp-design.md:359 asserts a field contract that no exporter honours, and no document mentions the coercion. Fixing the exporter to derive "COPY_DRAFT" from 2 (and reject unknown values instead of silently labelling them MTP) makes the documented sentence true; if the coercion is intended, mtp-design.md:359 must state it and cli-design.md must say the wide copy graphs do not survive export.


Should fix

3. docs/scheduling-runtime-design.md:6-12 and the document as a whole — the scheduling specification does not describe the new scheduling mechanism

The document's own inventory at :6-12 names policy.rs, utility.rs (not opened), service.rs (not opened), cost.rs, refresh.rs, learning.rs (not opened), rounds.rs, speculation.rs — and not sam.rs. Its opening paragraph claims the document specifies Helios selection; after this PR none of the following is specified anywhere in docs/:

Why it matters: AGENTS.md:52-60 requires documents to specify the architecture, and scheduling-runtime-design.md is the file AGENTS.md:231 points scheduling-policy changes at. The description's own summary calls copy-only wide cohorts a change to how candidates "compete directly with full-batch MTP cohorts" — precisely the subject matter of this document — yet nothing there mentions it.

Fix: add sam.rs to the module list and add a section covering the copy-draft sources, the copy-only graph contract, the calibration, and the narrow/wide eligibility gates, with the numeric constants named.

4. docs/scheduling-runtime-design.md:249-254 — padding dominance is described only as the first pass

The document says candidates are discarded when "any physical shape whose capacities are all at least as large as an alternative, with at least one strictly larger capacity" exists.

helios/src/scheduler/policy.rs:221-254 adds a second rejection pass: for a GPU-allocated ragged speculative candidate it discards the candidate when another speculative shape exists with other.batch >= lanes, other.batch < candidate.batch, equal capacity and draft_tokens, and other.packed_token_capacity >= needed where needed = min(sum(lane lengths), candidate.packed_token_capacity). That is not the "all capacities at least as large" relation — the survivor may have a strictly smaller packed_token_capacity — so the surviving candidate's P can differ from the paragraph's description. This is the rule that produces the PR's headline max_b == C result.

Fix: extend :249-254 to state the second pass, including the min(lane_ceilings_sum, larger.packed_token_capacity) threshold.

5. docs/scheduling-runtime-design.md:396-399 — "minimum positive measured duration across matching shapes" no longer holds

The document states that when multiple packed speculative shapes cover a (batch, width) lookup, Helios "takes the minimum positive measured duration across matching shapes and returns zero only when every matching shape is unmeasured."

helios/src/scheduler/cost.rs:190-208 now computes has_mtp and skips every copy-source shape whenever any MTP packed shape exists, regardless of measured duration. So a copy-only shape with a valid measurement is excluded from the aggregate, not minimised into it. The sentence is now wrong in exactly the case the PR adds.

Fix: state the MTP-preferred aggregation and that copy-source measurements are excluded when an MTP shape exists.

6. docs/mtp-design.md:31-40 — history drafting is still specified as the shared ring alone

The document specifies the mechanism as a 65,536-token shared ring with eight- and four-token indexes returning up to seven continuation tokens, populated only by validated completions and shared across requests.

At this head the primary source is the per-request PromptOutputSAM built from the request's own prompt; helios/src/scheduler.rs:1139-1158 queries the per-request SAM first and falls back to DecodedHistory only when the SAM match is absent or shorter. The thresholds and capacities differ too (sam.rs:22, :25, :32), and prompt tokens are indexed (up to 128 Ki), which the ring paragraph explicitly denies.

Fix: describe the per-request prompt+output automaton as the first source and the shared ring as the fallback, with the match-length threshold and prompt cap stated.

7. docs/scheduling-theory.md:577-579, :714-721, :725-729 — the theory doc still argues the two rules this PR reverses

(a) :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 at the default settings." helios/src/scheduler/refresh.rs:95-99 is now pub fn idle(&mut self) {} with a doc comment stating it retains earned credit (capped at CREDIT_CAP_NS) and debt precisely so idle-separated requests can fund a refresh. docs/scheduling-runtime-design.md:437-438, 465-469 was updated to say so; the theory doc was not, so the two documents now contradict each other.

(b) :714-721: "It orders alternatives by the later of their last valid completion and last attempted dispatch, then by ordinary useful-value ranking." helios/src/scheduler/cost.rs:287-296 replaces that with the two-tier (bool, u64) refresh_order key — unattempted stale shapes first — and the ranking by expected useful value then applies via policy.rs:1333-1338, 1369-1372. The same paragraph was rewritten in scheduling-runtime-design.md:441-450 and left untouched here.

(c) The same passage at :704-712 calls retained-refresh the simulator policy that "models the retained-cost rule that Helios implements", but scripts/scheduling_sim/learning_policy.py:671 still does self.credit_ms = min(0.0, self.credit_ms) in idle(). The claimed correspondence is now false, and the 2,495 ms funding bound the PR's Result section cites is argued from the superseded rule.

Why it matters: AGENTS.md:231 lists this doc as required reading for scheduling-policy changes; a reviewer following it will conclude the PR is wrong.

Fix: update :577-579 and :714-729 to the retained-credit rule and the two-tier order, and either align learning_policy.py:671 or state that the simulator deliberately models the pre-PR policy.

8. helios/manifest.md:29-53 — the Python graph dictionary spec omits draft_source

The graph dictionary documented at helios/manifest.md:29-53 lists name, kind, sampling_mode, handle, batch_capacity, token_capacity, draft_tokens, packed_token_capacity, prefill_capacity, confidence_width, estimated_duration_ns, input_bindings, tuned_bindings — no draft_source. heliopause/src/python.rs:225-233 now reads that key (0/1/2, absent defaults by graph kind), and ignition/preparation/execution.py:102-108 validates it. A manifest writer following this spec cannot declare a copy-only graph.

Fix: add draft_source with its encoding and defaulting rule and its copy-only constraints.

9. PR description, "Result" — the SAM build cost is reported without its serving-path consequence

The description reports "PromptSAM::build takes 0.80 ms (0.37 MiB), 2.72 ms (1.27 MiB), and 13.05 ms (4.52 MiB)" as a CPU release microbenchmark. That number is not a benchmark curiosity: helios/src/scheduler.rs:1849-1852 builds PromptOutputSAM::new(&spec.prompt) synchronously inside admission whenever decoded_history is enabled, before the request is registered, i.e. on the serving thread for every --history-drafts request. The description later reports only +0.25 ms/rd scheduler overhead for non-repetitive decode, which measures steady state, not admission.

AGENTS.md:96-102 requires limitations attached to a claimed result, and repo-prose/SKILL.md:35-37 requires disclosing missing measurements. Neither the admission-time placement nor the per-live-request memory (up to 4.52 MiB each) is disclosed.

Fix: state that the build runs synchronously at admission, that the quoted milliseconds are per admitted request at that prompt length, and that no admission-latency measurement exists.


Nits

  1. docs/mtp-design.md / title: the title names three outcomes ("cost-refresh recovery, prompt+output SAM copy-drafts, calibrated wide copy-verify") and omits the fourth commit, 14019718, which produced the headline max_b == C and +12.9% results. Consider naming it.

  2. Bundling is asserted, not argued: the description says the bundle "preserves four atomic commits rebased cleanly", but never states which commits depend on which. AGENTS.md:194-199 asks for "one coherent outcome" and a stated problem/behaviour/validation/limitations per PR; if this must stay one PR, say why the four cannot land separately.

  3. helios/src/scheduler/sam.rs:1112-1117, false definite reference: the new doc comment says propose_conditional_continuations provides "a building block for conditional copy lookup tables in 2-deep pipelined execution". No such mechanism exists in the repository — the only call site is the function's own test at sam.rs:1505. repo-prose/SKILL.md:17-19 forbids definite references without an introduced referent. Either name the caller or drop the clause.


Checked and confirmed correct

Open questions and what could not be found