Opened by a workflow run, Nov 26, 2026 11:49 AM EST.
screen malicious
Screen Result: All Clear
Evidence:
Screening of NVIDIA/hyperflare-inference PR #540 ("helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify", head 7ca5430, base main, 25 files, +3965/−119) found no prompt injection, no hidden or agent-directed instructions, no encoded blobs, and no other content aimed at causing unwanted agentic behavior.
- Discussion surface: the PR has no comments, no reviews, and no CI checks on the head commit (
pr_comments: "No comments."). There is no third-party prose on the PR that could try to steer a reviewing agent. - Diff read structurally, file by file: all 25 changed files (
docs/scheduling-runtime-design.md,heliopause/src/python.rs,ignition/preparation/execution.py, and thehelios/srcset —scheduler/{cost,refresh,sam,policy,rounds,speculation,decoded_history,checkpoints}.rs,runtime_core/{selection,serving},model/{catalog,packing},execution/manifest.rs,server/runtime.rs, tests) contain only the described scheduler/speculative-decoding work. Every hunk matches the stated intent; nothing deviates toward instructions or agent-facing text. - New file read nearly end to end:
helios/src/scheduler/sam.rs(1,606 lines) is a pure suffix-automaton + link-cut-tree data structure with brute-force oracle tests and one ignored microbenchmark. Zero matches forstd::process|Command|fs::|std::env|include_str|include_bytes|unsafe; no network, no URLs, no subprocess. - Regex sweeps, whole repo and changed areas, for injection patterns ("ignore/disregard previous", "system prompt", "you are an AI/assistant", "note to reviewer/agent", "please approve/merge", "do not report/flag", "LGTM", "safe to merge", "exfiltrat",
curl|base64|eval(|exec(): only three benign hits —helios/src/server/inference.rs:386(not opened) (pre-existing product prompt string fortool_choice=required, not touched by this PR),helios/src/scheduler/sam.rs:1544#[ignore = "CPU microbenchmark…"](ordinary Rust test attribute, verified in code), andtests/server/test_mixed_scheduler.py:40(not opened)"Ignore this filler: "(pre-existing test fixture). No agent-facing instruction anywhere. - Script-level primitives:
ignition/preparation/execution.pyhas nosubprocess/os.environ/urllib/requests/pickle/eval/exec/openbeyond the pre-existingserve_rank(self, socket, …)TP-rank server API at :359/:374 (unchanged). - Unicode sweep: no bidi-control (U+202A–202E, U+2066–2069), zero-width (U+200B–200F) or tag (U+E0000–E007F) characters in any PR-changed file; multi-byte text exists only in pre-existing fixtures.
- No supply-chain or CI surface: the PR changes no
.github/workflowsfile, no lockfile, no dependency manifest. - PR description: ordinary technical writing (motivation, four commit summaries, results, evidence, limitations). Its closing
Discord: Doonerline is a repository requirement (docs/design-review.md:153-155, verified), not an attempt to move the conversation off-platform.
Open questions / not found: nothing suspicious was left unexplained. No CI ran on the head commit, so no automated-signal cross-check was possible; screening was by direct reading of the diff and searches. Files outside the PR's diff were swept only by regex, not read in full, but none are modified by this PR and so cannot carry injected instructions into this change.
Full detail, including the per-pattern sweep citations, is in the report.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR — an Ignition/CLI/docs contributor, first time in the helios scheduler; Discord: Dooner)
Motivation: Towards throughput: the scheduler forgets that a graph is slow after an idle gap, so it keeps scheduling stale-cost graphs; copy-drafts only reuse previous output, ignoring the request's prompt, so prompts that quote code or diffs get no free draft tokens; and speculative batches get padded to wide B=16/32 graphs that cost more than they save. The PR also adds a new graph type (prompt-suffix copy-verify at wider widths) that needs Ignition to declare it.
Scale: +3,965 / −119 lines in 25 files (4 commits, 1,606 of them a new sam.rs)
Proposal:
- Cost refresh: keep earned credit across
RefreshState::idle, exclude external readiness waits from timing-refresh credit/debt, rank the funded refresh by expected useful value instead of timestamp. - New per-request prompt+output suffix automaton (
sam.rs) for copy drafts, built at admission under--history-drafts, replacing the shared-output-only ring as the preferred proposal source;DEFAULT_MIN_MATCH_LEN3 → 6. - New
draft_sourcegraph metadata (1=MTP,2=COPY_DRAFT) with validation, retention, and a cost-calibrated wide copy-verify candidate gated on long SAM matches. - Tighten speculative batch padding dominance so a strictly narrower ragged batch with equal capacity prunes wider padded
B=16/32graphs. - Isolation of copy-only rounds from MTP acceptance/cost learning, plus metrics changes. Touches:
helios/src/scheduler/(sam.rs new, cost.rs, refresh.rs, policy.rs, rounds.rs) — the funded-refresh and graph-selection machinery.helios/src/runtime_core/selection.rs,model/{catalog,packing}.rs— graph admission/pruning and packing.ignition/preparation/execution.py,heliopause/src/python.rs— new recipe-declared graph field. Related items:- #538 Restrict cold pure-prefill discovery to natural-fit graph capacities (open): same author, same day, same
policy.rs/policy_tests.rs/docs, conflict risk - #510 Prevent unmeasured packed speculative shapes from zeroing measured round durations (merged): the cost-refresh predecessor this builds on
- #414 Seed each request's host acceptance estimate from earlier requests (merged): created the acceptance-profile machinery this PR partitions for copy rounds
- #534 Checkpoint captures deadlock on an unmeasured snapshot cost (open): same cost-freshness subsystem, not fixed here
- #289 Bound history proposals by logical lane length (merged): the previous bug in the copy-proposal path this re-routes
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Autobot comments: Two things a reader cannot get from the description. (1) The declarative half of the copy-verify feature is not plumbed:
heliopause/src/export/binding.rs:196-202(unchanged, same onmain) unconditionally doesgraph.insert("draft_source", "MTP")for every speculative graph on the export path, so thedraft_source=2thatignition/preparation/execution.py:316-319emits is overwritten before it reaches the wire — and the PR's Limitations concede W=16/W=24 copy-only GPU export/replay was never benchmarked. (2) It reverses a documented contract of the original refresh design by its author (Luke Alonso):RefreshState::idleno longer discards positive credit, and two pre-existing test names asserting the old contract were renamed. Also undeclared in the description:flare_learned_draft_*depth counters now report 0 for copy-only steps;docs/mtp-design.mdanddocs/cli-design.md:200-201("--history-drafts … does not change the graphs") are now stale and were not updated; no new Python tests accompany the new Python/Heliopause validation. Evidence is strong on CPU (615/1,625 passed, 120 randomized SAM oracle trials) but self-reported — there are no CI checks on the head commit — and the live numbers are a single DeepSeek-V4.1-Flash TP4 run the description itself attributes partly to the "combined runtime, recipe, and kernel stack". Zero reviewers or comments so far, and no issue in the repo asked for any of the four changes.
Value Proposition
Verdict: worth it with changes — split it, keep two of the four commits as-is, hold the third until it has GPU evidence
What the charter says that decides this
Three charter rules matter most here:
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." - "Solve the right problem in the right place… Look for the smallest footprint in shared code, or a way to solve it without new code at all."
- "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it."
Plus the documented-matrix rule: new graph kinds "must prove they export and serve cleanly from the PR branch."
The PR meets (1) for three of its four commits and explicitly fails it for the fourth. It partly meets (2). It never claims (3).
The four commits, judged separately — they are not one change
Commit 1 (a85be397, cost-refresh recovery) — merge as-is. Highest-value, lowest-cost part.
This is a real bug fix against a limitation the project already documents. docs/scheduling-runtime-design.md (pre-PR) said: "Funding the first refresh requires 2,495 ms of credited ordinary execution. Repeated shorter busy periods separated by idle can leave unused graph estimates stale indefinitely." The PR names the cause exactly: RefreshState::idle (helios/src/scheduler/refresh.rs:99) clipped positive credit to zero, so idle-separated short requests could never accumulate the 5 ms cap, and refresh_order (helios/src/scheduler/cost.rs:284) re-probed stale shapes in raw-timestamp order.
Why this matters for this project specifically: Flare is aimed at "long conversations, coding agents, and heavy tool use" — i.e. exactly the bursty, idle-separated traffic pattern whose cost estimates the old code could never refresh. After a transient power cap or a post-idle clock drop, the scheduler would keep pricing those graphs at stale durations forever. This is a throughput bug that hits the primary use case.
Cost is small and proportionate: observed_compute_duration_ns / timing_refresh_duration_ns (cost.rs:31-40), a (bool, u64) two-tier key, idle() becoming a no-op, abort() taking over the discard behavior. The accounting invariant is preserved and re-stated in the docs rather than quietly broken (P <= 0.002/0.998 * O + D now defined over compute time; acceptance learning deliberately keeps raw physical time). That is exactly what "bug fixes need to address the root cause" (#397) asks for.
Two nits, not blockers:
idle()is nowpub fn idle(&mut self) {}(refresh.rs:99) with a doc comment — a dead method. Delete the method and its call site athelios/src/scheduler.rs:1281instead of leaving an empty hook.observed_compute_duration_nsusessaturating_sub(wait_ns), so a readiness interval longer than the measured interval silently reports0(zero credit, no debt) rather than treating the observation as invalid the wayvalidate_completionalready does forqueued/missing intervals. Worth pinning down with a test either way.
Commit 4a (7ca5430c, dominates_padding_with + prune_padding) — merge, but de-duplicate the logic first.
The measured claim is clean and defensible: max_b == C on every cell instead of B16 at C=4 and B32 at C=6..16, with 9.19 vs 9.55 ms/rd at C=4 (+5.1%), -7.9% at C=6, -5.2% at C=8. Over-padding a B=16 graph for a 4-request cohort is a straightforward waste, and tightening dominance is the right layer for the fix.
The concern is that the change now contains two different definitions of "dominated" in the same function:
dominates_padding_with(policy.rs:139-174) gained a four-branch GPU-ragged speculative path with three early returns;prune_padding(policy.rs:225-254) then re-implements a weaker, differently-shaped predicate inline (other.batch >= lanes, capacity/draft_tokensequality,packed_token_capacity >= needed) rather than reusing the first.
Two dominance predicates that are meant to agree but are written independently is a classic source of silent over-pruning (a shape gets dropped that a future cohort needed) or under-pruning. Please either route the second pass through the first or state in a comment why the criteria must differ, and add a test that asserts the two predicates never disagree on a dominated pair.
Commit 4b (DEFAULT_MIN_MATCH_LEN 3 → 6) — merge. One line, motivated (3-token coincidental matches were overriding learned drafts), covered by sam.rs:1287-1290.
Commit 2 (83ff9ed6, prompt+output SAM) — worth it, but trim it and document it.
There is a genuine gap: DecodedHistory (helios/src/scheduler/decoded_history.rs) only indexes committed output in a 4-/8-token hash ring, so it is prompt-blind by construction. A request that quotes a file, diff, or retrieved chunk gets nothing until it re-emits its own output. The PR's own test asserts this deliberately (helios/src/scheduler/tests.rs:2069: shared history did not ingest prompt A), so the SAM is not duplicating the ring — it fills a hole the ring intentionally leaves. That is the right problem.
But this is where "smallest footprint" bites. helios/src/scheduler/sam.rs is 1,606 lines implementing a compacted suffix automaton plus a splay-based link-cut tree with lazy path updates over the dynamic output automaton (sam.rs:564-737). Much of it is genuinely good work — CSR edge compaction, the brute-force oracle harness (sam.rs:1236-1273), 120 randomized oracle trials, per-request Arc sharing — and the reported 140–317 ns per push + propose at 8k–128k tokens is the right order of magnitude. Still, there are three concrete scope problems:
- Half-wired generality.
from_shared_promptshares anArc<PromptSAM>(sam.rs:935), but nothing in the runtime calls it — every request builds its own automaton at admission (helios/src/scheduler.rs:1849-1852). Likewisepropose_for_context(sam.rs:1070) andpropose_conditional_continuations(sam.rs:1118) are used only insam.rstests;propose_conditional_continuationsexists "for 2-deep pipelined execution," which does not exist in this codebase. That is ~150 lines of public API surface on the hot path with no caller. - Aggregate memory is unaccounted. The PR reports
0.37/1.27/4.52 MiBper 8k/32k/131k-token prompt SAM, but not the per-request total acrossmax_activerequests (prompt SAM + up to 131,072-tokenOutputSAM+ LCT nodes). AtC=16..32on a workstation this could be hundreds of MiB of host RAM that nothing budgets against, even though the runtime already hasMemoryLimitmachinery (helios/src/runtime_core/limits.rs(not opened)). One line of accounting is enough. - 13 ms build on the admission path is plausible but unexplained. Fine relative to prefill of a 131k-token prompt, but say so.
The measured win is real for the target workload: 3.078 → 3.650 tokens/round and 408.0 → 460.8 tok/s (+12.9%) on a 512-token repetitive code-edit prompt, at +0.25 ms/rd overhead for non-repetitive single-stream, and it stays behind --history-drafts. Note that this result comes from commits 2 and 4b together, not from the wide copy graphs (see below) — a 4/8-gram ring can never emit more than 8-token continuations, so longer SAM matches alone explain 3.65 tokens/round.
Commit 3 (35ab143a, per-graph draft_source + wide copy-verify) — do not merge yet. Split it out.
This is the largest and riskiest slice, and it is the one that fails the evidence bar:
- The PR's own Limitations section says: "copy-only wide graph (
W=16/W=24) GPU export/replay … were not benchmarked on live hardware." The Result section contains no measurement attributable to this commit. The +12.9% figure needs only commits 2 and 4b. So a ~450-line change acrossignition/preparation/execution.py,heliopause/src/python.rs,helios/src/execution/manifest.rs,runtime_core/{selection,serving}.rs,model/{catalog,packing}.rs,scheduler/{speculation,rounds,cost}.rsships with no served-workload speedup of its own — exactly what #210 forbids. - It introduces a new captured-graph contract: speculative graphs that are copy-only (
confidence_width == 0, nospeculative_prefix_limits, four copy input buffers) coexisting with MTP graphs in one core, plus retention/pruning rules inruntime_core/selection.rs:278-297and a newCopyCalibrationwith priors0.88/min_match_len 6/copy_len >= base_mtp_drafts + 3. Minting that contract needs the owner approval the charter requires, and the PR does not say it has it. - It is also the most speculative calibration in the diff:
WIDE_COPY_PRIOR_RATE = 0.88,COPY_STEP_PRIOR_WEIGHT = 4.0,COPY_DEPTH_SHRINK_WEIGHT = 2.0(speculation.rs:14-23), plus a 3-way ordering heuristic loop withselect_nth_unstable_byinlined intopacked_round_candidates(rounds.rs:745-900) — roughly 150 lines dropped into an already-dense function. Against the charter's "Be explicit and pin everything. No magic defaults", these priors need either a derivation or a measurement behind them.
Compatibility work here is good, and worth keeping whenever it lands: unknown cores still load, draft_source defaults to MTP (heliopause/src/python.rs:224-235), --mtp-draft-tokens still validates against the MTP maximum only (selection.rs:149), and the selection test at selection.rs:1876-1945 covers retain-vs-prune. That is the right instinct; it just isn't evidence of a win.
Documentation gap (a charter-listed mergeable defect)
Only docs/scheduling-runtime-design.md is updated. docs/mtp-design.md:22-40 still states that history drafting "requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do" and describes history drafting solely as the 65,536-token shared 4/8-gram ring. After this PR that is wrong in three ways: copy drafts now come primarily from a per-request prompt suffix automaton, --history-drafts now also controls graph retention in runtime_core::selection (it prunes copy-only graphs when off — a flag that used to mean "augment drafts" now changes which captured graphs survive), and min_match_len default moved to 6. docs/cli-design.md:200-202 (not opened), 742 is stale in the same way. Given the charter lists "bad docs" as mergeable work and this PR changes documented behavior of an existing flag, these should be updated in the same series.
Who benefits, and how much
| Change | Beneficiary | Magnitude | Cost |
|---|---|---|---|
| Cost-refresh recovery | every user with idle-separated requests = the core local/chat/agent case | unbounded (stale pricing never recovers today) | ~40 real lines |
| Padding dominance | multi-session C=4..16 serving |
+5.1% to +7.9% latency | ~30 lines, one duplication risk |
| SAM prompt drafts | code-edit / repetitive / retrieval workloads | +12.9% tok/s on the tested shape; +0.25 ms/rd elsewhere, opt-in | ~1,250 lines + 370 test lines |
| Wide copy-verify | hypothetical | unmeasured | ~450 lines + new graph contract |
Roughly half the diff is tests (policy_tests +501, scheduler/tests +583, model/tests +324, plus sam oracle trials) — that is a genuine strength and better than the project average. Test counts claimed (615 / 1,625 / 102 Python) are plausible and specific. The PR description has all four charter-mandated parts and an honest limitations section — also better than average.
Recommended disposition
Worth it with changes, in this order:
- Split into three PRs. (a) cost-refresh recovery + padding dominance +
min_match_len = 6— small, root-cause, measured, merge quickly; (b) prompt+output SAM after trimmingpropose_for_context/propose_conditional_continuations/ unwiredfrom_shared_prompt, adding per-request memory accounting, and fixingdocs/mtp-design.md+docs/cli-design.md(not opened); (c) wide copy-verify, held until somebody runs copy-onlyW=16/W=24export and replay on real hardware and reports a win over the existingW=8copy path on a served workload — and until a maintainer signs off on the copy-only speculative graph contract. - Fix in (a) before merging: drop the empty
RefreshState::idle; decide whether readiness-wait > interval is zero compute or an invalid observation; de-duplicate the two dominance predicates inpolicy.rs:139-174vspolicy.rs:225-254and test that they agree. - Justify in (c) before merging:
0.88,+3,>= 6, and the 3-ordering heuristic — each needs a derivation or a measurement, not a default.
Nothing in the diff violates "keep the runtime small and model-agnostic" in the per-model sense (the SAM is token-ID-only, no model branches, gated by an existing flag), and nothing in it is off-roadmap in kind — idle-separated cost recovery and tight batch selection are squarely inside "squeeze the most out of workstation hardware." The objection is scope discipline and evidence, not direction. The thread currently has no human review (only the automation case-file comment), so this is a first substantive review.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Architecture
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- PR-wide (25 files, +3965/−119): four independent outcomes (funded-refresh recovery a85be397, per-request SAM 83ff9ed6, wide copy-verify graphs 35ab143a, padding dominance + min-match-len 3→6 7ca5430c) in one PR, contrary to AGENTS.md:198-199; the headline "+12.9% tok/s" is a combined-stack number and the "max_b == C" table cannot be attributed.
- helios/src/runtime_core/selection.rs:184,277-298,382-391: a second proposal-source dimension (
GraphDescriptor::draft_source, defaulted in heliopause/src/python.rs:225-233) duplicates the existingspeculative_proposal_sourceconfig and forces copy-specific bypasses of the draft_tokens/verification-budget filters in shared selection code — design-review.md:16-26, 31-52; AGENTS.md:188-193. - helios/src/scheduler/cost.rs:190-208,223-232 + rounds.rs:755-790: cost and scheduling semantics depend on which other graphs a core happens to contain (
has_mtp) and on manifest binding (is_copy_only_step), a non-local dependency with no unit-test story. - docs/mtp-design.md:22-40 (unchanged) still documents history drafting as a shared eight/four-token ring and says only qwen3.8-flash MTP graphs declare copy inputs, while the PR makes a per-request prompt+output suffix automaton primary (helios/src/scheduler.rs:1099-1159) — AGENTS.md:165-166 (inaccurate documentation is the deliverable) and design-review.md:12 (report evidence honestly).
- helios/src/scheduler/speculation.rs:15,18 + rounds.rs:766 + sam.rs:22: unpinned calibrated constants (0.88, 6,
base_mtp_drafts + 3) with a single-prompt derivation; charter "be explicit and pin everything", AGENTS.md:187 numerical bounds must follow measured repeatability.
Nits: 3 — helios/src/scheduler/refresh.rs:99 empty idle() left as a no-op method; wide copy-verify (W=16/24) GPU export/replay and cost-refresh under live power-limit transitions unmeasured per the PR's own Limitations while the new path is CPU-test-only (AGENTS.md:194-199, design-review.md:22-26); the refresh/refresh_order fix itself is clean and well scoped.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Simplicity
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/src/scheduler/refresh.rs:95-99:
RefreshState::idleis now an empty body (pub fn idle(&mut self) {}) carrying a 5-line doc comment; delete the method and collapse helios/src/scheduler.rs:1277-1283 rather than routing a no-op through the scheduler and server. - helios/src/scheduler/sam.rs:1070-1110, 1118-1189:
propose_for_contextandpropose_conditional_continuations(~112 lines) have no production caller — only the in-file oracle test calls them; the doc's "2-deep pipelined execution" consumer does not exist. - helios/src/scheduler/sam.rs:64-82, 283, 462-476, 970-984, 1023:
MatchSource/MatchProposal::source,PromptSAM::build,push_sliceand the accessor block (state_count,transition_count,memory_bytes,dynamic_memory_bytes,prompt_sam,config,prompt_len) are read only by tests/benchmark, yet sit inpub mod sam(scheduler.rs:23).
Nits: 2 — the 0/1/2 → Option<ProposalSource> ladder is written three times (helios/src/runtime_core/serving.rs:58-63, heliopause/src/python.rs:225-233, helios/src/runtime_core/selection.rs:144-148) although ProposalSource already has a parser; and request_copy_match_stats (scheduler.rs:1163-1205) is a near-duplicate of request_history_proposal_with_match_len (1112-1159), so the SAM-vs-shared-history tie-break rule exists in two places with no test that they agree.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Everything else in the 25-file, +3965/−119 diff reads as load-bearing: the cost-refresh arithmetic, the padding-dominance rewrite, the copy-only graph gating and the packing path all have production callers. Two findings dominate: the emptied RefreshState::idle (dead API that four policy tests still call), and roughly 150 lines of test-only suffix-automaton surface exported from pub mod sam. The propose_conditional_continuations case is the one to settle with the author: its doc comment advertises a 2-deep pipelined-execution consumer that is nowhere in the tree, so it is either speculative code to delete or a follow-up PR worth naming in the description.
Conventions
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/src/scheduler.rs:1163:
request_copy_match_statsis a line-for-line re-implementation ofrequest_history_proposal_with_match_len(1112-1159) — same clamp, same early exit, same SAM clip, same shared-ring query, same strictly-longer tie-break — and the two copies already disagree on the zero-count filter; express one on the other. - helios/src/scheduler/rounds.rs:544-548: the
wide_copy_curveelsearm re-derivesWIDE_COPY_PRIOR_RATE.powi(depth+1), which is exactlyCopyCalibration::curve's unobserved-depth prior (speculation.rs:121-151), and the branch is unreachable becausecopy_calibrationis set by the same predicate assamat admission (scheduler.rs:1849-1856); delete it or makeCopyCalibration::priorthe only source. - docs/mtp-design.md:22-40 and docs/cli-design.md:742 describe copy drafting as only the shared 65,536-token ring; the per-request prompt+output SAM with a 6-token minimum is unstated, and docs/scheduling-runtime-design.md:7-12 omits
sam.rsfrom its module index.
Nits: 4 (repeated draft_source != Some(Copy) predicate in cost.rs:195/199/229/239 and rounds.rs:756; refresh_order's undocumented (bool, u64) return at cost.rs:287; the test-only brute_force_oracle in sam.rs:1236 returning production MatchProposal and re-deriving build_proposal's source selection; unwired pub SAM API propose_for_context/propose_conditional_continuations at sam.rs:1070/1118, plus DEFAULT_MIN_MATCH_LEN/WIDE_COPY_MIN_MATCH_LEN both hard-coding 6).
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Correctness
Verdict: blocking issues
Blocking:
- heliopause/src/export/binding.rs:196-202: the core-export JSON→wire conversion unconditionally rewrites
draft_sourceto"MTP"for every speculative (and speculative-mixed) graph, so copy-only wide graphs emitted byignition/preparation/execution.py:316-319withdraft_source=2reach the exported core as MTP and are pruned at load (helios/src/runtime_core/selection.rs:277-298), silently disabling the whole wide copy-verify feature on theflare run/export path.
Should fix:
- heliopause/src/export/binding.rs:200: the export path silently coerces the new field instead of validating it, unlike the in-process reader (
heliopause/src/python.rs:225-233, which rejects unsupported values) — a mislabelled copy graph also bypasses the copy-only contract checks (helios/src/execution/manifest.rs:845-846,helios/src/model/catalog.rs:93-96).
Nits: 1 (the two JSON→wire encodings of the same field disagree: enum name string on the export path vs integer 1/2 on the python.rs path, with no test covering the export round trip).
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
The blocking finding is the only defect I could confirm in code. The other three candidates from research were checked this session and dropped or left as open questions: the new ActionCosts::refresh_order tiering is sound (all tier-0 targets are scanned before the best_order < order break, so the highest-expected-value unattempted stale shape does win), the refresh_packed_durations has_mtp skip and the speculative_duration copy/MTP mixing are unreachable when speculative_fixed_width is set (copy graphs are pruned at selection.rs:293 and skipped at rounds.rs:756-764), and the PromptOutputSAM lifetime across preempt/re-admit is unverified — it needs a test, not a code reading, to settle whether spec.prompt already contains previously generated tokens on re-admission (worst case is duplicated proposals, not incorrect committed tokens).
Prose
Verdict: blocking issues Blocking:
- docs/cli-design.md:200-202 (and docs/mtp-design.md:22-29, table row docs/cli-design.md:742): the user-facing specs still say
--history-drafts"does not change the graphs" and that both settings "use the same captured MTP graphs and buffers", buthelios/src/runtime_core/selection.rs:277-298,382-396retainsdraft_source == 2wide copy graphs only with the flag on and no fixed width, and prunes them plus narrowsspeculative_widthsotherwise (testwide_copy_graphs_retain_only_when_history_drafts_enabled). Should fix: - docs/scheduling-runtime-design.md:6-13 and throughout: the scheduling specification describes none of the mechanisms this PR adds — the per-request SAM (
helios/src/scheduler/sam.rs, absent from the module list), the copy-onlydraft_sourcegraph family and itsconfidence_width == 0/ no-SpeculativePrefixLimitcontract (model/catalog.rs:94-131),CopyCalibration(WIDE_COPY_PRIOR_RATE = 0.88,speculation.rs:14-21), or the wide-copy eligibility gate (rounds.rs:752-776). - docs/scheduling-runtime-design.md:249-254: the padding-dominance paragraph still describes only "every capacity at least as large";
policy.rs:221-254now discards a wider candidate when a tighter batch covers the cohort's needed rows, so the survivor'sPmay be strictly smaller. - docs/scheduling-runtime-design.md:396-399: "minimum positive measured duration across matching shapes" no longer holds;
cost.rs:190-208skips copy-only shapes whenever any MTP packed shape exists. - docs/mtp-design.md:31-40: still describes the shared 65,536-token ring with eight/four-token indexes returning "up to seven" continuations; the code queries the per-request SAM first, falls back only on a strictly longer ring match (
scheduler.rs:1099-1140), and usesDEFAULT_MIN_MATCH_LEN = 6(sam.rs:22) with a 131,072-token prompt cap. - helios/manifest.md:29-53: the graph-dictionary spec omits
draft_source, whichheliopause/src/python.rs:225-233now reads andignition/preparation/execution.py:102-108validates. - PR description "Result": reports
PromptSAM::buildat 13.05 ms / 4.52 MiB for a 131,072-token prompt but never says the build is paid at admission, per request, on the serving path (scheduler.rs:1849-1852), with per-live-request host memory — a material limitation the description omits. Nits: 2 (title names three of four outcomes; bundling of the four commits is asserted rather than argued). Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Subtractive
Verdict: make it smaller first The change: +3965 / -119 lines (25 files) Could remove: about 685 lines, in 8 places Biggest subtractions:
- helios/src/scheduler/rounds.rs:755-904: the copy-only candidate loop is a 150-line re-implementation of the ordinary packed-round loop at :905-1060; parameterising the existing loop on the per-lane curve source deletes the copy block: about 100 lines.
- helios/src/scheduler/sam.rs:1112-1189 + test 1491-1514:
propose_conditional_continuationshas no production caller (justified in the description only for a "2-deep pipelined execution" that does not exist); delete it and the test: about 100 lines. - helios/src/model/tests.rs:1861-2075, 846-953 and helios/src/scheduler/tests.rs:1995-2127: three new end-to-end tests re-prove the same SAM→plan→pack→upload path and repeat coverage in runtime_core/selection.rs:1876-1940: about 250 test lines.
- helios/src/scheduler.rs:1112-1159 vs 1163-1205:
request_history_proposal_with_match_lenandrequest_copy_match_statsare the same clamp→vocabulary-clip→shared-lookup→tie-break algorithm twice; one private helper leaves two 5-line wrappers: about 40 lines. - helios/src/scheduler/{policy,rounds}.rs: the new
Candidate.expected(policy.rs:89) duplicates whatrate(ValueRate, utility.rs:116-140) andduration_nsalready encode, dragging inbase_zero/pending_value_zero/refresh_expected/compare_byduplication: about 35 lines. Left behind:RefreshState::idle(refresh.rs:99) is now an empty fn whose only caller (scheduler.rs:1281) is a no-op, plus five policy_tests that assert it does nothing;WIDE_COPY_MIN_MATCH_LEN(speculation.rs:18) duplicatessam::DEFAULT_MIN_MATCH_LEN(sam.rs:22); the manifest copy-graph clause (manifest.rs:844-846) and the Python twin (ignition/preparation/execution.py:102-107) repeat catalog.rs:123-131, which runs on load. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Pre Test Report
Pre-Test Report — PR #540 "helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify"
Recommendation: DO NOT REFER TO HARDWARE TESTING YET
Retest after fixes. One commit is excellent and testable; the two largest commits are either unreachable in production (confirmed defect) or untestable on our rigs. Testing now would spend rig time on behavior that will change.
1. What the PR contains
Four independent outcomes in one 25-file, +3965/−119 change, by a first-time contributor to this subsystem (AGENTS.md:194-199 (not opened) asks for one coherent outcome).
| Commit | Change | Hardware-testable? |
|---|---|---|
a85be397 |
Cost-refresh recovery: retain credit across idle, exclude readiness waits from timing credit, two-tier refresh ordering | Yes — clean, valuable |
83ff9ed6 |
New 1,606-line per-request prompt+output suffix automaton (sam.rs (not opened)) for copy drafts; min_match_len 3→6 |
Only with a copy-capable model + recipe — neither available |
35ab143a |
Per-graph draft_source + wide copy-verify (W=16/24) graph scheduling |
No — see §2.1 |
7ca5430c |
Padding dominance for ragged batch grids | Yes — measurable |
2. Blocking defects (why testing is premature)
2.1 The headline capability of commit 3 is dead on the export path — verified in code
I confirmed this myself rather than relying on the reviews:
heliopause/src/export/binding.rs:196-202unconditionally runsgraph.insert("draft_source".into(), "MTP".into())for every speculative graph. It never reads the incoming value.- That file is absent from this PR's changed-file list. The producer change (
ignition/preparation/execution.py:315-319, now emittingdraft_source=signature.draft_source) is overwritten before it reaches the wire. - Export path is live:
binding.rs:17 export_capture→capture.rs:3158 super::binding::execution(execution, &allocations)→capture.rs:3160 output.index.ranks[0].execution = Some(execution). - The wire format already supports it:
helios/proto/runtime_core.proto:842,854definesDraftSource { NO_DRAFT=0; MTP=1; COPY_DRAFT=2; }. Only the writer is hard-coded. - Load side then discards the graphs:
selection.rs:277-298treats a shape ascopy_wideonly whengraph.draft_source == 2; the fallback MTP branch at:291-293requiresdraft_tokens <= drafts, which wide shapes (depth> draftsby construction,:283) fail.
Consequence: every exported core re-imports its wide copy-verify graphs as MTP and drops them. This path has never run from an exported core — consistent with the PR's own Limitations conceding W=16/W=24 GPU export/replay "was not benchmarked."
Why the 615 passing CPU tests miss it: the selection test at selection.rs:1896 constructs wire::DraftSource::CopyDraft directly, bypassing binding.rs. The only untested conversion is the one that matters.
Riding along: the same line gates validation (manifest.rs:845-846 (not opened), model/catalog.rs:93-96 (not opened) — no GPU confidence, no speculative_prefix_limits, four copy buffers), so the silent coercion also lets a mislabelled invalid copy graph skip its contract checks. The in-process reader (heliopause/src/python.rs:225-233) correctly rejects unknown values; the export reader accepts anything.
Additionally, nothing in the tree produces draft_source=2 (full-repo search: only the proto enum, the Python validator, and tests reference it). GraphSignature.draft_source defaults to 1 (execution.py:32); no recipe sets it. The PR defers this to a companion PR in local-inference-lab/hyperflare-recipes.
2.2 User-facing docs contradict the code
docs/cli-design.md:200-201— "--history-drafts… does not change the graphs." After this PR the flag decides whetherdraft_source=2graphs load and rewritesspeculative_widths(selection.rs:184, 277-298, 382-396). Not touched by the PR.docs/mtp-design.md:22-40— still describes copy drafts as only the 65,536-token shared ring returning "up to seven" tokens, and says onlyqwen3.8-flashMTP graphs declare copy inputs. The PR makes the per-request SAM primary with the ring as strictly-longer fallback (scheduler.rs:1099-1158). Not touched.helios/manifest.md:29-53(not opened) — graph-dictionary spec omitsdraft_source.docs/scheduling-runtime-design.md:7-12— module index omitssam.rs(not opened).
The one doc that was updated (the refresh sections) is accurate — I checked it line by line against refresh.rs:71-105 and cost.rs:31-38,190-296.
2.3 Scope
Four outcomes in one PR defeats attribution: the headline +12.9% requires commits 2+3+4 together and the PR itself calls throughput "combined-stack". No part can be bisected or selectively reverted.
3. Should-fix (will need code change, not blocking)
- Two independent "dominated" predicates —
policy.rs:139-174vspolicy.rs:221-254. The second runs across all candidates rather than same-group peers, so it can prune using a shape from a different mask/cohort: silent over-pruning introduced by the very commit that fixed over-padding. - Second proposal-source dimension —
GraphDescriptor::draft_sourceduplicatesspeculative_proposal_source(speculation.rs:30-38,selection.rs:144-148) and the two can disagree, which is the exact hole in §2.1. Copy-specific bypasses now sit in shared code (selection.rs:277-298,382-391;cost.rs:190-208,223-232;rounds.rs:752-790). - Cost semantics depend on catalog composition —
cost.rs:192-201skips all copy shapes if any MTP packed shape exists, so the same(batch,width)entry means different things depending on the rest of the core. Not coverable by a shape-level unit test. - Unpinned constants —
WIDE_COPY_PRIOR_RATE=0.88,COPY_STEP_PRIOR_WEIGHT=4.0,COPY_DEPTH_SHRINK_WEIGHT=2.0(speculation.rs:15-21),+3atrounds.rs:766, and6duplicated insam.rs:22(not opened) andspeculation.rs:18with nothing keeping them equal. Only the6has any derivation (one 512-token prompt). - Dead/speculative code —
RefreshState::idleis nowpub fn idle(&mut self) {}(refresh.rs:99) under a doc comment claiming a guarantee;propose_conditional_continuations(~78 lines) has no caller outsidesam.rs:1505(not opened) and cites a "2-deep pipelined execution" that does not exist; ~150 lines ofpubSAM surface are test-only. - Duplication with drift —
request_copy_match_stats(scheduler.rs:1163-1205) re-implementsrequest_history_proposal_with_match_len(1112-1159), and the two already disagree on whether a zero-count shared match counts, so the wide-copy gate and the packing path can pick different sources for the same request.
4. Expected value of a hardware test right now: low
- Commit 3: untestable end-to-end — unreachable through export (§2.1) and no producer exists.
- Commit 2: requires
--history-draftswith enabled learned speculation (selection.rs:179-180), history enabled before admission (scheduler.rs:1086-1092),decoded_history.is_some()(scheduler.rs:1120), and non-grammar/host-stop requests (scheduler.rs:373-375). No qualifying model on either rig: cn5 has no Qwen3.8-Flash; cn7 hasQwen3.8-Flash-Next-FP4-Localbut is a single GB10, arm64, 60 GiB — the SM121/GB10 configuration the PR explicitly does not qualify. - All PR live numbers came from DeepSeek-V4.1-Flash TP4 on 4× RTX PRO 6000, a model on neither rig — no headline figure is reproducible here.
- No CI ran on the head commit, so even the 615/1,625 test counts are unverified.
The real value is concentrated in the two small commits below.
5. Proposed test plan (hold until §2 fixed; ~4–6 GPU-hours on cn5)
Test A — Cost-refresh recovery (a85be397), ~2 h — highest value in the PR
Covers exactly the bursty, idle-separated traffic Flare targets, where stale graph pricing currently never recovers.
- A/B
mainvs branch on cn5, single model, TP1 (not TP4 — irreproducible variable). - ≥200 short requests, each < 2,495 ms, separated by idle gaps beyond the estimate TTL.
- Assert
flare_scheduler_executions_total{reason="timing_refresh"}and..._execution_nanoseconds_total{reason="timing_refresh"}(metrics.rs:932-939): ~0 before, >0 after. - Confirm readiness-wait exclusion via
flare_replay_readiness_wait_nanoseconds_total/..._readiness_samples_total(metrics.rs:941-948). - Regression guard: refresh spend must stay inside
P <= 0.002/0.998 * O + D.
Test B — Padding dominance (7ca5430c), ~2–3 h
- Same rig. Sweep
C = 1, 2, 3, 4, 6, 8, 12, 16(include C=2/3, which the PR does not measure). - Assert
max(batch)inflare_speculative_rounds_total{batch,width}equalsCon every cell (vsB16at C=4 andB32at C=6..16 onmain). - Report ms/rd and tok/s per cell; expect +5.1% at C=4, −7.9% ms/rd at C=6, −5.2% at C=8.
- Guard §3.1: confirm no lane starvation — over-pruning shows up as a regression at some C.
- Cheap add: load-and-serve an already-exported W=8-only core (minutes) to back the backwards-compatibility claim, currently supported by a unit test alone.
Explicitly out of scope
- Wide copy-verify (commit 3) until §2.1 is fixed, a
draft_source=2recipe exists, and the new graph contract is owner-approved. - SAM copy drafts (commit 2) — no qualifying model; cn7's GB10/arm64 is outside the PR's qualified scope.
- Power-limit transitions — conceded unmeasured; fragile and low-yield.
- Do not re-test SAM matching logic,
refresh_ordertiering, or Protobuf round-trips beyond one load-and-serve smoke check — CI covers these cheaply.
6. Bottom line
The most valuable commit (cost-refresh recovery, ~40 real lines) is clean, well-scoped, correctly documented, and testable — it should be split out and merged. Padding dominance is measurable and worth a short A/B. But the two largest commits cannot be meaningfully validated on our hardware today, and the copy-verify path has a confirmed defect that makes its graphs unreachable in production. Combined with four behaviors in one PR and four stale documents, referring now would confirm behavior that is about to change.
Refer to testing after: the binding.rs export fix lands with the round-trip test that would have caught it, the four documents are corrected, and the PR is split or its bundling argued. Then test commits 1 and 4 for ~4–6 GPU-hours on cn5.
code review summary
Recommendation: Changes Requested
One blocker: wide copy-verify graphs are silently relabelled as MTP on the only core-export path, so the feature never runs on an exported core. Commit a85be397 (funded-refresh recovery) is correct, self-contained and could merge on its own today.
Blockers:
heliopause/src/export/binding.rs:201unconditionally writesdraft_source = "MTP"while converting the manifest to the wireExecution(capture.rs:3158, the sole export route), so graphs the producer emits withdraft_source = 2(ignition/preparation/execution.py:32,316-319) arrive at load as MTP and are pruned byhelios/src/runtime_core/selection.rs:277-298(copy_wideneeds 2; the MTP branch needsdraft_tokens <= drafts). Wide copy-verify is dead on every exported core, silently — and the coercion also skips the copy-only contract checks (helios/src/execution/manifest.rs:844-846,helios/src/model/catalog.rs:123-131). Derive the enum name instead of overwriting (2 => "COPY_DRAFT", unknown=> invalid(...)) and add onebinding::executionround-trip test.
Should fix:
docs/cli-design.md:200-202(and:742,docs/mtp-design.md:22-29) still say--history-drafts"does not change the graphs"; it now retains/prunes copy-only graphs, drops kernels (selection.rs:375-380) and rewritesspeculative_widths(:382-396).- Fill three documentation gaps, not more:
docs/mtp-design.md:31-40→ SAM-first with the ring as fallback (caps,min_match_len = 6);docs/scheduling-runtime-design.md:6-12module index + a shortdraft_source/wide-copy section,:249-254→ the new strictly-tighter-batch pruning rule,:396-399→ the copy/MTP packed-duration split;helios/manifest.md:29-53→draft_source. - One authority for the proposal source:
cost::Key(cost.rs:151-158) omitsdraft_sourceyetprepared()rejects duplicate shapes (:159-161), so an MTP and a copy graph with identical B/D/W/P cannot coexist andis_copy_only_step(:223-232) has to infer the source from the table;has_mtp(:192-196) is an existence scan, so one unmeasured MTP entry suppresses measured copy entries andpacked_round_durationreturnsNonefor a shape that was measured. - Give
0.88,4.0,2.0,+3and6a stated derivation (speculation.rs:15-21,rounds.rs:766,sam.rs:22); only the6is argued today. Also rejectdraft_source = 2onmixedinignition/preparation/execution.py:104-108, whichselection.rs:278-283does not accept. - Evidence: per-commit live numbers (four outcomes bundled into 25 files cannot be attributed or bisected), state that the
13.05 ms / 4.52 MiBSAM build is paid synchronously at admission per request (scheduler.rs:1849-1852), and add one load-and-serve of an already-exported W=8 core plus one preempt→readmit SAM test (server/runtime.rs:2068-2108re-indexes generated text through the prompt).
Subtract / Simplify:
Could remove ~550–685 of +3,965 added lines:
- ~150–250 test lines: fold
helios/src/model/tests.rs:846-953into:1861-2075, drop the duplicated legacy-load assertion (:1873-1888), trimhelios/src/scheduler/tests.rs:1995-2127to admission + isolation. - ~100 lines:
helios/src/scheduler/rounds.rs:755-903duplicates the ordinary candidate loop at:905-1060; one loop with a per-slot curve provider, which also collapses thecurves/copy_curvescaches (:747-748). - ~150 lines of SAM API with no production caller:
propose_conditional_continuations(sam.rs:1112-1189, doc names a "2-deep pipelined execution" that exists nowhere),propose_for_context(:1068-1110),MatchSource/MatchProposal::source,PromptSAM::build,push_slice, unread accessors; re-point the oracle atpropose. - ~87 lines of duplication: one private helper for
helios/src/scheduler.rs:1112-1205(already drifted on the zero-count ring case), delete the unreachablewide_copy_curveelse (rounds.rs:541-548), delete the emptyRefreshState::idleand its no-op test calls (refresh.rs:95-99, ~10 call sites), oneProposalSource::from_wireinstead of three ladders (serving.rs:58-63,python.rs:225-233,selection.rs:144-148). Do not dropCandidate.expected— it is a real second quantity.
Nits:
4 nits
Full report · Notes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
screen malicious
Screen Result: All Clear
Evidence:
Screening of NVIDIA/hyperflare-inference#540 ("helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify"; 25 files, +3968/−119, head 1401971, author FujitsuPolycom) found no prompt injection or any other content aimed at causing unwanted agentic behavior.
- Conversation: the only two comments on the PR are from the repository's own automation bot (a case-file notice and a routine technical review requesting changes). Neither contains instructions to agents, requests to skip checks, or merge pressure. The
autobot.eidonix.comlinks are the operator's own review tooling — benign. - Description and docs: the body is a technical changelog with benchmark and test counts, with no imperative address to automated reviewers. The sole docs diff (
docs/scheduling-runtime-design.md, +31/−23) is prose about credit accrual, refresh ordering and acceptance bounds, with no HTML comments, hidden markdown, zero-width or bidi characters. - Repository-wide sweeps for injection markers ("ignore previous", "disregard", "you are an AI", "note to reviewer/agent", "system prompt", model names), for hidden unicode, for secret patterns (
sk-,ghp_,AKIA,BEGIN … PRIVATE KEY), and for newly added process-spawn/network/env/file-access code returned only pre-existing, unrelated matches onmain(e.g.AGENTS.md:472(not opened),docs/design-review.md:114-115(not opened),docs/api.md(not opened),tests/preparation/test_native_key_import.py:77(not opened)). None were introduced by this PR. - Logic diffs reviewed (
ignition/preparation/execution.py,heliopause/src/python.rs,helios/src/runtime_core/{selection,serving}.rs,scheduler.rs,scheduler/{refresh,speculation}.rs,execution/manifest.rs,model/catalog.rs,server/runtime.rs) match the stated changes, with no hidden side effects, exfiltration, or new privileged access.
Note (non-security): heliopause/src/export/binding.rs:201 (not opened) still hardcodes draft_source = "MTP", so draft_source = 2 copy graphs are relabelled and pruned on the export path — a functional bug already flagged by the repo bot, not a malicious item.
Limitations: static review only (CI reports "no checks" on the head commit); roughly 3,900 added lines, mostly scheduler logic and tests, were covered by targeted text searches rather than line-by-line reading, which is adequate for injection screening since injected instructions must be human/agent-readable text.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR — an Ignition/CLI/docs contributor, first time in the Helios scheduler; Discord: Dooner) Motivation: After a transient GPU slowdown the scheduler's funded-refresh design throws away the credit it has earned but keeps its debt, so ordinary requests can never afford to re-measure stale graph costs; and draft proposals only ever come from a shared ring of recent tokens, so a request that quotes a long code file, diff or schema gets weak copies. This PR makes refresh credit survive idle gaps, adds a per-request prompt+output suffix automaton for copy drafts, and lets recipes declare cost-calibrated wide copy-verify graphs. Scale: +3,965 / −119 lines in 25 files Proposal:
- Stop discarding positive timing-refresh credit in
RefreshState::idle(clamping moves toabort), split readiness waits out of observed compute duration, and rank stale-graph refresh probes in two tiers by expected useful value. - Add
helios/src/scheduler/sam.rs(+1,606 lines): per-request prompt SAM plus a dynamic link-cut output SAM, preferred over the shared ring, withDEFAULT_MIN_MATCH_LENraised 3 → 6. - Add optional per-graph
draft_source(CopyDraft = 2) through the proto, manifest,python.rs(not opened) and IgnitionGraphSignature, with copy-only validation and retain/narrow logic inselection.rs. - Add
CopyCalibration,wide_copy_curveand a wide-copy candidate inpacked_round_candidates, gated on history drafts, adaptive width,copy_allowed(), match ≥ 6 and copy length ≥ base drafts + 3. - Add a strictly-narrower-batch padding-domination rule plus a whole-list pruning pass in
policy.rs. Touches: helios/src/scheduler/(policy.rs, cost.rs, refresh.rs (not opened), rounds.rs, new sam.rs) — reverses an owner-authored credit contract and touches scheduling/pricing for every speculative run.heliopause/src/export/binding.rsinteraction +heliopause/src/python.rs(not opened) — the wire path for the new graph contract; export still hardcodesdraft_source="MTP", so the declarative half never reaches a core.ignition/preparation/execution.py— new recipe-declared graph contract, no tests added on that side. Related items:- #538 Restrict cold pure-prefill discovery to natural-fit graph capacities (merged): the same-day conflict is gone; #540 was rebased onto it, and its
policy.rshunk is now base-side. - #543 Remove joint kernel tuning and grouped AOT forward compilation (merged): landed in the new base; its doc hunks show up in the event diff but are not this PR's.
- #510 Prevent unmeasured packed speculative shapes from zeroing measured round durations (merged): the cost-table code this PR extends and partly undermines.
- #414 Seed each request's host acceptance estimate from earlier requests (merged): created the acceptance machinery this PR partitions, and its review is the template reviewers apply here.
- #534 Checkpoint captures deadlock on an unmeasured snapshot cost (open): same cost-freshness subsystem, a real user-facing bug this PR does not fix.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Autobot comments: The new event is a bot-only Autobot review (2026-11-26 17:56, Changes Requested) whose single blocker is the export defect this analysis had already found:
binding.rs:201hardcodesdraft_source="MTP"on the sole export route, so recipe-declared copy-only graphs silently become MTP graphs and skip the copy-only validators, although the wire enum already carriesCOPY_DRAFT = 2. The same review independently calls the funded-refresh commit self-contained and mergeable alone, which supports splitting the PR. Still no human review and no visible check results, and Autobot CRs are advisory here (#538 merged 41 minutes before its own CR). Two new caveats come out of this pass: the whole-list pruning pass ignores candidate masks while the pairwise rule requires equal masks (untested), andcost::Keyhas nodraft_sourcewhilehas_mtpcounts unmeasured entries, so measured copy shapes can drop out of the packed-duration table that feeds service rates, continuation pricing and next-progress.
Amendments to the 2026-11-26 report on PR #540
Scope: this is a delta to the earlier case file, not a re-statement. Four groups: corrections, escalation, new verified findings, process. Line numbers are at head 14019718 / 9caba2c7 / 450012d1 / 1b0db227 (= review's a85be397).
Key findings (amendments only)
- The export defect is now independently confirmed as the blocker. My earlier finding that a recipe cannot get
draft_source=2onto the wire is exactly the Autobot review's single blocker, cited to the sole route:capture.rs:3158→heliopause/src/export/binding.rs:196-202, wheregraph.insert("draft_source".into(), "MTP".into())runs for every speculative graph (verified at head, line 201). The wire value already exists (helios/proto/runtime_core.proto:854,enum DraftSource { NO_DRAFT = 0; MTP = 1; COPY_DRAFT = 2; }), so this is a one-line hardcode, not a schema gap — and it bypasses the copy-only contract checks (helios/src/execution/manifest.rs:844-846(not opened),helios/src/model/catalog.rs:123-131(not opened)). - The same-day #538 conflict risk is gone. #540 was rebased onto
f377dc85, which already contains merged #538 (ba35da3f) and merged #543 (f377dc85). The natural-fitpolicy.rshunks and thedocs/cli-design.md--joint-tuning/docs/preparation-development.md(not opened) hunks visible in the "what changed" diff are base-side, not this PR's delta. - New caveat: the whole-list pruning pass ignores candidate masks. The new pass (
policy.rs:221-254) prunes on batch width, capacity and drafts alone, whereas the pairwise rule requiressmaller.mask == larger.mask(policy.rs:133-140); a narrower shape from a different cohort can therefore prune the shape a candidate's own cohort needs, and no test covers differing masks. - New caveat: proposal source has no single authority in the cost model.
cost::Key(cost.rs:50-58) has nodraft_sourceandprepared()rejects duplicate shapes (cost.rs:159-161), whilerefresh_packed_durations'has_mtp(cost.rs:190-208) is an existence scan that counts unmeasured MTP entries — so one unmeasured MTP shape suppresses measured copy shapes from the packed-duration table that feeds service rates (service.rs:109,156), continuation pricing (policy.rs:775) and next-progress (policy.rs:619). - Process reading: an Autobot "Changes Requested" is advisory here. #538 (same author, same files) was reviewed Changes Requested at 17:34 but had already merged at 17:21; there is still no human review on #540 and no upstream issue asking for any of the four outcomes.
1. Corrections to the earlier report
- Commit ids are stale. Current chain:
14019718(padding dominance +min_match_len6),9caba2c7(wide copy-verify),450012d1(SAM),1b0db227/a85be397(cost-refresh recovery), sitting directly onf377dc85. All ids in the prior report are superseded. - Base moved.
f377dc85Luke Alonso "Remove joint kernel tuning and grouped AOT forward compilation (#543)" andba35da3fPCCessna "Restrict cold pure-prefill discovery to natural-fit graph capacities (#538)" are now ancestors. Consequences: (a)natural_fit_prefill_capacityexists onmain(policy.rs:357, 523, 784, 968), so no conflict argument remains; (b) thedocs/cli-design.mdanddocs/preparation-development.md(not opened) hunks in the event diff are #543's; (c)pr_filesstill lists neither file. - Scale unchanged: 25 files, +~3,965/−119 (
sam.rsstill +1,606;policy_tests.rs+504,scheduler/tests.rs+583,model/tests.rs(not opened) +324). - "No CI" should read "no check results are visible on the PR." The only appended content since the earlier report is two bot comments (case-file notice 17:04, review 17:56).
- Evidence was produced pre-rebase. The 615/1,625 Rust counts and the DeepSeek-V4.1-Flash TP4 numbers were taken on the old tree; they are not re-established at the current head.
- Sharper stale-docs point:
pr_filescontains nodocs/cli-design.md, sodocs/cli-design.md:200-202("--history-drafts… does not change the graphs") and:741are untouched at the head even thoughselection.rs:277-298now retains/prunes graph families andselection.rs:375-396drops kernels and rewritesspeculative_widths.
2. Escalation: the export coercion, confirmed as the sole blocker
- The sole export route is
capture.rs:3158→binding::execution; therebinding.rs:200-201setsverify_tokensand then unconditionally stampesdraft_source = "MTP"forkind == "speculative"orkind == "mixed" && speculation_enabled. - The producer of
2isignition/preparation/execution.py:32, 102-108, 315-319(viaGraphSignature.draft_source); the consumer of the manifest dict isheliopause/src/python.rs:225-237(not opened). Those are a different dict from the one that becomes the core's wire metadata, so the value is lost exactly where it matters. - Because the coercion happens after validation, the copy-only contract (no
confidence_width, nospeculative_prefix_limits, four copy input buffers;manifest.rs:839-851(not opened),catalog.rs:123-131(not opened)) never runs for exported copy graphs. - Also note
python.rs:225-233(not opened) defaults an absentdraft_sourceto MTP for speculative graphs, so a producer that omits the field is indistinguishable from an MTP graph; the hardcode hides this today. - Fix shape (as the review states, and as the code supports): map
2 => "COPY_DRAFT", treat unknown values as invalid, and add onebinding::executionround-trip test. - Second-order, worth recording: the same review calls commit
a85be397(funded-refresh recovery) "correct, self-contained and could merge on its own today" — independent support for splitting the four outcomes, and the one uncontested part of the bundle.
3. New verified findings at the current head
- Cost source-of-truth (see Key finding 4).
cost::Keyhas nodraft_source; source is stored per entry (cost.rs:169) and every consumer infers it (is_copy_only_step,cost.rs:223-232). Wide copy rounds are still built directly frompacked_round_shapes()(rounds.rs:752-770), so they compete; what is lost is normalization and pricing evidence (packed_round_duration,cost.rs:210-213;speculative_duration,rounds.rs:559-568). - Cohort-mismatch in pruning (see Key finding 3). Tests:
prune_paddingtests atpolicy_tests.rs:31, 52(equal_counts_from_different_cohorts…— pre-existing, exercisesdominates_padding_with, not the new pass),128,189; the two added tests (policy_tests.rs:5599-5720region) use a single four-request cohort. - Validator mismatch between producer and consumer.
ignition/preparation/execution.py:102-108acceptsdraft_source = 2on amixedgraph withspeculation_enabled, butselection.rs:278-283(copy_wide) requiresgraph.kind == "speculative", so such a graph is accepted by Ignition and silently never retained. - Submission-path asymmetry.
RequestScheduler::history_proposal(scheduler.rs:1094-1097) is retained but no longer used by serving (server/runtime.rs:2143-2150now callsrequest_history_proposal), and it lacks the vocabulary truncation the replacement has (scheduler.rs:1128-1140, mirrored at:1179-1188;decoded_history::lookup_with_match_len,decoded_history.rs:162-186(not opened)). Its tests still pin ring behaviour production no longer reads (scheduler/tests.rs:1956-1991,phase_tests.rs:583 (not opened), 1835). The review's "~87 lines of duplication, already drifted" is accurate. - Test-only SAM surface.
propose_for_context(sam.rs:1070-1110),propose_conditional_continuations(sam.rs:1118-1189, whose doc names a "2-deep pipelined execution" that exists nowhere),push_slice(sam.rs:1023),from_shared_prompt(sam.rs:935; callers only atsam.rs:1523-1524, 1572), andMatchSource/MatchProposal::source(built atsam.rs:1217-1219, 1263-1265, read only by tests). - Empty method with ten test call sites.
RefreshState::idle()is now an empty body (refresh.rs:95-99(not opened)); one production caller (scheduler.rs:1281) and ~10 test call sites (policy_tests.rs:2610, 2638, 2689, 2699, 2730, 2751, 3685, 6102, 6108, 6153). - Unreachable prior-only branch.
wide_copy_curve'selse(rounds.rs:541-548) can't be reached: the copy candidate path returns early whendecoded_historyis none (rounds.rs:759-764), andCopyCalibration::newis created under the same condition (scheduler.rs:1853-1856). - Admission cost confirmed as synchronous.
sam::PromptOutputSAM::new(&spec.prompt)runs insideadmitwheneverdecoded_history.is_some()(scheduler.rs:1849-1852), on the admitting thread, up to ~13.05 ms CPU and 4.52 MiB per 131k-token request by the PR's own microbenchmark — the review asks for this to be disclosed rather than filed as a defect. - Refresh ranking detail.
compare_refresh(policy.rs:1330-1338) buildsValueRate::new(0, expected, age_price); sinceValueRate::compareordersduration_ns == 0above everything (utility.rs:134-139), all probes compare equal on the first key and are ordered only by expected value. Intended and consistent with the doc text added, but the old duration tiebreak is gone for probes. - Five underived constants:
WIDE_COPY_PRIOR_RATE = 0.88(speculation.rs:15),COPY_STEP_PRIOR_WEIGHT = 4.0andCOPY_DEPTH_SHRINK_WEIGHT = 2.0(speculation.rs:20-21, private),base_mtp_drafts.saturating_add(3)(rounds.rs:766),DEFAULT_MIN_MATCH_LEN = 6(sam.rs:22). Only the 6 is argued in the description; none is reachable from outside viaSamConfig, since onlyPromptOutputSAM::newis used (scheduler.rs:1852). - Docs gaps re-verified line-by-line at head:
docs/scheduling-runtime-design.md:6-12module index omitssam.rs;:249-258still describes only capacity-wise domination;:396-399still says the packed lookup takes the minimum across all matching shapes (now false for the copy/MTP split,cost.rs:190-208);helios/manifest.md:29-53has nodraft_source;docs/mtp-design.md:22-40still describes the 65,536-token shared ring and "only qwen3.8-flash declares copy inputs";docs/cli-design.md:200-202and:741unchanged.
4. Process
- The only new event is bot activity: case file opened 2026-11-26 17:04 (reviews auto-run 90 min after pushes), Autobot review 17:56 with recommendation Changes Requested and exactly one blocker. The review also asks for per-commit live numbers, disclosure of the admission-time SAM build, one load-and-serve of an already-exported W=8 core, and one preempt→readmit SAM test.
- Autobot CRs are advisory in this repository right now. #538 — same author, same day, same files — received Changes Requested at 17:34 but had already merged at 17:21 (head
5a55f0bf). So the #540 CR does not mean maintainers have blocked the PR. - Still zero human reviews, zero human comments, no labels, no visible check results, and no issue in the repository asking for any of the four outcomes (#534 is a different bug in the same subsystem and is not fixed here).
Open questions still unanswered
- Whether the copy-only graph contract had owner approval (the charter requires it for a new op contract); nothing in the description cites any.
- Whether the mask-agnostic pruning pass can misprune a real cohort in practice — no test or benchmark exercises differing masks.
- Whether
has_mtp's inclusion of unmeasured entries was intended; it is the mechanism by which measured copy shapes lose their packed-duration evidence. - Whether the export hardcode is deliberately deferred to the external
local-inference-lab/hyperflare-recipesPR; the description's Limitations concede only that W=16/W=24 copy-only GPU export/replay was not benchmarked.
Verdict, unchanged: the export defect is now independently confirmed as the blocker, the #538 conflict risk is gone, and two new caveats were added (mask-agnostic pruning; cost::Key/has_mtp mis-attribution). Recommendation is unchanged: have the author fix binding.rs:201 (with the round-trip test) and split the funded-refresh commit, which the review agrees can merge alone.
Value Proposition
Verdict: worth it with changes — but split it four ways, and one commit must go back to draft because it cannot run at all
This revises my previous assessment upward on value and downward on readiness. I re-checked the new commits and found something decisive that changes the disposition of commit 3: wide copy-verify is unreachable on every exported core. It is not merely unmeasured — it is silently dead, which is the worst possible state for a feature to ship in.
What the charter decides
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." - "Solve the right problem in the right place… the smallest footprint in shared code."
- "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it."
- "Builds/artifacts must load" — the code-review standards require verifying "that existing data, artifacts, and exported cores still load." The mirror of that requirement is that new artifacts must actually carry the new feature.
Commit 1 and 4 meet (1) and (2). Commit 2 meets (1) for the target workload but not (2). Commit 3 fails (1), never claims (3), and fails the artifact requirement outright.
The blocker: commit 3's feature is unreachable on a real core
I traced the whole path rather than trusting the description:
- The producer does emit the field:
ignition/preparation/execution.py:32declaresdraft_source: int = 1, validates1 (MTP) or 2 (COPY_DRAFT)at:102-108, and serializes it at:316-319. - The wire format does support it:
helios/proto/runtime_core.proto:854already definesenum DraftSource { NO_DRAFT = 0; MTP = 1; COPY_DRAFT = 2; }(onmaintoo). The PR's "no Protobuf wire changes" claim is accurate. - But the only conversion to the wire
Executionisheliopause/src/export/binding.rs:136, called exactly once atcapture.rs:3158and stored atcapture.rs:3160. I searched for other writers of.execution = Someinheliopauseand for any Python construction of the proto message — there are none. - And at
binding.rs:196-202that function does this, unconditionally:
if kind == "speculative" || kind == "mixed" && speculative {
graph.insert("verify_tokens".into(), width.into());
graph.insert("draft_source".into(), "MTP".into()); // :201
}
graph.insert overwrites the producer's value. Line 201 exists on main unchanged — it predates the PR, and the PR did not extend it.
- On load,
selection.rs:244acceptsdraft_source ∈ {1, 2}, so the coerced"MTP"passes validation silently — no error, no warning. - Retention then discards the graphs:
copy_widerequiresgraph.draft_source == 2(selection.rs:280); the fallback MTP branch requiresgraph.draft_source == source(=1) anddraft_tokens <= drafts(:291-292). A W=16/W=24 copy graph has depth 15/23, far above the MTP maximum of 7, so it satisfies neither and is pruned.
Consequence. Every runtime component added by commit 3 is unreachable outside tests: the copy branch of packed_round_candidates (rounds.rs:755-903 (not opened)), wide_copy_curve, CopyCalibration, is_copy_only_step (cost.rs:223-232), and the copy-sourced acceptance isolation. The tests pass because they construct GraphDescriptor literals directly and never cross the export boundary — e.g. helios/src/scheduler/tests.rs:4179-4194 builds draft_source: Some(ProposalSource::Copy) by hand. That is exactly why "1,710 passed" and "the feature cannot run" are both true simultaneously.
This also makes the copy-only contract unenforceable, not merely unapproved: the coercion skips execution/manifest.rs:844-846 (not opened) and model/catalog.rs:123-131 (not opened), so nothing ever validates that a copy-only graph has confidence_width == 0 and no prefix limits on a real core.
The fix is small — map the value instead of overwriting (1 => "MTP", 2 => "COPY_DRAFT", otherwise reject), plus one binding::execution round-trip test. prost_reflect's JSON mapping (binding.rs:132) already accepts enum names, as describe.rs:534 (not opened) and flare-cli/src/inspect.rs:1609 (not opened) show. But it must land with that test, because that is the only test in the suite that would have caught this.
Commit-by-commit
Commit 1 (1b0db227, cost-refresh recovery) — merge as-is. Highest value, smallest footprint.
A root-cause bug fix against a limitation the project itself documented. Pre-PR docs/scheduling-runtime-design.md (not opened) said: "Funding the first refresh requires 2,495 ms of credited ordinary execution. Repeated shorter busy periods separated by idle can leave unused graph estimates stale indefinitely." The PR names the mechanism exactly: RefreshState::idle clipped positive credit to zero (refresh.rs), so idle-separated short requests could never accumulate the 5 ms cap, and refresh_order re-probed stale shapes in raw-timestamp order (cost.rs:284).
Why this matters here: Flare targets "long conversations, coding agents, and heavy tool use" — bursty, idle-separated traffic is the primary use case, and after a transient power cap or post-idle clock drop those graphs would be priced wrongly forever. ~40 real lines. The accounting invariant is preserved and re-stated in the docs rather than quietly broken: P <= 0.002/0.998 * O + D is now defined over compute time, while acceptance learning deliberately keeps raw physical time (refresh.rs:71-93). That is what #397 asks for. The docs update is genuinely good — it documents compute-duration credit, idle-retains-credit, the two-tier refresh order, and the Startup/abort asymmetry.
Two nits, not blockers:
pub fn idle(&mut self) {}(refresh.rs:99) is now dead. Delete it and its call site rather than leaving an empty hook.observed_compute_duration_ns(cost.rs:31-34) usessaturating_sub(wait_ns), so a readiness interval longer than the measured interval yieldsSome(0)— zero credit, no debt, and no wall fallback, since theOptionisSome.validate_completion(refresh.rs:63-69) already rejects queued/missing intervals for probes; an over-long wait should arguably be invalid too. Pin it down with a test either way.
Commit 4 (14019718, padding dominance + min_match_len 3 → 6) — merge, after de-duplicating the predicate.
Clean measured win: max_b == C on every cell instead of B16 at C=4 and B32 at C=6..16; 9.19 vs 9.55 ms/rd at C=4 (+5.1%), −7.9% at C=6, −5.2% at C=8. Over-padding a B=16 graph for 4 requests is plain waste, and dominance is the right layer.
The problem: there are now two independently written definitions of "dominated" that are meant to agree.
dominates_padding_with(policy.rs:139-174) gained a four-branch GPU-ragged path with three early returns.prune_padding(policy.rs:225-254) re-implements a weaker, differently shaped predicate inline (capacity/draft_tokensequality,packed_token_capacity >= needed) instead of reusing it.
Two predicates that should agree but are written separately is a reliable source of silent over- or under-pruning. The shipped tests do pin both sides of the useful boundary — tight_batch_prunes_wider_padded_ragged_speculative_shapes_for_active_cohort (C=4 keeps B=4, C=6 admits B=8) and wider_speculative_batch_is_retained_when_tighter_batch_lacks_token_capacity (B=8/P=28 survives when B=4/P=12 cannot cover it) — which is good. Still: route the second pass through the first, or state why the criteria must differ, and add a test asserting they never disagree on a dominated pair.
DEFAULT_MIN_MATCH_LEN 3 → 6 (sam.rs:22) is one line, well motivated (coincidental 3-token matches overriding learned drafts), and covered by sam.rs:1287-1290.
Commit 2 (450012d1, prompt+output SAM) — worth it, but trim it, account for memory, and fix the other docs.
Genuine gap, correctly located. DecodedHistory indexes only committed output in a 4-/8-token hash ring, so it is prompt-blind by construction; the PR's own test assets that shared history deliberately did not ingest prompt A (scheduler/tests.rs:2069). A request quoting a file, diff, or retrieved context gets nothing until it repeats its own output. The SAM fills a hole the ring intentionally leaves — it does not duplicate it, and docs/mtp-design.md:36-40 ("Prompt ingestion… do not populate the ring") stays true because the SAM is separate. That is the right problem in the right place.
Measured win is real for the target workload: 3.078 → 3.650 tokens/round and 408.0 → 460.8 tok/s (+12.9%) on a 512-token repetitive code-edit prompt, at +0.25 ms/rd overhead for non-repetitive single-stream, behind --history-drafts. Note this figure comes from commit 2 plus the min_match_len change, not from wide copy graphs.
Three concrete scope problems:
- Half-wired generality (~150 lines with no production caller). I confirmed by search that
propose_for_context(sam.rs:1070) andpropose_conditional_continuations(sam.rs:1118) are referenced only fromsam.rstests.propose_conditional_continuations's doc comment justifies itself with "2-deep pipelined execution," which does not exist in this codebase.from_shared_prompt(sam.rs:935) is public and tested but never called by the runtime — every request builds its own automaton at admission (scheduler.rs:1849-1852), so theArcsharing is exercised only in tests (sam.rs:1523-1530). Delete these or state the planned caller. - Aggregate memory is unaccounted. The PR reports
0.37/1.27/4.52 MiBper prompt SAM but not the per-request total acrossmax_activerequests (prompt SAM + up to131,072-tokenOutputSAM+ LCT nodes).dynamic_memory_bytes()andmemory_bytes()exist (sam.rs:976-983) but are read only by tests. AtC=16..32this could be hundreds of MiB of host RAM that nothing budgets against, even thoughMemoryLimitmachinery exists (runtime_core/limits.rs(not opened)). One line of accounting into the existing summary is enough. - 13 ms build on the admission path is unexplained.
PromptSAM::buildis called synchronously per request at admission (scheduler.rs:1849-1852). That is fine relative to prefill of a 131k-token prompt, but say so.
Engineering quality is high and worth preserving: CSR edge compaction, the brute-force oracle harness, 120 randomized oracle trials, an O(log M) link-cut tree instead of naive propagation, and 140–317 ns per push + propose at 8k–128k tokens is the right order of magnitude. ~360 test lines for a data structure this subtle is proportionate.
Commit 3 (9caba2c7, wide copy-verify) — do not merge. Split out and return to draft.
Beyond the unreachability above, it fails the evidence bar on its own terms. The PR's Limitations section says: "copy-only wide graph (W=16/W=24) GPU export/replay … were not benchmarked on live hardware." The Result section contains no measurement attributable to this commit — the +12.9% needs only commit 2 and the threshold change. So a ~450-line change across seven crates ships with no served-workload speedup of its own, which is precisely what #210 forbids.
It also introduces a new captured-graph contract (copy-only speculative graphs coexisting with MTP graphs in one core) that needs owner approval the PR does not claim, and whose validation is currently bypassed. The calibration constants are the most speculative part of the diff — WIDE_COPY_PRIOR_RATE = 0.88, COPY_STEP_PRIOR_WEIGHT = 4.0, COPY_DEPTH_SHRINK_WEIGHT = 2.0 (speculation.rs:15-21) — plus +3 (rounds.rs:766 (not opened)) and a 3-way ordering heuristic with select_nth_unstable_by inlined into packed_round_candidates (~100 lines duplicating the ordinary candidate loop at :905-1060). Against "Be explicit and pin everything. No magic defaults," only the 6 is argued today.
Two design smells worth fixing whenever it lands:
cost::Keyomitsdraft_source(cost.rs:50-58) whileprepared()rejects duplicate keys (:159-161) — yetselection.rs:250-251dedups wire variants includingdraft_source. So an MTP and a copy graph with identical B/D/W/P both survive load and then fail scheduler construction atscheduler.rs:1244. Latent (copy graphs are wider today), but it is a hard load failure waiting for the first same-geometry pair. Puttingdraft_sourceinKeyalso removes the need foris_copy_only_stepto infer the source from the table.has_mtpis an existence scan (cost.rs:192-196), not a measured check: one unmeasured MTP packed entry suppresses every copy entry via:199-201, sopacked_round_duration(:210-213, used atpolicy.rs:775androunds.rs:562(not opened)) returnsNonefor a copy shape that was actually measured. Predicate onestimate.nanos != 0.- Producer/runtime disagreement:
execution.py:104-105permitsdraft_source == 2onmixed, butselection.rs:278-283andcatalog.rs:94-96(not opened) requirekind == "speculative". Accepted by the producer, ignored by the runtime.
Compatibility work is good and worth keeping whenever it lands: unknown cores still load, draft_source defaults to MTP (python.rs:224-235 (not opened)), --mtp-draft-tokens still validates against the MTP maximum only (selection.rs:149), and wide_copy_graphs_retain_only_when_history_drafts_enabled (selection.rs:1876-1945) covers retain-vs-prune. Right instinct; not evidence of a win.
Documentation: three docs now contradict the code (charter-listed mergeable defect)
Only docs/scheduling-runtime-design.md (not opened) was updated. Verified verbatim staleness:
docs/cli-design.md:200-201: "--history-draftsenables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs." Now false: the flag changes which graphs are retained (selection.rs:277-298), which kernels load (:375-380), and rewritesspeculative_widths(:382-396). A flag that meant "augment drafts" now silently controls graph retention and must be set at load.docs/cli-design.md:741(flag table): still describes only shared decoded-history continuations as "Qwen Flash provides" — no per-request SAM, no 6-token threshold, no retention effect.docs/mtp-design.md:22-29: "It requires speculative graphs that declare copy-token inputs, which only theqwen3.8-flashMTP graphs do. Both settings use the same captured MTP graphs and buffers." Wrong twice: the graphs differ, and admission builds a per-request SAM for any--history-draftsrun regardless of recipe.docs/mtp-design.md:31-40: describes history drafting solely as the 65,536-token 4/8-gram ring. The primary source is now a per-request suffix automaton withmin_match_len = 6, ring as fallback.
Also should be documented: helios/manifest.md (not opened) (draft_source is a new manifest/wire field), the new strictly-tighter-batch pruning rule, and the copy/MTP packed-duration split. The charter lists "bad docs" as mergeable work, and this PR changes documented behavior of an existing flag.
Who benefits, and how much
| Change | Beneficiary | Magnitude | Cost |
|---|---|---|---|
| Cost-refresh recovery | every user with idle-separated requests = the core local/chat/agent case | unbounded (stale pricing never recovers today) | ~40 real lines |
| Padding dominance | multi-session C=4..16 |
+5.1% to +7.9% latency | ~30 lines, one duplication risk |
| SAM prompt drafts | code-edit / repetitive / retrieval workloads | +12.9% tok/s on the tested shape; +0.25 ms/rd elsewhere, opt-in | ~1,250 lines + ~360 test lines |
| Wide copy-verify | hypothetical | unmeasured and currently unreachable | ~450 lines + new graph contract |
~2,000 of the +3,965 lines are tests, which is better than this project's average and a real strength. The description has all four charter-mandated parts, an honest limitations section, and specific test counts. The objection is scope discipline, evidence, and one reachability defect — not direction. Nothing here violates "keep the runtime small and model-agnostic" in the per-model sense, and idle-separated cost recovery plus tight batch selection are squarely inside "squeeze the most out of workstation hardware."
Thread status: the only comments are from flare-autobot, an automated bot; there is still no human review. Nothing in the thread attempted to instruct me — I verified each of the bot's claims at the cited lines rather than trusting it, and the export blocker checks out.
Recommended disposition
Worth it with changes, in this order:
- Split into four PRs. (a) commit 1 alone — merge today, it is correct and self-contained; (b) commit 4, after de-duplicating the dominance predicate; (c) commit 2, after trimming the dead SAM API, adding memory accounting, and fixing
docs/mtp-design.md+docs/cli-design.md; (d) commit 3, returned to draft. - Unblock (d) first with the smallest possible change: make
binding.rs:201derive the value instead of overwriting, plus abinding::executionround-trip test. Then re-run the tests — expect the wide-copy coverage to start exercising something real, and expect any latentcost::Keycollision to surface. Only then does GPU evidence for W=16/W=24 export and replay mean anything, and only then can a maintainer sensibly approve the new graph contract. - Fix in (a) before merging: drop the empty
RefreshState::idle; decide whether readiness-wait > interval means zero compute or an invalid observation. - Justify in (d) before merging:
0.88,4.0,2.0,+3, and the 3-ordering heuristic each need a derivation or a measurement, not a default.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/scheduler/refresh.rs:95-99:
RefreshState::idleis now an emptypub fn idle(&mut self) {}under a 5-line doc comment;scheduler.rs:1277-1283andserver/runtime.rs:1184still route through it. Delete it and collapse the wrapper. - helios/src/scheduler/sam.rs: ~150 lines have no production caller (
propose_for_context,propose_conditional_continuations— whose doc names a "2-deep pipelined execution" that exists nowhere —MatchSource/source,PromptSAM::build,push_slice, the accessor block); the module doc claims zero-copyArcsharing across requests that never happens (scheduler.rs:1852builds a private automaton). - helios/src/scheduler.rs:1094-1097:
history_proposallost both production callers in this PR (packing.rs:402 (not opened), server/runtime.rs:2146 moved torequest_history_proposal); only tests call it, and it is the prompt-blind bypass the PR exists to replace. - helios/src/scheduler/rounds.rs:755-903: the copy-only cohort loop re-implements rounds.rs:925-1060 statement for statement (~110 lines) with twin memo arrays (
curves/copy_curves, 747-748). Nits: 4 — thedraft_source0/1/2 ladder written three times thoughProposalSource::parseexists;request_copy_match_statsduplicating the arbitration ofrequest_history_proposal_with_match_len; two separate6-token thresholds (speculation.rs:18, sam.rs:22); an unreachable non-calibrated branch inwide_copy_curve(rounds.rs:545-548). Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Subtractive
Verdict: make it smaller first The change: 25 files, +3968 / −119 Could remove: about 710 lines, in 9 places Biggest subtractions:
- helios/src/model/tests.rs:846-953 (not opened),1861-2075 + helios/src/scheduler/tests.rs:1994-2126: three overlapping end-to-end SAM→plan→pack→upload tests that re-prove selection.rs and sam.rs coverage: keep the wide test plus the admission assertions, about 250 lines
- helios/src/scheduler/rounds.rs:755-903: the copy-only candidate loop re-implements the ordinary packed-round search at :905-1060 (same 3-ordering loop, rank closure, select_nth+truncate, frontier, mask/host_lengths/lane_terms best tracking); parameterise one loop on a per-slot curve provider: about 100 lines
- helios/src/scheduler/sam.rs:1112-1189 + test :1491-1514:
propose_conditional_continuationshas no caller and its "2-deep pipelined execution" justification exists nowhere: nothing: about 100 lines - helios/src/scheduler/sam.rs:1068-1110,64-69,80-81,282-285,454-460,953-963,1023-1027 + scheduler.rs:383-385 and the SamConfig knobs: test-only SAM surface (propose_for_context, MatchSource, accessors, with_config/from_shared_prompt) collapses to the DEFAULT_* constants: about 95 lines
- helios/src/scheduler.rs:1112-1159 vs :1163-1205: two copies of the same clamp/clip/shared-lookup/tie-break algorithm; one private helper returning (tokens, count, match_len): about 40 lines Left behind: docs/cli-design.md:200-201 ("does not change the graphs"), docs/mtp-design.md:22-29 and :31-40 (no per-request SAM), docs/scheduling-theory.md:726-727 ("Idle discards positive credit"), plus RequestScheduler::history_proposal (scheduler.rs:1094-1097) and DecodedHistory::lookup (decoded_history.rs:180-183) left with test-only callers. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Conventions
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/model/catalog.rs:279-293 (with helios/src/scheduler/cost.rs:50-58): the new
GraphDescriptor::draft_source(execution/manifest.rs:191-192) is not added to either prepared-shape identity, so an MTP and a copy graph at the same B/D/W/P collide and fail to load, while runtime_core/selection.rs:250-251 already treatsdraft_sourceas part of the variant identity. - helios/src/scheduler/rounds.rs:791-902: the new wide copy-only cohort loop repeats the ordinary packed-round loop at rounds.rs:925-1060 step for step (scores,
rank_prefixes, three orderings,frontier/draft_budgettrim,lane_terms, best-mask tie-break); only the curve source differs and the copy copy already lacks the ordinary block'ssurplus_tablefactor. - helios/src/scheduler.rs:1163-1205:
request_copy_match_statsduplicatesrequest_history_proposal_with_match_len(1112-1159) — same clamp, early exit,sam.propose, vocabulary clip, ring lookup and tie-break — and has already drifted on the zero-count shared ring case; decoded_history.rs:180-183 shows the one-line-wrapper precedent. - helios/src/runtime_core/serving.rs:58-63, heliopause/src/python.rs:225-233, runtime_core/selection.rs:144-148, runtime_core/model.rs:1095-1102: four hand-written
draft_sourceinteger ladders whileProposalSource::parse(speculation.rs:30-38) and the generatedwire::DraftSourceexist; every other closed enum here keeps oneTryFromnext to the type. - helios/manifest.md:29-53 omits
draft_sourcethough ignition/preparation/execution.py:316-319 emits it; docs/mtp-design.md:22-40 and docs/cli-design.md:741 still describe copy drafting as only the shared 65,536-token ring; docs/scheduling-runtime-design.md:6-12 omitssam.rs. Nits: 6 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Prose
Verdict: blocking issues
Blocking:
- docs/cli-design.md:200-201 (and the :741 table row) plus docs/mtp-design.md:22-28: all three state
--history-draftsdoes not change the loaded graphs, buthelios/src/runtime_core/selection.rs:277-298retains copy-only wide graphs only when that flag is set and prunes them otherwise. - docs/mtp-design.md:359-360: promises
draft_sourcecarries the proposal source, butheliopause/src/export/binding.rs:201overwrites it with "MTP" on the only export path, so an exported copy-only graph is pruned and the documented field contract is false.
Should fix:
- docs/scheduling-runtime-design.md:6-12: the scheduling specification lists no
sam.rsin the module inventory and nowhere specifies the per-request prompt/output SAM,draft_source=2copy-only graph family,CopyCalibration, or the wide-copy eligibility gate. - docs/scheduling-runtime-design.md:249-254: padding dominance still described as capacities "all at least as large";
helios/src/scheduler/policy.rs:221-254adds a second pass that discards wider ragged speculative candidates whose capacities are not dominated. - docs/scheduling-theory.md:577-579, 714-721, 725-729: the theory doc still says idle discards positive credit and that refresh orders alternatives by last completion/attempt, both reversed by this PR (
refresh.rs:95-99,cost.rs:287-296), andscripts/scheduling_sim/learning_policy.py:671still discards credit while the doc claims that policy models Helios.
Nits: 3 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Correctness
Verdict: blocking issues Blocking:
- heliopause/src/export/binding.rs:201: the only core-export path unconditionally writes
draft_source = "MTP"for every speculative graph, overwriting the new 1/2 value from ignition/preparation/execution.py:316-319; exported cores can therefore never carryCOPY_DRAFT, andhelios/src/runtime_core/selection.rs:277-298prunes the wide copy graphs on load (copy_wideneedsdraft_source == 2; the MTP branch rejectsdraft_tokens > drafts), so the headline wide copy-verify feature silently never runs onflare run/export cores. Should fix: - heliopause/src/export/binding.rs:200-201: the export writer coerces instead of validating (the sibling reader heliopause/src/python.rs:225-233 errors on unknown values), and because
draft_sourceis the only trigger for the copy-only contract checks (helios/src/execution/manifest.rs:845-846, helios/src/model/catalog.rs:93-131) a mislabelled copy graph skips validation instead of failing. Nits: 1 — the two JSON→wire encodings of one field disagree (enum-name string vs integer) and no test round-tripsdraft_source=2throughbinding::execution. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Architecture
Verdict: blocking issues Blocking:
- heliopause/src/export/binding.rs:201: the exporter unconditionally rewrites
draft_sourceto"MTP", so everydraft_source = 2graph emitted by ignition/preparation/execution.py:316-319 arrives at load as MTP and is pruned by helios/src/runtime_core/selection.rs:277-298 — the wide copy-verify feature cannot run on any exported core Should fix: - helios/src/scheduler/cost.rs:190-208:
has_mtpis an existence scan over the catalog that drops measured copy shapes frompacked_round_durations, so copy and MTP cost cannot coexist;Key(cost.rs:50-58) carries no source sois_copy_only_step(:223-232) re-infers it, andprepared()(:151-161) rejects identical B/D/W/P shapes, so the second proposal-source dimension has non-local semantics - execution/manifest.rs:190-192:
GraphDescriptor::draft_sourceduplicatesModelConfig::speculative_proposal_source/RequestScheduler::proposal_sourceand is decoded by four separate ladders (python.rs:225-233, serving.rs:58-63, selection.rs:144-148, describe.rs:534 (not opened),778); one authority should own proposal source - docs/cli-design.md:200-201 and docs/mtp-design.md:22-40: both contradict the new behaviour —
--history-draftsnow prunes graphs, drops kernels and rewritesspeculative_widths(selection.rs:277-298,375-396), and the SAM, not the shared ring, is the primary proposal source, with the new caps undocumented - PR scope: 25 files / +3968 for four independent outcomes, against AGENTS.md:198 "Keep each PR focused on one coherent outcome"; the "+12.9% tok/s" and
max_b == Cnumbers are combined-stack and cannot be attributed or bisected - helios/src/scheduler/speculation.rs:15-21, rounds.rs:766, sam.rs:22: calibrated constants 0.88, 4.0, 2.0,
base_mtp_drafts + 3andmin_match_len = 6are unpinned and only 6 is argued, from a single 512-token repetitive prompt Nits: 4 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Pre Test Report
Pre-Test Report — PR #540 "helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify"
Recommendation: DO NOT REFER TO HARDWARE TESTING YET
Retest after fixes. One commit is excellent, well-scoped and testable; a second is measurable but contains a possible over-pruning defect introduced by its own change; the two largest commits are either unreachable in production (a confirmed defect now independently flagged as the PR's single blocker) or untestable on our rigs — and every path to testing them requires a multi-hour core preparation first. Testing now would spend rig time on behavior that is about to change.
Head reviewed: 14019718 (unchanged since the prior report; the "new commits" listed for this turn are the same four commits already reviewed). 25 files, +3,968/−119. No CI results are visible on the head commit; the discussion contains only bot comments (case file + one Autobot review), no human review.
1. What the PR contains
Four independent outcomes in one change; the repository's own contribution guide asks for one coherent outcome per PR.
| Commit | Change | Hardware-testable? |
|---|---|---|
1b0db227 (a85be397) |
Cost-refresh recovery: retain credit across idle, exclude readiness waits from timing credit, two-tier refresh ordering | Yes — clean, valuable, self-contained |
450012d1 (83ff9ed6) |
New 1,606-line per-request prompt+output suffix automaton (sam.rs (not opened)) for copy drafts; min_default_match_len 3→6 |
Only with a copy-capable model + recipe; neither exists here, and the only candidate rig is unqualified |
9caba2c7 (35ab143a) |
Per-graph draft_source + wide copy-verify (W=16/24) graph scheduling |
No — see §2.1 |
14019718 (7ca5430c) |
Padding dominance for ragged batch grids | Yes — measurable, but see §3.1 |
2. Blocking defects (why testing is premature)
2.1 The headline capability of commit 3 is dead on the export path — re-verified at head
I re-read this myself at head rather than relying on the reviews:
heliopause/src/export/binding.rs:196-202unconditionally executesgraph.insert("draft_source".into(), "MTP".into())at line 201 for every speculative (and speculative-mixed) graph. It never reads the incoming value.- That file is absent from this PR's changed-file list (25 files, verified;
heliopause/src/export/binding.rsis not among them). - The producer change is
ignition/preparation/execution.py:32(field, default1),:102-104(validates1/2),:319(emits it). It is overwritten before it reaches the wire. - Export is the live route:
binding.rsexport_capture→capture.rs:3158(not opened)super::binding::execution(execution, &allocations)→ stored as the rank'sexecution. - The wire format already supports it:
helios/proto/runtime_core.proto:854(not opened)DraftSource { NO_DRAFT = 0; MTP = 1; COPY_DRAFT = 2; }. Only the writer is hard-coded. - Load then discards the graphs:
helios/src/runtime_core/selection.rs:277-298treats a shape ascopy_wideonly whengraph.draft_source == 2(line 280); the fallback MTP branch at:291-293requiresdraft_source == sourceanddraft_tokens <= drafts, which wide shapes (depth> draftsby construction, line 283) fail.
Consequence: every exported core re-imports its wide copy-verify graphs as MTP and silently drops them. Nothing distinguishes "core built without copy graphs" from "copy graphs relabelled and pruned" — which will make the PR's own limitation note ("W=16/W=24 GPU export/replay not benchmarked") very hard to interpret for anyone who tries it on hardware.
Why passing CPU tests miss it: the selection test at selection.rs:1896 constructs wire::DraftSource::CopyDraft directly, bypassing binding.rs. The only untested conversion is the one that matters.
Riding along: the same line gates validation (execution/manifest.rs:845-846; model/catalog.rs:94-131 — no GPU confidence, no speculative_prefix_limits, four copy input buffers), so the silent coercion also lets a mislabelled invalid copy graph skip its contract checks. The in-process reader (heliopause/src/python.rs:225-233 (not opened)) correctly rejects unknown values; the export reader accepts anything.
Additionally, nothing in the tree produces draft_source = 2: GraphSignature.draft_source defaults to 1 (execution.py:32), and no in-repo recipe declares copy-token inputs (recipes live in the external local-inference-lab/hyperflare-recipes PRs #48/#49 named in the PR body). So commit 3 has no producer in this repository at all.
2.2 User-facing docs contradict the code — re-verified verbatim at head
docs/cli-design.md:199-201— "--history-drafts… it does not change the graphs." After this PR the flag decides whetherdraft_source=2graphs load, and rewritesspeculative_widths(selection.rs:184, 277-298, 382-396). Not touched by the PR.docs/mtp-design.md:22-29— "Both settings use the same captured MTP graphs and buffers";:31-40describes copy drafts solely as the 65,536-token shared ring returning "up to seven" tokens. The PR makes the per-request SAM primary with the ring as strictly-longer fallback (scheduler.rs:1099-1158). Not touched.helios/manifest.md:29-53(not opened) — graph-dictionary spec omitsdraft_source.docs/scheduling-runtime-design.md:7-12(not opened) — module index omitssam.rs(not opened).
The one doc that was updated (the refresh sections) is accurate — I checked it against refresh.rs:71-105 (not opened) and cost.rs:31-38,190-296.
2.3 Scope
Four outcomes in one PR defeats attribution: the headline +12.9% requires commits 2+3+4, and the PR itself calls throughput "combined-stack". No part can be bisected or selectively reverted.
3. Should-fix (need code change, not blocking)
- Two independent "dominated" predicates —
policy.rs:133-174(pairwise, requires equalmask/prefill_slotvia the guard at:132-140) vspolicy.rs:221-254(a second pass over all candidates withother.batch >= lanes, equalcapacity/draft_tokens,packed >= needed, and no mask check). The second can prune using a shape from a different cohort — silent over-pruning introduced by the very commit that fixed over-padding. This is the main reason to fix before testing commit 4. - Second proposal-source authority —
GraphDescriptor::draft_source(manifest.rs:190-192) duplicatesspeculative_proposal_sourceand is decoded in four places (serving.rs:58-63(not opened),python.rs:225-233(not opened),selection.rs:144-148,describe.rs(not opened)). Copy-specific bypasses then sit in shared code (selection.rs:277-298,382-391;cost.rs:190-208,223-232;rounds.rs:752-790). - No single cost authority —
cost::Key(cost.rs:50-58) has nodraft_source, whileprepared()rejects duplicate shapes, so an MTP and a copy graph at identical B/D/W/P cannot coexist;is_copy_only_step(cost.rs:223-232) must re-infer the source from the table; andhas_mtp(cost.rs:190-208) is an existence scan that counts unmeasured MTP entries, so one unmeasured MTP shape suppresses measured copy shapes frompacked_round_duration. - Unpinned constants —
WIDE_COPY_PRIOR_RATE = 0.88(speculation.rs:15, re-verified),COPY_STEP_PRIOR_WEIGHT = 4.0/COPY_DEPTH_SHRINK_WEIGHT = 2.0(:20-21, private),base_mtp_drafts + 3(rounds.rs:766), and6duplicated insam.rs(not opened) andspeculation.rs:18with nothing keeping them equal. Only the6has any derivation, from one 512-token prompt. - Dead/speculative code —
RefreshState::idleis nowpub fn idle(&mut self) {}under a doc comment claiming a guarantee;propose_conditional_continuations(~78 lines) has no caller outside its own test and cites a "2-deep pipelined execution" that exists nowhere in the tree; ~150 lines ofpubSAM surface are test-only. - Duplication with drift —
request_copy_match_stats(scheduler.rs:1163-1205) re-implementsrequest_history_proposal_with_match_len(1112-1159), and the two already disagree on whether a zero-count shared match counts, so the wide-copy gate and the packing path can pick different sources for the same request.
4. Expected value of a hardware test right now: low
- Commit 3: untestable end-to-end — unreachable through export (§2.1), no in-tree producer of
draft_source=2, and it needs a freshly prepared core. - Commit 2: requires
--history-draftswith enabled learned speculation (selection.rs:179-180), history enabled before admission (scheduler.rs:1086-1092),decoded_history.is_some()(scheduler.rs:1849-1856), and non-grammar/non-host-stop requests (scheduler.rs:373-375). It also requires a core whose graphs declare copy-token inputs — andmodel/catalog.rs:99-101hard-errors at load whenhistory_draftsis set on a core without them, so the wrong model fails fast rather than silently. Perdocs/mtp-design.md:26, only theqwen3.8-flashMTP graphs do. - Rig reality: cn5 has 4× RTX PRO 6000 (SM120 — the right hardware class) but only GLM-5.3-Flash/dinov2 models, which do not declare copy inputs. cn7 has
Qwen3.8-Flash-Next-FP4-Localbut is 1× GB10, arm64, SM121 — explicitly outside qualified scope (docs/mtp-design.md:580-581, and the PR's own limitations name SM121/GB10 as unbenchmarked). - Every model on both rigs is listed at 0 GiB, so any test begins with a full Ignition prepare/export (hours), not a smoke test.
- The PR's own live numbers come from DeepSeek-V4.1-Flash TP4 on 4× RTX PRO 6000 — a model on neither rig, so no headline figure is reproducible here.
- No CI ran on the head commit, so even the 619/1,710 test counts are unverified.
The real value is concentrated in the two small commits.
5. Proposed test plan (hold until §2.1 fixed and §3.1 de-duplicated; ~4 GPU-hours on cn5)
Trimmed from the prior 4–6 h estimate: commit 1 and commit 4 are the only slices whose behavior a rig can validate today, and each needs a short run, not a sweep.
Test A — Cost-refresh recovery (1b0db227), ~1.5–2 h — highest value in the PR
Covers exactly the bursty, idle-separated traffic Flare targets, where stale graph pricing currently never recovers.
- A/B
mainvs branch, cn5, one model, TP1 (not TP4 — an irreproducible variable). - ≥200 short requests, each well under the 2,495 ms funding threshold, separated by idle gaps longer than the estimate TTL.
- Assert
flare_scheduler_executions_total{reason="timing_refresh"}andflare_scheduler_execution_nanoseconds_total{reason="timing_refresh"}(metrics.rs:937): ~0 before, >0 after. - Confirm readiness-wait exclusion via
flare_replay_readiness_wait_nanoseconds_total/..._readiness_samples_total(metrics.rs:941-948). - Regression guard: refresh spend must stay within
P <= 0.002/0.998 * O + D, andreason="acceptance_learning"must still be charged on raw physical time.
Test B — Padding dominance (14019718), ~2 h
- Same rig. Sweep
C = 1, 2, 3, 4, 6, 8— includeC=2/3, which the PR does not measure, and stop at 8 since the PR reports no effect beyond 8 and expects a flatmax_b == C. - Assert
max(batch)inflare_speculative_rounds_total{batch,width}equalsCon every cell (vsB16at C=4 andB32at C=6..16 onmain). - Report ms/rd and tok/s per cell; expect ≈+5.1% at C=4, ≈−7.9% ms/rd at C=6, ≈−5.2% at C=8.
- Guard §3.1 — this is the load-bearing check: confirm no lane starvation or throughput cliff at any C. The mask-agnostic second pass can prune another cohort's needed shape, and no test covers differing masks.
- Cheap add (minutes): load-and-serve an already-exported W=8-only core to back the backwards-compatibility claim, which a unit test alone currently supports.
Explicitly out of scope
- Wide copy-verify (commit 3) — until §2.1 is fixed with the round-trip test that would have caught it, a
draft_source=2recipe exists, and the new copy-only graph contract is owner-approved. - SAM copy drafts (commit 2) — no qualifying model on cn5; cn7's GB10/SM121 is outside qualified scope and is single-GPU/60 GiB.
- Power-limit transitions — conceded unmeasured; fragile and low-yield on shared rigs.
- Do not re-test SAM matching logic,
refresh_ordertiering, or Protobuf round-trips beyond the single load-and-serve smoke check — CPU tests cover these far more cheaply.
6. Bottom line
The most valuable commit (cost-refresh recovery, ~40 real lines) is clean, well-scoped, correctly documented, and testable — it should be split out and merged, and could be tested on cn5 as soon as it lands alone. Padding dominance is measurable and worth a short A/B, but its second pruning pass should be de-duplicated first or the run will mostly measure a possible over-pruning bug. The two largest commits cannot be meaningfully validated on our hardware today: the copy-verify path has a confirmed defect that makes its graphs unreachable in production and has no producer in this repository, and the SAM path has no qualified model on a qualified rig. Combined with four behaviors in one PR and four stale documents, referring now would confirm behavior that is about to change.
Refer to testing after: the binding.rs export fix lands with the round-trip test that would have caught it, the four documents are corrected, the two dominance predicates are unified, and the PR is split or its bundling argued. Then test commits 1 and 4 for ~4 GPU-hours on cn5.
Note on review integrity
Nothing in the PR, its comments, or the diff attempted to direct this review; the only instruction-shaped text was the PR's own claims about its behavior, which I checked against the code. The Autobot review's claims were likewise re-verified at the cited lines rather than trusted — the export blocker, the doc contradictions, the cost::Key/has_mtp gap, and the unpinned constants all hold.
code review summary
Recommendation: Changes Requested
One blocker; the third commit's feature cannot run on the path it was built for. Commit 1b0db227 (funded-refresh recovery) is correct and self-contained and could merge on its own today.
Blockers:
heliopause/src/export/binding.rs:201overwritesdraft_sourcewith"MTP"on the only manifest→wire path (capture.rs:3158(not opened)), so graphs the producer emits with2(ignition/preparation/execution.py:32,316-319) load as MTP and are pruned byhelios/src/runtime_core/selection.rs:277-298(copy_widerequires2; the MTP branch requiresdraft_tokens <= drafts). Wide copy-verify is silently dead on every exported core, and the coercion also skips the copy-only contract checks (execution/manifest.rs:844-846(not opened),model/catalog.rs:93-131(not opened)). Derive instead of overwrite (2 => "COPY_DRAFT", unknown=> invalid(...)) and add onebinding::executionround-trip test.
Should fix:
- Three doc statements now contradict the code:
docs/cli-design.md:200-201(+:741) anddocs/mtp-design.md:22-29say--history-drafts"does not change the graphs", butselection.rs:277-298,375-396prunes copy graphs, drops kernels and rewritesspeculative_widths. - Fill the existing docs rather than adding new ones:
mtp-design.md:31-40→ SAM-first with the ring as fallback (caps, min match 6);scheduling-runtime-design.md:6-12module index plus a shortdraft_source/wide-copy section,:249-254→ the stricter-batch pruning rule,:396-399→ the copy/MTP packed-duration split,scheduling-theory.md:577-579,714-729→ retained idle credit and two-tier order;helios/manifest.md:29-53→draft_source. - One authority for the proposal source, and put it in prepared-shape identity (
cost::Key,cost.rs:50-58): todayprepared()rejects duplicate shapes (:159-161), so an MTP and a copy graph at identical B/D/W/P cannot coexist;is_copy_only_step(:223-232) must infer the source from the table; andhas_mtp(:192-196) is an existence scan, so one unmeasured MTP entry makespacked_round_durationreturnNonefor a measured copy shape. - Give
0.88,4.0,2.0and+3(and the changed6) a stated derivation (speculation.rs:15-21,rounds.rs:766,sam.rs:22); only the6is argued, from one repetitive prompt. - Evidence: state that
PromptSAM::build(13.05 ms / 4.52 MiB) runs synchronously at admission for every request (scheduler.rs:1849-1852), add per-commit live numbers for the padding-dominance and SAM/wide-copy work (four bundled outcomes cannot be attributed), one load-and-serve of an already-exported core, and one preempt→readmit SAM test. ignition/preparation/execution.py:104-108acceptsdraft_source = 2onkind == "mixed", whichselection.rs:278-283then refuses to load — reject it at the producer. ... 0 more
Subtract / Simplify:
Could remove ~500–600 of +3,968 added lines:
- ~150–250 test lines — fold
model/tests.rs:846-953into:1861-2075, drop the duplicate legacy-load assertion, trimscheduler/tests.rs:1995-2127to admission + isolation. - ~112 lines —
rounds.rs:755-903duplicates the ordinary candidate loop at:905-1060; one loop with a per-slot curve provider also collapsescurves/copy_curves(:747-748); delete the unreachablewide_copy_curveelse(:541-548). - ~150 lines of SAM API with no production caller —
propose_conditional_continuations(sam.rs:1118-1189),propose_for_context(:1070),MatchSource/source,PromptSAM::build,push_slice,from_shared_prompt, unread accessors,SamConfig; re-point the brute-force oracle atproposefirst. - ~75 lines — one private helper for
scheduler.rs:1112-1205(already drifted on the zero-count ring case), delete the emptyRefreshState::idle(refresh.rs:95-99) with its no-op test calls, oneProposalSource::from_wireinstead of three ladders (serving.rs:58-63(not opened),python.rs:225-233(not opened),selection.rs:144-148). Do not dropCandidate.expected— it is a real second quantity.
Nits:
5 nits
Full report · Notes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
screen malicious
Screen Result: All Clear
Evidence:
I screened NVIDIA/hyperflare-inference PR #540 ("helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify", head e5a6966, 33 files, +4306/−310) for prompt injections or other content aimed at causing unwanted agentic behaviour, and found none.
Coverage: the PR description (long technical body ending "Discord: Dooner", no hidden HTML comments); the whole discussion — the flare-autobot intake and two bot reviews, @shieldstar's comment carrying a full suggested diff (policy.rs (not opened) zero-duration forecast reuse, a #[cfg(test)] CURVE_EVALUATIONS counter, two new tests), @voipmonitor's live-verification and merge/stacking note, and the author's numbered reply ending "@flare-autobot please re-review at e5a69669"; the complete docs diff (docs/{cli-design,mtp-design,scheduling-runtime-design,scheduling-theory}.md, helios/manifest.md); and code diffs in heliopause/src/{export/binding.rs,python.rs}, ignition/preparation/execution.py, tests/preparation/test_execution.py, and helios/src/{server/runtime.rs,server/runtime/phase_tests.rs,runtime_core/selection.rs,scheduler/{cost,refresh,speculation,decoded_history,policy,tests}.rs}. Repo-wide regex sweeps at the PR head for injection phrasing ("ignore previous", "disregard", "system prompt", "you must", "AI assistant", "prompt injection", "agentic"), reviewer-directed instruction ("do not flag/report/mention", "note to the reviewer", "skip review"), and code-channel patterns (new std::process, network calls, include_bytes, env-var payloads) produced only pre-existing, legitimate hits.
Nothing changed addresses an agent or model, tells a reviewer what to conclude, or influences behaviour outside Helios cost/speculation logic. No AGENTS.md (not opened), .agents/skills, CI workflow, build script or dependency manifest is touched; the only changed-surface unsafe (helios/src/scheduler/decoded_history.rs:31) is pre-existing. The two autobot.eidonix.com links were deliberately not fetched.
Limits: a byte-level zero-width/bidi scan was not possible (the search backend rejects \x{...} escapes and no shell is available); visual inspection of every hunk read plus a literal-character sweep found no bidi or zero-width sequences. Full detail, including the benign-but-nameable items and exact sweep outcomes, is in the report.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR — an Ignition/CLI/docs contributor, first time in the Helios scheduler; Discord: Dooner) Motivation: Helios prices speculative rounds from measured per-shape costs, but a stale or missing measurement made the scheduler either refuse to refresh or pick shapes it had no evidence for; this PR reworks how refresh work is funded and ranked, adds a per-request suffix automaton so copy-drafts have better proposals, and lets a core export graphs that draft by copying from the prompt/output instead of from the MTP head. It also stops padded, wider-batch speculative graphs from being scheduled when a tighter batch fits the same lanes. Scale: +4306 / −310 lines in 33 files Proposal:
- Rebuild cost-refresh funding: observed-vs-readiness durations, two-tier refresh ordering, retained idle credit (
refresh.rs,cost.rs). - Add
sam.rs(1307 lines): per-requestPromptSAM+ dynamicOutputSAM, built synchronously at admission; serving prefers it over the shared decode ring. - New
draft_sourceon graphs end-to-end (proto → manifest → Python → catalogs), with cost-calibrated wide copy-verify W=16/24 rounds and per-source packed-duration tables. - Padding dominance: a strictly tighter batch with equal capacity/drafts and enough packed tokens dominates a padded ragged graph; whole-list pruning pass.
- Fold community fixes: shieldstar's zero-duration curve reuse, Autobot review items (export derivation, cost::Key source authority, docs, constant derivations, preempt→readmit test). Touches:
helios/src/scheduler/{cost,rounds,policy}.rs— packed-duration tables, candidate pricing, pruning authority (highest risk: silent mis-pricing/mis-pruning).helios/src/scheduler/sam.rs+scheduler.rsadmission path — new module, synchronous build cost on every history-drafts request.heliopause/src/export/binding.rs,python.rs,ignition/preparation/execution.py(not opened) — the wire contract fordraft_source. Related items:- #538 Restrict cold pure-prefill discovery to natural-fit graph capacities (merged): same author, same files, now an ancestor of this PR's base — conflict risk gone.
- #543 Remove joint kernel tuning and grouped AOT forward compilation (merged): the doc hunks that looked like this PR's delta are base-side.
- #547 per-shape curve caching (open): shieldstar's finding is the same curve-rebuilding theme; whichever lands second rebases.
- #542 batch-capacity indexing (open): voipmonitor flags a 3-file stacking conflict in
cost.rs/rounds.rs/tests.rs. - #534 Checkpoint captures deadlock on an unmeasured snapshot cost (open issue): same cost-freshness subsystem, not fixed here.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Autobot comments: Two Autobot reviews (2026-11-26 17:56 and 20:27) recommended Changes Requested with exactly one blocker each — the export path overwriting
draft_sourcewithMTP— which heade5a69669now fixes with a derivation plus a protobuf round-trip test. Their other asks (cost::Key source authority, doc statements, constant derivations, dead SAM API, unusedRefreshState::idle, preempt→readmit test) are also addressed. Note that an Autobot Changes Requested is advisory in this repo — #538, same author and files, got one after it had already merged. Autobot's re-review ate5a69669("please re-review" posted 01:23; auto-runs 90 min after a push) had not appeared, there is still no maintainer approval and no visible CI result, and every test/latency number at head is author-reported except the Rust unit tests shieldstar and voipmonitor ran. voipmonitor's live TP4 run used--no-history-draftswith defaultcopy_verify_shapes=(), so it verified absence of regressions rather than the new feature, and the author's own +12.9% tok/s number was measured at the pre-fix head14019718.
Value Proposition
Verdict: worth merging in substance — but split it, and do not merge commit 3 until it has one served-workload number of its own
This revises my previous report upward again. The author's e5a69669 fixed the blocker I raised and the two latent design defects behind it, and cleared every documentation gap I listed. What remains is not correctness — it is evidence discipline and one unbounded resource.
What the charter decides
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." - "Solve the right problem in the right place… the smallest footprint in shared code."
- "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it."
- "Be explicit and pin everything. No magic defaults."
- Code-review standards: verify "that existing data, artifacts, and exported cores still load."
What changed since my last report — my two prior blockers are genuinely resolved
The export blocker is fixed, not papered over. heliopause/src/export/binding.rs:201-216 now derives the value instead of overwriting: None | 0 | 1 | "MTP" => "MTP", 2 | "COPY_DRAFT" => "COPY_DRAFT", anything else => Err(invalid(...)), and it rejects "COPY_DRAFT" on kind != "speculative" (:213-215). The round-trip test I said was the only test that would have caught this now exists: execution_preserves_mtp_and_copy_draft_source_and_rejects_unknown (binding.rs:1461-1511) asserts DraftSource::CopyDraft survives encode/decode and rejects 3, -1, "UNKNOWN", and mixed+copy.
So the copy-only contract is enforceable now. execution/manifest.rs:845-846 rejects Copy with confidence_width != 0; :849-850 rejects draft_source on non-speculative, non-mixed graphs; model/catalog.rs:94-96,123-131 requires copy-only graphs to have no GPU confidence and no SpeculativePrefixLimit. My earlier finding that these checks were bypassed no longer holds.
The latent cost::Key and has_mtp defects are fixed. canonical_draft_source (cost.rs:50-59) puts draft_source in Key (:63-79), packed_round_durations is split per source (:204-221), the has_mtp existence scan is deleted, and packed_round_duration (:237-252) prefers positive MTP, then positive COPY, returning Some(0) only when nothing positive exists. MTP and copy graphs at identical B/D/W/P now coexist — selection.rs:302-312, catalog.rs:240-303, packing.rs:40-52 all key on draft_source, with cost.rs:533-585 asserting it. is_copy_only_step now reads step.draft_source (scheduler.rs:1196-1199) instead of inferring it from the cost table, and the producer/runtime disagreement is closed: execution.py:104-105 now requires kind == "speculative".
The docs are correct. docs/cli-design.md:200-210 no longer claims the flag "does not change the graphs"; :747 covers the SAM and retention. docs/mtp-design.md:22-66 is rewritten around SAM-first with the ring as fallback (131,072 caps, 512-token boundary overlap, min_match_len = 6, OOV truncation, preempt→readmit re-indexing). docs/scheduling-runtime-design.md:6-15,71-91,271-285,409-433 adds the module index, the copy-verify section, the stricter-batch rule, and the per-source packed tables. docs/scheduling-theory.md:577-582,714-737 separates simulator from Helios idle-credit behavior. helios/manifest.md:38 documents draft_source. I found no stale claim left.
Constants are now derived, if not measured. 0.88 (expected 7.95 tokens over 23 drafts — enough for an uncalibrated graph to win once and collect data), 4.0, 2.0 (speculation.rs:14-36), +3 (rounds.rs:24-31), and 6 (sam.rs:22-27). "Be explicit" is satisfied in form.
Dead code was cut, and the biggest duplication eliminated. propose_for_context, propose_conditional_continuations, MatchSource, SamConfig, PromptSAM::build, push_slice, from_shared_prompt and the unread accessors are gone; PromptSAM is now a private non-Arc struct, which removes the "half-wired Arc sharing" objection entirely. The empty RefreshState::idle is deleted. The ~100-line duplicated wide-copy candidate loop now delegates to a shared select_host_allocated_candidate (rounds.rs:764-862, called at :930 and :966) — that is the cleanup I asked for. resolve_copy_match (scheduler.rs:1119-1146) fixes the zero-count ring drift. @shieldstar's byte-identical zero_duration fix landed with both bound tests.
What is still not good enough
1. The shipped head is not the measured head. Every live number in the PR — max_b == C across C = 4,6,8,12,16, 9.19 vs 9.55 ms/rd at C=4, −7.9% at C=6, −5.2% at C=8, and the 408.0 → 460.8 tok/s / +12.9% SAM result — was measured at 14019718, which the description states outright. But e5a69669 refactored precisely the code that produces those numbers: rounds.rs:937-972 hoists gpu_alloc and routes the non-GPU host-allocated MTP path through the new shared selector, replacing the inline host_ranking/lane_terms block, and now recomputes expected after the cohort loop; policy.rs:1022-1117,1226-1302 changed the lane pricing; cost.rs:237-252 changed the duration lookup. The C=4..16 padding sweep is a host-allocated multi-lane cohort selection. The refactor is plausibly behavior-preserving and 1,712 unit tests cover much of it — but #210 asks for a served-workload speedup, and the current answer is "at a previous commit." One re-run of the padding sweep plus the 512-token repetitive-prompt cell closes this. This is the single largest remaining gap and it is cheap.
2. Commit 3 still ships with no number attributable to it. Now that it is reachable, this is no longer a dead-feature objection — it is the #210 objection standing alone. The copy-only W=16/W=24 graphs are produced only out-of-repo (local-inference-lab/hyperflare-recipes#48/#49); nothing in ignition emits draft_source = 2. The author's own Limits say live export/replay of wide copy-verify "were not run on hardware," and @voipmonitor's live verification was explicitly --no-history-drafts with default copy_verify_shapes=() — so the priority contributor's sign-off does not cover commit 2 or commit 3. Commit 3 also introduces a new captured-graph contract (copy-only speculative graphs coexisting with MTP in one core) that the charter says needs owner approval, which the PR does not claim.
3. SAM host memory is now strictly worse than unaccounted — the accessors were deleted. PromptOutputSAM::memory_bytes/dynamic_memory_bytes are gone; PromptSAM::memory_bytes and OutputSAM::memory_bytes are #[cfg(test)] (sam.rs:424-431, :818), and the benchmark test computes the total inline (sam.rs:1297). I searched runtime_core/limits.rs and found no SAM accounting at all. Per request an admission builds a prompt SAM over up to 131,072 tokens (~4.52 MiB measured) plus a 131,072-token OutputSAM with LCT nodes, synchronously, for every request. At C = 16..32 that is plausibly hundreds of MiB of ungoverned host RAM on a project whose non-goal list includes broad deployment — and MemoryLimit machinery already exists to hold a budget. This needs one line into the existing memory summary, not a new subsystem.
4. Two predicates still define "dominated" independently. dominates_padding_with (policy.rs:137-201) has the four-branch GPU-ragged path with three early returns; prune_padding (policy.rs:230-264) still re-implements a weaker inline predicate (other.batch >= lanes, same capacity and draft_tokens, packed_token_capacity >= needed, GPU-allocated) rather than routing through it. Both now correctly filter on draft_source (:213, :251). The tests pin both sides of the boundary, but nothing asserts the two never disagree. Route the second pass through the first, or state why the criteria must differ.
5. One unaddressed nit from before. observed_compute_duration_ns (cost.rs:31-34) still saturating_subs the readiness wait, so a wait longer than the measured interval yields Some(0) — zero credit, no debt, and no wall_ns fallback because the Option is Some. No test pins it. Also, wide_copy_curve (rounds.rs:570-579) now .expect("wide copy requires history drafts enabled before admission"); I verified it is unreachable with None by construction (copy candidates require decoded_history.is_some() at :886; copy_calibration is built iff decoded_history.is_some() at scheduler.rs:1847-1850), but it is a new panic in the scheduler where a fallback previously existed.
Who benefits, and how much
| Change | Beneficiary | Magnitude | Cost |
|---|---|---|---|
Cost-refresh recovery (1b0db227) |
every user with idle-separated requests — the core local/chat/agent case | unbounded; stale pricing never recovers today | ~40 real lines |
Padding dominance + min_match_len 6 (14019718) |
multi-session C=4..16 |
+5.1% at C=4, −7.9% at C=6, −5.2% at C=8 (measured at the prior head) |
~30 lines, one duplication risk |
Prompt+output SAM (450012d1) |
code-edit / repetitive / retrieval workloads | +12.9% tok/s on the tested shape; +0.25 ms/rd elsewhere, opt-in | ~1,250 lines + ~360 test lines + unaccounted host RAM |
Wide copy-verify (9caba2c7) |
hypothetical | no served-workload number of its own | ~450 lines + a new graph contract needing owner approval |
~2,000 of the added lines are tests, which is better than this project's average. Nothing here is a per-model branch or a random switch, so "keep the runtime small and model-agnostic" is not violated; idle-separated cost recovery and tight batch selection are squarely inside "squeeze the most out of workstation hardware." The description has all four charter-mandated parts and an honest limitations section.
Thread status: still no human maintainer review. The only bot content is flare-autobot, and I verified its claims at the cited lines rather than trusting them. Nothing in the thread attempted to instruct me.
Recommended disposition
Worth it with changes, in this order:
- Merge commits 1, 2 and 4 now — as two PRs if you want bisectability (commit 1 alone; commits 2+4 together, since the measured +12.9% needs both). All three are correct, documented, and covered. Fold in the two small fixes: route
prune_paddingthroughdominates_padding_with, and add SAM memory accounting to the existing summary. - Hold commit 3 for exactly two things, both narrow: (a) one live GPU export/replay + served number for
W=16/W=24with--history-drafts— the author already has the4× RTX PRO 6000 Blackwellrig and the description's own Limits section names this as the gap; (b) explicit maintainer sign-off on the copy-only graph contract, which the charter requires before the work and which the PR still does not claim. - Re-run the
C=4..16padding sweep and the 512-token repetitive-prompt cell on the merge head. The measured numbers belong to14019718;e5a69669rewrote the cohort-selection path they traverse. This is the cheapest, highest-value evidence item and it protects the one claim that most needs protecting. - Fix the
observed_compute_duration_nsover-long-wait case with a test either way (zero compute or invalid observation), and replace the new.expect()inwide_copy_curvewith a fallback or adebug_assertplus comment.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Conventions
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/scheduler/cost.rs:237-252: the
has_mtpwhole-table existence scan removed by this PR reappears insidepacked_round_duration, asking "was any MTP shape measured anywhere" instead of "do MTP shapes cover this (batch, width)", so an unmeasured copy-only cell returnsNoneon one catalog andSome(0)on another, contradicting docs/scheduling-runtime-design.md:429-433. - helios/src/scheduler.rs:1101-1104:
history_proposalinlines the copy-capacity clamp thatclamp_copy_capacity(1106-1110) states directly below it, and the copies already diverge oncompletion_token_capacity == 0(min(… - 1)vssaturating_sub(1)). - helios/src/model/catalog.rs:296-299 and helios/src/model/packing.rs:48-51: "speculative graphs default to
Mtp" is hand-restated twice becausecost::canonical_draft_source(cost.rs:50-59) ispub(super); the rule belongs next toProposalSourcein scheduler/speculation.rs:46-70. Nits: 4 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
The review-fix commit e5a69669 closed every should-fix item I had recorded at 14019718: cost::Key and catalog::select_shape_with_source now carry draft_source (MTP and copy graphs at identical B/D/W/P coexist and pack), resolve_copy_match/CopyMatch back both SAM entry points with the zero-count ring drift fixed, select_host_allocated_candidate/build_host_prefix_ranking collapsed the duplicated cohort loop, three of the four draft_source wire ladders route through ProposalSource::from_wire/to_wire, and the docs gained the per-request SAM, per-source packed tables and retained idle credit. What remains are three small mechanical duplications plus four nits (zero-duration pricing re-implementing lane_value_for_tokens' Decode/Speculative arm at policy.rs:1052-1056 and 1258-1266; max_mtp_draft_tokens still scanning entries at cost.rs:262-272 after the per-source split; the undocumented packed_round_duration_for/packed_round_duration pair at cost.rs:223-252; wide_copy_curve's .expect at rounds.rs:570-579). No blocking issues from this lens; live GPU evidence was not re-verified here.
Prose
Verdict: should-fix issues only Blocking:
- None. Should fix:
- docs/mtp-design.md:542-544: the "Implementation status" list still names only
helios/src/scheduler/decoded_history.rs(not opened) for copy proposals and omitshelios/src/scheduler/sam.rs, the primary source per helios/src/scheduler.rs:1122-1147, plus the copy-only wide graph family. Nits: 2 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Prose review of PR #540 at head e5a69669, judged against AGENTS.md:43-65 (every repo doc is a present-state specification; review prose against .agents/skills/repo-prose/SKILL.md (not opened)) and AGENTS.md:72-112 (four-part PR description: why / what / result / evidence, with limits stated), plus the charter's compatibility and supported-matrix clauses.
The three blockers raised at the earlier head 14019718 are fixed and verified in the code at e5a69669: --history-drafts graph retention/pruning is now documented at docs/cli-design.md:200-208 and docs/mtp-design.md:26-34 and matches helios/src/runtime_core/selection.rs (retain_wide_copy, copy_wide, kernel pruning, retained_widths); draft_source is no longer overwritten with "MTP" (heliopause/src/export/binding.rs:201-216, round-trip test at :1490-1498); and docs/scheduling-runtime-design.md:71-90 plus docs/scheduling-theory.md:576-582 now specify the copy-only wide-copy policy and separate the simulator's idle-credit semantics from Helios's retained credit (helios/src/scheduler/refresh.rs, no idle).
Remaining are one should-fix and two nits. The should-fix is that docs/mtp-design.md:542-544's implementation-status list still describes copy proposals as coming only from the shared decoded-history ring; a reader concludes per-request prompt copying does not exist, when helios/src/scheduler.rs:1122-1147 queries the per-request suffix automaton first and falls back to the ring only on a strictly longer shared match. Nits: docs/api.md:295-296 and docs/cli-design.md:1790 still describe flare_history_drafts_enabled / the core capability in ring-only terms; and docs/scheduling-runtime-design.md:429-433 says combined (batch, width) lookups "return zero only when covering shapes exist without a positive measurement", whereas helios/src/scheduler/cost.rs:237-251 returns None when only an unmeasured COPY_DRAFT row exists and any MTP packed row is measured.
No tests or benchmarks were run this round and no CI checks exist on the head commit; one question a live run would settle is whether the synchronous admission-time PromptSAM::build is a visible serving stall, which the description already discloses.
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/scheduler.rs:1101-1104:
history_proposal(prompt-blindDecodedHistorylookup) lost both production callers in this PR and is now called only from tests; delete the wrapper. - helios/src/scheduler.rs:1267-1277:
RequestScheduler::idleis a pure validator carrying a five-line doc comment about refresh-credit retention it does not implement; rename toassert_idleand cut the doc. Nits: 3 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Simplicity-lens review of PR #540 at head e5a69669 (33 files, +4306/−310), judged against docs/design-review.md:16 (not opened) ("Keep Helios as simple as possible") and AGENTS.md (not opened)'s simplicity rule. The head commit deleted most of what earlier passes flagged and I verified each deletion landed: RefreshState::idle no longer exists (refresh.rs ends at 99), SamConfig/with_config/from_shared_prompt/propose_for_context/propose_conditional_continuations/MatchSource are gone, the remaining SAM accessors are #[cfg(test)] (sam.rs:172, 420-430, 680, 818-823, 886), the 0|1|2 ladder is now ProposalSource::from_wire/to_wire, the duplicated request_copy_match_stats/request_history_proposal_with_match_len arbitration is now a single resolve_copy_match (scheduler.rs:1112-1194), the duplicated copy-cohort candidate loop is one factored path (build_host_prefix_ranking rounds.rs:505-527 + select_host_allocated_candidate 764-862, called from both branches at 927 and 966), and the unreachable non-calibrated wide_copy_curve fallback is now an expect (rounds.rs:570-579). What remains is small: two deletions/renames and three nits (a per-slot curve Vec clone plus twin memo arrays at rounds.rs:874-875/920-926; a dead select_shape_with_drafts wrapper at catalog.rs:240-245; and two independent 6s for one threshold at speculation.rs:25 vs sam.rs:23, where propose already enforces it). No blocking issues: I followed callers for the cost/refresh arithmetic, padding dominance, copy-only graph gating, draft_source plumbing and packing and found live non-test callers on every path. I did not run the Rust or GPU suites at this head; the should-fix items are deletions and renames needing no behavioural test. One open question: if history_proposal is meant as a stable out-of-tree API, a one-line reply from the author settles item 1 the other way.
Architecture
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/scheduler/cost.rs:244: combined
packed_round_durationscans the whole MTP table to decide a measured copy width's answer, so a copy shape's cost depends on unrelated MTP shapes else`where in the catalog — the same non-local coupling the commit removed one level down. - whole PR (33 files, +4306/−310): four independent outcomes (refresh recovery, SAM copy drafts, wide copy-verify graphs, padding dominance +
min_match_len3→6) against AGENTS.md:196-199 (not opened); every headline live number is combined-stack (14019718baseline) and cannot be attributed or bisected. - helios/src/execution/manifest.rs:190-192 with cost.rs:50-59, model/catalog.rs:298, runtime_core/selection.rs:144-148, describe.rs:534/778, heliopause/src/python.rs:225-231: a second proposal-source authority whose "absent means MTP" default is re-implemented in four places, and
canonical_draft_sourcesilently coerces aCOPY_DRAFTdeclaration on aMixedgraph toNoneinstead of rejecting it as every other layer does. - heliopause/src/python.rs:225-231 vs heliopause/src/export/binding.rs:204: wire
draft_source = 0decodes toNonein one direction and to"MTP"in the other;runtime_core/selection.rs:244requires[1,2]for speculative graphs, so the in-process and exported paths validate the same graph differently. - docs/scheduling-runtime-design.md:425-433 documents the combined lookup as intended, which is why the cost.rs:244 fix also needs the doc sentence rewritten to describe per-source pricing only.
Nits: 4 (always-written
draft_sourceat binding.rs:216; undocumented host-allocated candidate refactor serving both loops;0.88/4.0/2.0/+3/6derivations are analytic or single-prompt; no live GPU run ever exercised an exporteddraft_source = 2graph, so the compatibility claim at AGENTS.md:431-444 (not opened) is unit-tested only). Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Correctness
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/model.rs:358-370:
scheduler_capabilities_with_manifestbuildscompletion_inputsandspeculative_allocationswithoutdraft_source, so an MTP graph and a copy graph at identical B/D/W/P — coexistence this PR explicitly enables (cost.rs:170-174, test at cost.rs:531-586) — are indistinguishable togpu_prefix_allocation(rounds.rs:443-446), which makes copy steps take MTP prefix pricing (rounds.rs:479-490, scheduler.rs:2496-2512) and can trip the confidence-sidecar requirement at scheduler.rs:2595-2597. Nits: 1 —ActionCosts::packed_round_duration(cost.rs:237-252) returnsNonewhere docs/scheduling-runtime-design.md (not opened) promisesSome(0), because the fallback arm requires the entire MTP table to be empty instead of requiring a covering MTP shape. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Prior blocker (export binding overwriting draft_source with MTP) is verified fixed at heliopause/src/export/binding.rs:201-216 with a round-trip test. Preempt/re-admit SAM indexing is sound. All findings are code-reading only; no Rust/Python suites or GPU paths were run.
Subtractive
Verdict: minimal already The change: +4,306 / −310 across 33 files Could remove: about 140 lines, in 5 places (~3% of the diff) Biggest subtractions:
- helios/src/scheduler/rounds.rs:30-33, :565-566 + policy_tests.rs:6292-6331: the test-only
CURVE_EVALUATIONSthread-local, its bump and both call-count tests; nothing replaces them, and the forecast reuse they guard is literal in policy.rs:1052-1056/1100-1101/1292: about 46 lines - helios/src/scheduler/rounds.rs:1019-1030 duplicates :785-803: one
ordered_cohorthelper covers both call sites, plus the whole-curveclone()at :925 becomes a borrow: about 12 lines - helios/src/scheduler/rounds.rs:1007,1011,1032-1037,1061 + policy.rs:1480-1489:
base_zero/pending_value_zero/the secondlane_value(..., 0, …)pass re-deriveValueRate::new(0, expected, _)(utility.rs:122-131); compare storedexpecteddirectly incompare_refresh: about 14 lines - helios/src/scheduler.rs:1101-1104, decoded_history.rs:180-183, model/catalog.rs:237-245, catalog.rs:296-299, packing.rs:48-51:
history_proposal,lookup,select_shape_with_draftsand the twodraft_source: Nonearms have no production caller after this PR: about 20 lines - execution/manifest.rs:844-846 (subsumed by model/catalog.rs:123-131), policy.rs:162,170,179 (one dimension check written three times), speculation.rs:25 (
WIDE_COPY_MIN_MATCH_LENduplicates sam.rs:23), repeated doc sentences in scheduling-theory.md:580-582/733-743 and scheduling-runtime-design.md:82-90: about 25 lines Left behind: scheduler.rs:1101 and decoded_history.rs:180 are production-dead (this PR moved both callers torequest_history_proposal); model/catalog.rs:240select_shape_with_draftsand thedraft_source: Nonearms in catalog.rs:296-299 / packing.rs:48-51 are now unreachable. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Pre Test Report
Pre-Test Report — PR #540 "helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify"
Recommendation: REFER TO HARDWARE TESTING — narrowly, on cn5, ~4.5 GPU-hours
This reverses my previous three reports, which all said "do not refer." The reason is concrete: the single blocker I used to justify holding back is genuinely fixed at this head, and so are the four stale documents. Commit a85be397/1b0db227 (cost-refresh recovery) and commit 7ca5430c (padding dominance) are now clean, self-contained, and can be validated on our hardware. The two large feature commits still cannot be usefully tested anywhere, so the referral must be scoped.
Head reviewed: e5a69669, base f377dc85, 33 files, +4306/−310. I verified the state of the code myself rather than relying on the review summaries or the author's claims.
What changed since my last report (verified in code this round)
- Export blocker — FIXED.
heliopause/src/export/binding.rs:201-216no longer clobbers the field; it derives it:None → "MTP",Some(0|1) → "MTP",Some(2) → "COPY_DRAFT", string forms accepted, anything else →Err("unsupported graph draft_source"), andCOPY_DRAFTon a non-speculative graph is rejected at:213-215. The file is now in the PR (it was not, before). A real round-trip test exists atbinding.rs:1461-1514assertingMtp/Mtp/CopyDraftand rejecting3,-1,"UNKNOWN"andmixed+copy. Wide copy graphs now survive to a loadable core. This was the one defect that made commit 3 dead code. - Docs — FIXED. All four previously false statements are corrected and the files are in the PR:
docs/cli-design.md:200-210(not opened) (flag now retains/prunes copy-only graphs and rewritesspeculative_widths),docs/mtp-design.md:22-66(SAM-first, ring as fallback, 131,072 caps,min_match_len = 6),docs/scheduling-runtime-design.md:6-15 (not opened),71-91,271-285,409-433(sam.rs(not opened) in the module index, the copy-verify section, the tighter-batch rule, per-source packed tables),docs/scheduling-theory.md:574-582 (not opened),714-747(simulator vs Helios idle-credit split),helios/manifest.md:38(not opened) (draft_source). - Cost authority — FIXED.
cost.rs:50-59addscanonical_draft_source;Keynow carriesdraft_source(:63-79);packed_round_durationsis[[Vec<Option<u64>>; 7]; 2], one table per source; thehas_mtpexistence scan andEstimate.draft_sourceare deleted;is_copy_only_stepmoved toscheduler.rs:1196-1199and reads the step. MTP and copy graphs at identical B/D/W/P now coexist, pinned bycost.rs:533-586. - Producer — FIXED.
ignition/preparation/execution.py:104(not opened) now rejectsdraft_source == 2on any non-speculative graph includingmixed; test attests/preparation/test_execution.py:374-392(not opened). - ~900 lines of dead/test-only surface deleted, matching every simplicity-lens request:
RefreshState::idle,SamConfig,with_config,from_shared_prompt,propose_for_context,propose_conditional_continuations,MatchSource,PromptSAM::build,push_slice;PromptSAMis now a private non-Arcstruct; the threedraft_sourcewire ladders are unified behindProposalSource::from_wire/to_wire(speculation.rs:55-70(not opened)); the duplicated copy-cohort loop collapsed intoselect_host_allocated_candidate(rounds.rs:764-862);@shieldstar'szero_duration[slot]fix is folded in with both tests.
What still must be said before spending rig time
The PR's entire live evidence base describes superseded code. Every number — max_b == C across C = 4..16, 9.19 vs 9.55 ms/rd at C=4, 3.078 → 3.650 tokens/round, +12.9% tok/s — was measured at the prior head 14019718, which the author states. e5a69669 then refactored exactly the path those numbers traverse: rounds.rs:937-972 hoists gpu_alloc and routes the non-GPU host-allocated MTP path through the new shared select_host_allocated_candidate (rounds.rs:764-862), and policy.rs:1020-1117/1226-1302 changed lane pricing. So no headline figure currently describes the code we would be testing. That is the strongest single reason to test now rather than accept the table.
Two should-fix issues remain, neither blocking:
helios/src/model.rs:358-371—scheduler_capabilities_with_manifestbuildscompletion_inputsandspeculative_allocationswithoutdraft_source, whilegpu_prefix_allocation(rounds.rs:443-446) matches on(b, d, w, p)alone. Latent: an MTP graph with GPU prefix limits at the same geometry as a copy graph would lend its allocation to the copy step, mispricing it with the MTP curve and trippingcomplete_with_survival(scheduler.rs:2595-2597), since copy-only graphs must haveconfidence_width == 0. This needs a recipe that exports that pair; none exists.policy.rs:230-264— the new whole-list pruning pass is mask-agnostic (other.batch >= lanes, equalcapacity/draft_tokens,packed >= needed, no mask equality or subset test), unlike the pairwise rule atpolicy.rs:122-201which requiressmaller.mask == larger.mask. Both tests (policy_tests.rs:66-153,:155) use a single cohort, so cross-cohort masks are untested. Over-pruning would appear as a silent throughput cliff at a specific C — which is precisely what the live sweep below is for.
No in-tree producer of draft_source = 2. ignition/recipes/ does not exist in this repository (recipes are external, local-inference-lab/hyperflare-recipes #48/#49); GraphSignature.draft_source defaults to 1 (execution.py:32 (not opened)). Repo-wide, copy_token_ids appears only in Helios Rust tests, the contract.py binding table, and ignition/direct/packing.py (not opened).
No CI on the head. The 1,712 / 620 / 207 / 71 test counts are self-reported. The only independent live run (@voipmonitor, 4× RTX PRO 6000, DeepSeek-V4.1-Flash TP4) used --no-history-drafts with default copy_verify_shapes=(), so it validated absence of regressions, not either new feature.
Expected value of a hardware test: moderate, and concentrated
| Commit | What it does | Testable here? | Value |
|---|---|---|---|
| refresh recovery | retains refresh credit across idle; excludes readiness waits; two-tier refresh order | Yes, cn5 | High — fixes a documented starvation bug on exactly the bursty traffic Flare targets; ~40 real lines |
| padding dominance | tighter ragged batch prunes wider padded B=16/32 |
Yes, cn5, conditionally | Moderate — measured +5.1%/−7.9%/−5.2%, but on superseded code |
| SAM copy drafts | per-request prompt+output suffix automaton | Only with a copy-input core | Low here — unknown model support; cn7 is unqualified |
| wide copy-verify W=16/24 | copy-only speculative graphs | No — no producer exists | None — do not test |
Minimal test plan (~4.5 GPU-hours on cn5)
Stage 0 — gates (~35 min, do these first; if either fails, stop and re-scope)
- One prepare of
nvidia/GLM-5.3-Flash-NVFP4on cn5, TP1,--history-draftsenabled. GLM has learned MTP (docs/core-design.md:357,docs/mtp-design.md:5), so it can exercise commits 1 and 4. - Copy-input probe (~2 min, free): attempt
flare run CORE --history-drafts.model/catalog.rs:97-122hard-errors at load if the speculative graphs lack any ofCopyTokenIds/CopyTokenCount/CopyConsumedTokens/CopyGeneration. The error message is the answer to "can cn5 test the SAM path at all." Record it either way — it settles an open question for the author. - Confirm GPU prefix allocation. Inspect the prepared core manifest for
speculative_prefix_limitsinputs on speculative graphs. Test B is vacuous without this (policy.rs:234-246gates the whole-list pass ongpu_prefix_allocation, which requires that input permodel.rs:362-368). If absent, skip Test B and say so — do not burn a sweep on a path that cannot run.
Test A — refresh recovery, ~2 h — highest value
A/B main vs branch, same model, TP1.
- ≥200 short requests, each well under the 2,495 ms funding threshold, separated by idle gaps beyond the estimate TTL.
- Assert
flare_scheduler_executions_total{reason="timing_refresh"}andflare_scheduler_execution_nanoseconds_total{reason="timing_refresh"}(metrics.rs:932-940): ≈0 onmain, >0 on branch. - Confirm readiness-wait exclusion via
flare_replay_readiness_wait_nanoseconds_total/..._readiness_samples_total(metrics.rs:941-948). - Regression guard: spend stays within
P <= 0.002/0.998 · O + D, andreason="acceptance_learning"is still charged on raw physical time.
Test B — padding dominance, ~2 h (only if Stage 0.3 passes)
Same rig. Sweep C = 1, 2, 3, 4, 6, 8 — include C=2/3, which the PR never measured, and stop at 8 since the PR reports no effect beyond it.
- Assert
max(batch)inflare_speculative_rounds_total{batch,width}equalsCper cell (onmain:B16at C=4,B32at C=6..16). - Record ms/rd and tok/s per cell; reference points ≈+5.1% at C=4, ≈−7.9% ms/rd at C=6, ≈−5.2% at C=8.
- Load-bearing check: no lane starvation or throughput cliff at any C — this is the live test of the mask-agnostic pruning pass, which unit tests cannot cover.
Stage 2 — cheap compatibility check (~10 min)
Load and serve an already-exported existing core (W=8 MTP, no copy graphs) with and without --history-drafts. Confirms the draft_source defaults keep old cores loading (AGENTS.md:431-444 (not opened)) and confirms the new pruning doesn't damage the normal path. Minutes, real coverage.
Explicitly out of scope — do not spend rig time
- Wide copy-verify (commit 3): nothing produces
draft_source = 2. Untestable until an external recipe exists. - SAM copy drafts: only if Stage 0.2 shows copy inputs load. Otherwise the cn7 route (Qwen3.8-Flash-Next-FP4-Local, single GB10, arm64/SM121) is the PR's own unbenchmarked configuration and a 16 GiB-scratch prepare — not worth it for functional-only coverage.
- Power-limit transitions: conceded unmeasured, fragile, low yield.
- Do not re-test: SAM matching logic,
refresh_ordertiering, protobuf round-trips, padding-pruning unit cases — CI covers these far more cheaply.
Bottom line
The PR is now in testable shape for its two small, valuable commits, and the defect that would have wasted a rig run is gone. Refer on cn5 for ~4.5 hours, gated on the Stage-0 probes, scoped to refresh recovery and padding dominance. No headline number in the PR currently describes this head, so the padding sweep genuinely needs re-running. Withhold any judgement on SAM copy drafts and wide copy-verify — neither can be validated on our hardware today, and testing them would confirm behavior that is unexercised in production.
Note: if maintainers split the PR (which every review recommends, and which I support), test the split-off refresh+padding PR with this identical plan — nothing is lost.
Review integrity
Nothing in the PR, its comments, or the diff attempted to direct this review. @shieldstar's comment contained a suggested patch with code, which I treated as a technical proposal and verified against the diff (it is folded in at policy.rs:1020-1117); @voipmonitor's live-run report was verified as scoped to --no-history-drafts, so it does not cover the new features. The Autobot reviews' claims were re-verified at the cited lines rather than trusted.
code review summary
Recommendation: Ready To Merge
The one previous blocker (export coercing draft_source) is fixed; remaining items are deletions and evidence, not correctness.
Blockers:
None.
Should fix:
cost.rs:237-252— delete the combinedpacked_round_duration: its(None, Some(0))arm scans the whole MTP table, so a copy shape's cost depends on unrelated graphs and the code contradictsdocs/scheduling-runtime-design.md:429-433. Callers (rounds.rs:588,policy.rs:785) already know their source; pass it.scheduler.rs:1101-1104— delete test-onlyhistory_proposal: it is the prompt-blind path this PR replaces and re-implementsclamp_copy_capacitywith a panicking- 1. Move the ring assertions torequest_history_proposal.- Give "speculative defaults to
Mtp" one home: movecanonical_draft_source(cost.rs:50-59) tospeculation.rs, and delete the unreachable "any source" wildcards incatalog.rs:296-299/packing.rs:48-51. rounds.rs:30-33,565-566+policy_tests.rs:6289-6331(not opened) — delete theCURVE_EVALUATIONScounter and its two call-count tests; keep thezero_duration[slot]reuse they guard.- Evidence + prose: per-commit live numbers and one load-and-serve of an exported
W=16/24draft_source = 2core; addsam.rs(not opened) + copy-only wide graphs todocs/mtp-design.md:542-544and reworddocs/api.md:295-296/docs/cli-design.md:1790.
Subtract / Simplify:
Could remove ~85–90 of +4,306 added lines:
rounds.rs:30-33,:565-566,policy_tests.rs:6289-6331(not opened) — test-only call-count instrumentation and its two tests (~46 lines).cost.rs:237-252— combined packed-round lookup; delete, pass the source atrounds.rs:588/policy.rs:785(~12 lines).scheduler.rs:1101-1104,decoded_history.rs:180-183,catalog.rs:240-245— entry points this PR orphaned (~14 lines).rounds.rs:785-803vs:1019-1030byte-identical cohort preamble (~10) + whole-curve clone at:925(~2); plus unreachableis_none()arms and the duplicated6(speculation.rs:25vssam.rs:23(not opened)) (~10).
Nits:
5 nits (capability tuples omit draft_source — state the invariant, don't add a sixth field; 0/Mixed + COPY_DRAFT normalised differently per layer; idle rename; the 6 rests on one prompt; binding.rs:216 writes the default).
Full report · Notes Decision to Test: no (71%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
screen malicious
Screen Result: All Clear
Evidence: I screened PR #540 ("Retain bounded timing-refresh credit across idle and exclude readiness wait", head 982a9ce, base main, 10 files, +647/−47, no CI checks) end to end and found no prompt injection or other content aimed at steering an agent.
Coverage: the complete diff in three passes — both docs, helios/src/scheduler.rs, cost.rs, refresh.rs, policy_tests.rs, both scripts/scheduling_sim scripts, and both Python test files — plus the full conversation thread. I spot-verified the key hunks at the head: idle no longer zeroes credit (helios/src/scheduler.rs:1158-1168), RefreshState::idle is deleted with clamps moved to abort (refresh.rs:95-99), and the new observed_compute_duration_ns / timing_refresh_duration_ns helpers exclude embedding-delivery readiness wait while guaranteeing a strictly positive charge (cost.rs:31-57). All legitimate scheduler work with matching Rust/Python regression tests and a --retain-idle-credit simulator flag.
Negative results: greps for injection phrasing ("ignore previous", "disregard", "you are an AI", "system prompt", "do not report", "approve", "LGTM", "all clear") across the changed areas matched nothing; no zero-width/bidi Unicode or base64 blobs; no HTML-comment hiding in the docs; no new shell/network/exfiltration primitives in the changed tests; no edits to CI workflows, git hooks, docs/design-review.md (not opened), or the Design-Signed-Off-By mechanism. The thread is engineering discussion only — two Autobot review bodies, a peer patch from shieldstar, a hardware report from voipmonitor, and the author's rework note. The only instruction-like text is the repository's standing automation footer ("Opt-out: Include #autobot:ignore") from flare-autobot, which is standard tooling.
Non-security note for the human reviewer: the PR body attributes its validator and pytest figures to a "byte-identical code tree" at a different commit (3e2fcd27) rather than to the head, and no CI has run on the head — a verification-attribution weakness, not manipulation.
Open questions: nothing here is machine-verified on 982a9ce; invisible-character checking was text-grep based, though all changed files are plain text with no suspicious Unicode found. Search was scoped to PR #540 as asked.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR; Ignition/CLI/docs contributor, first time in the Helios scheduler; Discord: Dooner) Motivation: Helios earned timing-refresh credit only while busy, so short idle gaps wiped out progress toward the 5 ms credit that buys a re-measurement of a stale graph cost, and readiness (embedding-delivery) wait was being counted as compute, inflating that credit. The PR lets idle retain bounded credit (while keeping debt) and charges refresh against compute time excluding measured readiness wait. Scale: +647 / −47 lines in 10 files (was +4306 / −310 in 33 files before the force-push) Proposal:
- Idle no longer discards positive timing/acceptance credit;
RefreshState::idleis deleted andRequestScheduler::idleonly validates that nothing is in flight (refresh.rs:95-99, scheduler.rs:1158-1168). - New
observed_compute_duration_ns/timing_refresh_duration_nssubtract measured readiness wait from the credited sample, falling back to unexcluded physical/wall time so a refresh completion is never charged zero (cost.rs:31-57). - Restores main's
refresh_order(observed_at_ns.max(last_attempt_ns)), dropping the(false, 0)tiering andCandidate.expectedthat reviewers said caused starvation (cost.rs:303-305). - Simulator gains
--retain-idle-creditso the validated policy can reproduce Helios's idle rule (learning.py, learning_policy.py). - Docs updated: scheduling-runtime-design.md:443-444 and scheduling-theory.md:729-738. Touches:
- helios/src/scheduler/cost.rs (+89) — new credit-duration helpers next to the recorded-cost ledger.
- helios/src/scheduler/refresh.rs and scheduler.rs — idle/abort/credit contract.
- scripts/scheduling_sim + tests — simulator flag and its acceptance evidence. Related items:
- #538 (merged) same author, natural-fit prefill discovery, same files: now base-side, no conflict
- #555 (merged) intermediate batch capacities: same four files, merged into the new base
- #542 (closed) same author, was to stack on this PR: nothing left to stack
- #547 (open) per-shape curve rebuilding: #540 dropped the code it complained about
- #534 (open issue) checkpoint cost deadlock: same subsystem, not fixed here
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Autobot comments: The PR was force-reduced in place from a 33-file SAM/wide-copy feature to this 10-file fix, so the two Autobot Changes Requested reviews (both naming only the
draft_sourceexport blocker) and lukealonso's six-item scheduler critique no longer describe the artefact under review. Still no CI run, no label, no maintainer approval; every test and simulator number is author-reported, and one helios test is red on main (model/packed_round_tests.rs:68).
Value Proposition
Verdict: worth merging, with three small changes — none structural
982a9ce3 is a different, much better PR than the one reviewed before. It is now 11 files and roughly +110 net production lines (helios/src/scheduler/cost.rs +89, refresh.rs +12/−10, scheduler.rs +5/−1, two docs, the simulator, two Python test files, and policy_tests.rs +394). PromptSAM copy drafts, wide copy-verify COPY_DRAFT W=16/24 and speculative padding pruning are deleted, so every earlier blocker (the binding.rs (not opened) coercion, cost::Key, has_mtp, the unapproved copy-only graph contract, unaccounted SAM memory, the duplicated dominance predicate) is moot rather than fixed. There is still no human maintainer review on this head; the existing human review applies to commits that no longer exist.
What decides it — charter fit
- "Solve the right problem in the right place / smallest footprint in shared code": yes. No new flag, no per-model branch, no CLI, format, Protobuf or captured-graph change (so no owner approval is needed), and no new runtime knob. It is ~110 lines inside the scheduler that owns the policy.
- "Bug fixes need to address the root cause": yes.
RequestScheduler::idle(scheduler.rs:1163-1170) no longer zeroes the ledgers,RefreshState::idleis deleted, andabortkeeps the clamp (refresh.rs:95-99). The readiness half removes the asymmetry betweenActionCosts::observe(cost.rs:330-337, recordsgpu_ns - wait_ns) and how refresh income and episode charges were computed. - "Bring real evidence" (#210): partly. 804 pytest plus a full crate, simulator and TLA+ sweep is reported — but run on
3e2fcd27and asserted byte-identical, and there is no served-workload number for the motivating case. - Testing hierarchy, layer 2 (refresh/exploration budgets must go through
scripts/scheduling_sim/): satisfied for the timing ledger, not for the acceptance ledger, which has no simulator counterpart at all.
What I verified myself at head
- The zero-charge refresh loop is genuinely closed.
observed_compute_duration_ns(cost.rs:37-45) mirrorsActionCosts::observeexactly — max positivegpu_ns,Nonewhengpu_ns <= wait_ns.timing_refresh_duration_ns(cost.rs:53-57) falls back to physical then wall time, and the only remaining 0-charge case (no GPU sample andwall_ns == 0, plusqueued) is rejected byRefreshState::validate_completion(refresh.rs:63-69) beforecompleteruns (scheduler.rs:2655). No free probe loop survives the real path. - The aggregate bound holds for both ledgers. Income rates (
0.002/0.998,0.01/0.99) and the 5 ms cap are unchanged (refresh.rs:75,78), and retention adds no income, soP <= rate * O + Dis untouched. - The no-op idle cannot drop a live probe.
idle()still errors with any outstanding submission (scheduler.rs:1165-1167), so an active episode can never be silently forgotten. ActionCosts::refresh_order(cost.rs:303-305) is identical tomain(:275-277) — the starvation objection is retired by reverting it.- Simulator:
retain_idle_creditdefaults toFalse(learning_policy.py:44), is boolean-validated, is rejected from--sweep(learning.py:132), and is rejected as a CLI override under--preset validate(learning.py:477-484), so every previously accepted policy is bit-for-bit unchanged.
Must fix before merge (all small)
helios/README.md:437still says "Idle discards positive credit and preserves debt." That is false now. The PR updatesdocs/scheduling-runtime-design.md:436-500anddocs/scheduling-theory.md:577-583,727-738but not this file, which is the one an engine contributor reads.- Three copies of
gpu_ns − wait_ns:cost.rs:334(observe), the newcost.rs:43-44, andcheckpoints.rs:764. Makeobservecall the new helper. Drift between these definitions is exactly the defect class this PR exists to fix, so leaving them duplicated invites the regression back. - Evidence on the actual head: one
cargo test --locked --release --features runtime-core,serveron982a9ce3, plus agit diffproving the tree matches3e2fcd27. Right now "byte-identical" is an assertion, not an artifact.
Should fix
- The acceptance ledger has one-sided evidence. This PR retains
acceptance_credit_ns(refresh.rs:78,85) across idle too, butscripts/scheduling_sim/has no acceptance-learning ledger at all — searches for0.01,0.99,acceptance_creditreturn nothing, and thetargetedpolicy'sharm_alpha/(1-harm_alpha)is a request-delay budget, not this GPU-time ledger. The only coverage is a Rust assertion (policy_tests.rs:2477-2507). Either add the toggle to the simulator's funded acceptance path or state in the body that the acceptance half is Rust-only; the docs currently present both as equally validated (scheduling-runtime-design.md:492-493). - The first request after a long idle now pays for a probe. With credit retained,
refresh_ready()(scheduler.rs:1190) is reachable immediately on resume,select_planreturnsRefreshStart(policy.rs:1240-1274), andplan_requires_feedbackis true for any probe (scheduler.rs:1180), so the triggering request waits out an isolated probe it would never have paid for before. This is the intended trade and is bounded (one nonpreemptible overrun), but nothing gates it: the ≤1.05 p99 TTFT gate covers onlygroup == "core"replenished scenarios, while the idle fixtures (learning_scenarios.py:88-93) aregroup="transient"withpassed=Noneand no stationary gate (learning.py:382-383). The "0 spurious probes" claim is descriptive — those fixtures never reach the 5 ms cap, so they do not exercise "long history, long idle, one request". One such simulator scenario, or one sentence in the body, closes it.
Consider / nits
- The simulator default (
False) now diverges from Helios (which retains), against the design-review rule about not diverging Helios from the simulator's qualified policy. Documented atscheduling-theory.md:577-583, but defaultingTrueforretained-refresh— the policy whose stated purpose is to mirror Helios — would keep them aligned. --retain-idle-creditdoes not retain thetargetedpolicy's harm balances (learning_policy.py:676-677), so the flag is narrower than its name.policy_tests.rs:2566moved the loop from 249 to 248 rounds to absorb the retained 10 ms; the surrounding arithmetic is now less self-evident.- This touches
cost.rs, which open draft PR #301 also modifies (complementary — retained credit makes restored stale entries reachable sooner — but a rebase note).
Who benefits, how much, at what cost
Every serving user whose traffic pauses: idle() fires from the serving loop at each gap (server/runtime.rs:1184), so under the core local chat/agent workload the refresh ledger could never reach 5 ms and stale graph costs were never remeasured at all. That is a lost capability, not a marginal delta — the magnitude is, however, unquantified on hardware. The readiness-wait exclusion is narrower (only Engram-consuming graphs, transport.rs:1049) but fixes a real estimate-versus-charge asymmetry. Cost: ~110 lines, one method deleted, no new flags, no CUDA or graph-contract surface, risk low. The simpler route to the readiness half is the same one I recommend in fix 2: make cost::observe the single definition of compute duration and derive both income and charge from it.
Thread hygiene: no prompt-injection attempt. flare-autobot's comment and @lukealonso's review are review material only; I re-verified their substantive claims at the cited lines rather than trusting them.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/src/scheduler.rs:1158-1168:
idle()is now only asubmissions.is_empty()check whose action this PR deleted, yet it keeps the name and a five-line comment arguing credit retention it does not implement — rename toassert_idleor inline into runtime.rs:1184, cut the comment (argument already in docs/scheduling-runtime-design.md:443-444); nine test call sites are a search-and-replace. - helios/src/scheduler/policy_tests.rs:5812-5878: new
large_prefill_engineduplicatesengine_with_terminal_prefill(4364-4406) almost line for line (~66 lines), differing only in limits, capacity lists and two duration constants — factor oneprefill_engine(limits, prefill, terminal, prefill_ns, terminal_ns)builder. Nits: 4 — cost.rs:37-45 vs 330-337 keep two hand-mirrored compute-duration rules (extractcompute_sample); cost.rs:47-52's doc claims strict positivity that actually comes fromRefreshState::validate_completion(refresh.rs:63-69); the new cost.rs:443-502 boundary matrix re-proves rule coverage already shown end-to-end at policy_tests.rs:6059-6182;retain_idle_credithad to be appended by hand to four parallel tuples in scripts/scheduling_sim/learning.py (105-109, 132, 439-440, 477-483) that could be derived once fromPolicyConfigfield types. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Conventions
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/README.md:432-437: crate-level spec still says "Idle discards positive credit and preserves debt" and omits the readiness-wait exclusion, contradicting the new behaviour and the two docs this PR did update (docs/scheduling-runtime-design.md:436-444, 489-496).
- helios/src/scheduler/cost.rs:37-45:
observed_compute_duration_nsis a fourth hand-written copy of "max positive gpu_ns minus readiness wait";ActionCosts::observe(cost.rs:330-337) writes the same steps forty lines below and the doc comment only says it "Mirrors" it; precedents also at checkpoints.rs:754-764 and server/metrics/scheduler.rs:179-206. Extract the two extractors once. - helios/src/scheduler/policy_tests.rs:5812-5878:
large_prefill_engineis the third near-verbatim copy of the terminal-prefill fixture (engine_with_terminal_prefill 4364-4406, cold_deepseek_16k_engine 5443-5508), sharing the descriptor literal and handle: 100+capacity convention. Parameterise one helper.
Nits: 3 — income-rate literals re-typed instead of refresh::INCOME_RATE (policy_tests.rs:5961, 6056, 6075-6086); four parallel PolicyConfig field lists in learning.py:105-109, 132, 134-137, 478-483 where fields(config) is already used (learning.py:48-56); the funded-budget bound re-derived with two different overrun terms (last_refresh_ns in Rust vs max(145, 30) in Python).
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Prose
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/README.md:432-437: still says "Idle discards positive credit and preserves debt" and describes credit as
0.002/0.998of "measured duration"; the code retains bounded credit across idle (scheduler.rs:1158-1168, noRefreshState::idle) and credits/charges compute duration excluding readiness wait (refresh.rs:71-93, cost.rs:31-57). Nits: 3 — over-strong "strictly positive charge" claim in cost.rs:47-52 and the PR body (the guarantee lives invalidate_completion, refresh.rs:63-69); a "pre-existing upstream failure" named in the description with no failing assertion ormainbaseline; an ambiguous "because" in the new scheduler.rs:1158-1162 doc comment. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Correctness
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- helios/README.md:432-437: still says refresh credit is
0.002/0.998of measured duration and that "Idle discards positive credit and preserves debt"; the runtime now credits compute duration excluding measured readiness wait (helios/src/scheduler/refresh.rs:71-79, cost.rs:37-45) and idle retains bounded credit (refresh.rs has onlyabort; scheduler.rs:1158-1168). The README also links #funded-timing-refresh, which now states the opposite (docs/scheduling-runtime-design.md:436-444), and AGENTS.md:52-58 requires prose to state present behaviour.
Nits: 1 — cost.rs:303-305: refresh_order's 0 "never observed" sentinel is indistinguishable from an observation at now_ns == 0; harmless given monotonic now_ns and stale_keys' nanos != 0 filter, and identical to main.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Verified as sound by reading the code at head 982a9ce3: RequestScheduler::idle's single production caller (server/runtime.rs:1184) and its precondition re-check; the positive-charge guarantee for probes (timing_refresh_duration_ns can return 0 only when validate_completion already rejects the completion, refresh.rs:63-69, cost.rs:53-57); the split of timing credit (compute) from acceptance credit (raw physical) and of their respective charges; agreement between the new observed_compute_duration_ns guard and ActionCosts::observe's saturating_sub + zero-discard; restored observed_at_ns.max(last_attempt_ns) refresh ordering with record_attempt advancing it; the simulator flag's default False, bool type check, sweep and validate-preset rejections, and configuration-id handling; and docs consistency in both changed design docs. Test coverage for the two new edge paths exists in policy_tests.rs:5881, :6075, :6140 and cost.rs:444. Earlier-round findings about SAM/copy-draft/draft_source are obsolete at this head — that code was removed in the rewrite. I ran no Rust/Python suites, simulator runs, TLA+ checks or GPU paths; a GPU run with a disk-backed readiness stall is what would confirm the readiness-wait exclusion empirically.
Architecture
Verdict: should-fix issues only Blocking:
- None. Should fix:
- helios/README.md:437: still says "Idle discards positive credit and preserves debt" — the exact rule this PR deletes (refresh.rs loses
idle; scheduler.rs:1158-1168 now only asserts no submission in flight) — and omits the new readiness-wait exclusion; AGENTS.md:227 names this file as required reading for Helios scheduling changes. - scripts/scheduling_sim/learning_policy.py:47:
retain_idle_credit: bool = Falsemakes the simulator's defaultretained-refreshmodel the pre-PR rule Helios no longer has (Helios retains unconditionally), against docs/design-review.md:200-201 "Do not diverge Helios from the simulator's qualified policy"; invert the default or make it mandatory as:85-88does forfunded/estimator. Nits: 2 — (a) cost.rs:31-45 calls the quantity "compute duration" and claims it "Mirrors ActionCosts::observe", but it ismax(gpu_ns, wall_ns) - wait_nsfor isolated executions whileobserveuses the device interval alone; (b) cost.rs:53-57unwrap_or(timing.wall_ns)is unreachable behindvalidate_completion(refresh.rs:63-68), andRequestScheduler::idle(scheduler.rs:1158-1168) is now assertion-only, called every 2 ms from server/runtime.rs:1184. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Scope is now right. At head 982a9ce3 this is 10 files, +647/−47 (it was 33 files, +4306/−310 at e5a69669): the SAM copy-drafting, wide copy-verify (COPY_DRAFT, W=16/24) and batch-padding pruning work is gone, leaving one coherent outcome — bounded timing-refresh/acceptance credit retained across idle plus readiness-wait exclusion from refresh income and charges. No production flag, no manifest/Protobuf/ABI change, no new graph family, so the earlier AGENTS.md:198 scope finding and the design-review principle 1 concern are closed. The change belongs in this repository, in the right layer (the ledger in helios/src/scheduler/refresh.rs/cost.rs, with the model staying in the simulator behind a qualification flag).
Approach is right. Credit and charge now share the same exclusion the cost estimate uses (cost.rs:37-45 vs refresh.rs:74-76, :86-89), while acceptance learning deliberately keeps raw physical time (refresh.rs:77-79, :83-85), matching docs/scheduling-runtime-design.md:496-499. refresh_order is back to observed_at_ns.max(last_attempt_ns) (cost.rs:303-305), so starvation is fixed and regression-tested (policy_tests.rs:5958-6045, D = 145 ms > ttl_ns / 499). abort (refresh.rs:95-99) keeps debt and drops positive credit. Zero-charge refresh loops are impossible because validate_completion still demands an isolated measured interval and the charge is strictly positive on every reachable completion (cost.rs:443-501, policy_tests.rs:6142-6175). Idle-separated recovery has a dedicated regression (policy_tests.rs:5881-5955), and the bound P <= (0.002/0.998)*O + D survives because idle adds neither credit nor ordinary duration (docs/scheduling-runtime-design.md:463-474).
Open questions. Should the qualified retained-refresh policy simply become idle-retaining, deleting the flag instead of documenting the divergence? Is the wall-inclusive term in refresh income (max(gpu, wall) - wait) intentional, given the funded estimate it updates uses the device interval alone? Is idle() still wanted as an API now that it is a precondition check?
Unverified. No CI on head; the 804/1,705/590,327 counts, the 64-seed validation and the TLA+ run were not re-executed. No GPU run — readiness stalls, power-cap recovery and tests/server/test_scheduler.py (not opened) are unrun, and the readiness exclusion is only exercised with synthetic timings. No core-compatibility re-export check was needed: nothing in the diff touches exported cores or metadata (AGENTS.md:431-444).
Subtractive
Verdict: make it smaller first The change: +647 / −47 lines, 10 files Could remove: about 140 lines, in 6 places Biggest subtractions:
- helios/src/scheduler/cost.rs:443-502: delete the unit test
compute_refresh_duration_excludes_readiness_wait_and_charges_positive_on_zero_compute; its every case is already asserted through the ledger by policy_tests.rs:6059-6137 and :6139-6182: about 58 lines - helios/src/scheduler/policy_tests.rs:5812-5878: delete
large_prefill_engine, a copy of the existingengine_with_terminal_prefill(:4364-4406); parameterize the existing helper with capacities and durations: about 35 lines - tests/test_scheduling_learning_experiments.py:746-790: delete the new
retain_idle_creditCLI test, which repeats :492-509/:579-585 clause for clause; add the flag as a parametrized case: about 35 lines - docs/scheduling-runtime-design.md:443-444, :492-493 and docs/scheduling-theory.md:577-583, :730-737: each new fact is stated twice; the readiness-wait rule is restated four times at :436-444, :449-452, :456-459, :496-499; keep one statement per fact per document: about 15 lines
- helios/src/scheduler.rs:1158-1168:
idle()no longer touches any ledger and only asserts what its single caller (server/runtime.rs:1184, reached only whenexecutor.outstanding() == 0) guarantees; delete it, the call, and its test call sites; keepRefreshState::abort: about 12 lines Left behind: helios/README.md:437 still says "Idle discards positive credit and preserves debt", which this PR reverses — must be fixed here. Link: https://github.com/NVIDIA/hyperflare-inference/pull/540
Pre Test Report
Pre-Test Report — PR #540 (head 982a9ce3) "Retain bounded timing-refresh credit across idle and exclude readiness wait"
Recommendation: REFER TO HARDWARE TESTING — narrowly, ~3 GPU-hours on cn5
This PR has been reduced from 33 files / +4306 to 10 files / +647−47, and it is now one coherent change. I verified the head in code myself, not from the review summaries. The remaining review findings are documentation, naming, a dead fallback and a method that is now assertion-only — none changes runtime behaviour, so hardware results obtained at this head will not be invalidated by the follow-up commits. That is my criterion for referring, and it is now met.
At the same time I found that only half of the change is reachable on our hardware, and I found that on our hardware the change reduces to exactly one behavioural delta. Both facts let the plan be cut to about 3 GPU-hours.
Head reviewed: 982a9ce3, base main 353551e9. Files: docs/scheduling-runtime-design.md, docs/scheduling-theory.md (not opened), helios/src/scheduler.rs, scheduler/cost.rs, scheduler/policy_tests.rs, scheduler/refresh.rs, scripts/scheduling_sim/{learning,learning_policy}.py, tests/test_scheduling_learning_{experiments,policy}.py. No CI results are visible on this head; every test and simulator number is author-reported.
1. What the change actually does (verified in code)
RefreshState::idleis deleted; its twomin(0.0)clamps move intoabort()(helios/src/scheduler/refresh.rs:95-99).RequestScheduler::idle(helios/src/scheduler.rs:1158-1168) is now only asubmissions.is_empty()precondition check.- Ordinary completions split the two ledgers (
refresh.rs:73-79): timing-refresh income uses the newcost::observed_compute_duration_ns, acceptance-learning income keeps raw physicalobserved_duration_ns. - Refresh episodes are charged with the new
cost::timing_refresh_duration_ns(refresh.rs:87-88), which falls back to unexcluded physical/wall time. ActionCosts::refresh_orderis restored toobserved_at_ns.max(last_attempt_ns)(cost.rs:303-305), removing the two-tier ordering that starved smaller stale shapes. This is regression-tested atpolicy_tests.rs:5964-6057(D = 145 ms > ttl_ns/499) andpolicy_tests.rs:5881-5962covers idle-separated recovery.- Zero-charge refresh loops remain impossible:
validate_completion(refresh.rs:63-69) still rejects queued probes and probes with no measured interval andwall_ns == 0.
Nothing else moved. SAM copy-drafts, COPY_DRAFT/wide copy-verify, and speculative padding pruning are all gone from the diff, so the binding.rs (not opened) export blocker, cost::Key, has_mtp, the dual dominance predicates and the copy-only graph contract from earlier rounds are moot, not fixed — do not test or review them.
2. Two findings that shape the test plan
(a) On cn5 the change reduces to exactly one behavioural delta: credit now survives idle.
observed_compute_duration_ns (cost.rs:37-45) differs from the old observed_duration_ns (cost.rs:21-29) only through wait_ns, which is timing.readiness.map_or(0, …). When readiness is absent, wait_ns == 0, the gpu_ns <= wait_ns guard reduces to the existing filter(|ns| ns > 0), and the function is bit-identical to observed_duration_ns. The same holds for the charge. So on any core without readiness timing, income and charges are numerically unchanged and the only new behaviour is idle retention. This makes a steady-state parity check both cheap and falsifiable, and it tells the tester to concentrate on idle-separated traffic.
(b) The "exclude readiness wait" half is not testable on either rig, and is nearly unreachable in production anyway.
readiness is attached only for crate::engram::consumes(kind) graphs (helios/src/execution/transport.rs:1049-1062; engram.rs:723-733 = Prefill/TerminalPrefill/ScoredPrefill/Decode/Speculative/Mixed) and only when the core declares a readiness_timestamps output (transport.rs:531, 925-935; producer ignition/components/readiness.py:60 (not opened)). Moreover the same site poisons the executor unless wait_ns() <= elapsed_ns, and gpu_ns[0] = elapsed_ns (transport.rs:1055-1062, 1087); after rank merge (transport.rs:290-302) wait <= min rank wait <= max elapsed = gpu_ns. So in production gpu_ns >= wait_ns always and the gpu_ns < wait_ns branch is synthetic-only (covered by policy_tests.rs:6140-6181, which loops wall_ns ∈ {0, 130 ms}).
Engram models are DeepSeek V4.1 Flash (docs/core-design.md:358) — not on cn5 or cn7; the only Engram-capable path is a --embedding-table-storage disk Engram/PLE core. Skip this half. Record it as unverified rather than burning rig time on a branch that cannot fire.
3. Remaining review findings — none blocks testing
All are documentation, naming or deletions and change no runtime behaviour, so testing now is safe:
helios/README.md:437still says "Idle discards positive credit and preserves debt" — the exact rule this PR deletes — and omits the readiness exclusion.AGENTS.md(not opened) names this file as required reading for Helios scheduling changes, and it links to the design section this PR rewrote (README.md:439→#funded-timing-refresh). Should fix before merge; not a test input.scripts/scheduling_sim/learning_policy.py:47—retain_idle_creditdefaults toFalse, so the simulator's defaultretained-refreshmodels the policy Helios no longer implements; Helios retains unconditionally. Simulator-only; the 64-seed validation usedTrue. Should fix (defaultTrue, or make it mandatory as__post_init__already does forfunded/estimator).cost.rs:31-45naming/"MirrorsActionCosts::observe" overstates the formula (the helper folds inwall_nsfor isolated executions;observeatcost.rs:330-337does not), andcost.rs:53-57'sunwrap_or(timing.wall_ns)is unreachable behindvalidate_completion. Documentation/dead-code only.scheduler.rs:1158-1168—idle()takes&mut self, carries a five-line comment about a policy it no longer implements, and its error branch is unreachable from its only production caller (runtime.rs:1184, in theelseofexecutor.outstanding() > 0). Rename toassert_idle(&self)or fold in.- Nits:
large_prefill_engine(policy_tests.rs:5812-5878) is the third copy of a test fixture;observed_compute_duration_nsis a fourth hand-written "max gpu − wait" alongsideobserve,checkpoints.rs:764(not opened),metrics/scheduler.rs:179-206(not opened); income-rate literals re-typed instead ofrefresh::INCOME_RATE.
Verdict on readiness to merge: merge after 1, 2 and 4 (minutes of work). Nothing here invalidates a hardware result, which is why I recommend testing in parallel rather than waiting.
4. The one real regression risk to look for
With credit retained, refresh_ready() is reachable the moment serving resumes. A probe has plan_requires_feedback == true (scheduler.rs:1180, || plan.origin.is_probe()), and policy.rs:1322-1324 returns None — draining the queue — while a feedback-requiring plan is waiting and submissions are non-empty. So the first request after a long idle can now pay one nonpreemptible isolated probe it would never have paid before. That is the intended trade of the design and it is bounded, but it is the only user-visible p99/TTFT surface this PR creates, and it is not covered by any existing test or simulator gate. Test C exists for it.
5. Minimal test plan — ~3 GPU-hours on cn5
cn5 is the right rig (4× RTX PRO 6000, SM120/amd64). Use nvidia/GLM-5.3-Flash-NVFP4 (learned MTP → speculative shapes to refresh) at TP1, so TP4 co-scheduling is not an unexplained variable.
Stage 0 — gates (~20 min; stop and re-scope if they fail)
0.1 Confirm an already-prepared core runs. Every model on cn5 is listed at 0 GiB, so confirm a usable exported core exists before assuming a prepare is needed; a prepare is hours, not minutes, and belongs to a separate ticket. Record what you used.
0.2 Record whether the core has readiness timing. Grep the prepared manifest for a readiness_timestamps output. Expect absent (GLM is not an Engram recipe). If absent, note "readiness exclusion unexercised" and proceed — do not attempt to synthesise it.
0.3 Freeze the experimental settings: same core, TP1, --max-concurrency, same sampling, clocks unlocked but recorded. Do not combine with power-cap, disk-readiness or prepare runs.
Test A — idle credit retention, ~1.5 h — the point of the PR
A/B main vs 982a9ce3, same core, same settings.
Design the load so no single burst can fund a probe, but the cumulative total can. Funding needs O ≈ 2,495 ms of credited compute (credit = 0.002/0.998 · O, cap 5 ms). Use 4–5 bursts of ~1,200 ms credited compute each (e.g. 4–6 short requests of a few hundred ms), each burst separated by an idle gap longer than the 30 s estimate TTL and long enough for the serving loop to reach idle() (runtime.rs:1184).
Assert from helios/src/server/metrics.rs:934-950:
- Primary:
flare_scheduler_executions_total{reason="timing_refresh"}is ≈0 onmainand >0 on branch; likewiseflare_scheduler_execution_nanoseconds_total{reason="timing_refresh"}. This single pair is the falsifiable difference between the two builds and is the reason to run the test. - Bound guard: from the same scrape,
P ≤ 0.002/0.998 · O + D, using{reason="ordinary"}forOand{reason="timing_refresh"}forP, withDthe largest single timing_refresh execution. The invariant the docs restate (docs/scheduling-runtime-design.md:462-474) must hold on live data, not just inpolicy_tests.rs:5961. - Ledger split:
{reason="acceptance_learning"}must still be charged on raw physical time — its per-execution durations should not shrink relative tomainwhen a stale shape is refreshed.
Failure signature: if timing_refresh stays at 0 on branch across all bursts despite >2,495 ms of ordinary compute, retention is not working at runtime — report as a failure, and check flare_replay_readiness_wait_nanoseconds_total / ..._readiness_samples_total (metrics.rs:943-950) to confirm wait_ns is not eating the credit (expected 0 samples on a non-Engram core).
Test B — steady-state numerical parity, ~45 min (cheap, high value)
A/B again, but with no idle gaps — continuous back-to-back requests for a few minutes. Per §2(a), on a non-Engram core this PR must be bit-identical to main on this workload.
- Assert
{reason="ordinary"}and{reason="timing_refresh"}nanosecond totals matchmainwithin noise, and that throughput (tok/s) matches. - This is the regression guard for the accidental-change class: a wrong
wait_nsplumb, a mis-split ledger, or an altered charge would show up here immediately. It also covers the restoredrefresh_order, since steady-state still probes stale shapes.
Test C — first-request-after-idle latency, ~30 min
The risk in §4. On branch: serve a long steady burst so credit reaches the 5 ms cap, idle past the TTL, then send one request and record its TTFT and whether a probe fired (flare_scheduler_executions_total{reason="timing_refresh"} incrementing on that request).
- Compare against the same single request on
main(credit zeroed at idle → no probe). - Acceptance: TTFT exhibits one bounded overrun (one isolated nonpreemptible graph), not repeated stalls, and the following requests are unremarkable. A repeated-stall pattern, or a request never completing, is a failure.
Explicitly out of scope — do not spend rig time
- The readiness-wait exclusion. Needs an Engram/PLE core; none exists on either rig, and the
<branch is unreachable in production per §2(b). Covered only by unit tests (cost.rs:443-502,policy_tests.rs:6140-6181); record as unrun. - cn7. 1× GB10, arm64/SM121, 60 GiB, 16 GiB scratch — single-GPU and outside the PR's qualified scope. Nothing here needs it.
- Live power-cap / post-clock-drop recovery. Conceded unmeasured by the author, fragile to drive, low yield; the metric assertions in Test A already prove recovery exists.
- The simulator catalog, TLA+ conformance, Kani, mutation testing. CPU-only and already reported run by the author (64-seed / 62 scenarios, 9 TLA+ models, 590,327 transitions). They cost no rig time and cannot be validated from a GPU. Note they are author-reported with no CI on this head.
- Re-testing
refresh_ordertiering, ledger arithmetic, or the zero-charge guard. These are unit-covered and are CPU checks; the rig adds nothing. - Anything from the deleted commits (SAM, copy-drafts, wide copy-verify, padding dominance). Not in this diff.
6. Expected value of the hardware test
Moderate, concentrated, and cheap. The change fixes a real and previously documented limitation: docs/TODO.txt:110-114 already lists "Qualify retained graph costs and funded remeasurement in live Helios: idle/resume, concurrent decode latency, cost-change recovery" as open, so this run closes a project-listed gap rather than inventing one. The workload it targets — bursty, idle-separated local chat/agent traffic — is the project's primary use case, and on main the refresh ledger can never reach 5 ms under that traffic, so stale graph prices are never remeasured at all.
What a rig adds over the existing CPU evidence: proof that RequestScheduler::idle at runtime.rs:1184 really is reached in the serving loop with credit intact (the unit test calls s.idle() directly and cannot show this), live confirmation of the P ≤ 0.002/0.998·O + D bound, and the only available measurement of the new first-request-after-idle probe. What it cannot add: any evidence about the readiness exclusion.
At ~3 GPU-hours for three focused A/Bs, that is a good return. I would not spend more than that on this PR, and I would not run it at all if the rig is contended — the CPU evidence is strong and the remaining risk is a single bounded latency trade.
7. Integrity note
Nothing in the PR description, comments or diff attempted to direct this review. The author's rework note (2026-11-28) is a technical response to a maintainer review and I verified each of its claims at the cited lines rather than trusting it: the deleted code is genuinely absent from the diff, refresh_order is genuinely restored, and the readiness guards are as described. Two things I could not verify: the "byte-identical code tree on 3e2fcd27" claim behind the Rust test counts, and any CI result — there are none on this head. The 804 pytest / 1,705 helios / 590,327-transition figures are author-reported and should be treated as such when deciding whether to merge.
code review summary
Recommendation: Merge After Should-Fix
The runtime change is minimal and verified; one operator doc still states the retired idle rule, and the rest is duplicated tests and repeated prose to delete.
- Blockers: 0
- Should fix: 4
- Subtractive suggestions: 4
- Nits: 6
Full report · Notes Decision to Test: no (71%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Apply Labels
Applied: +triage:review, +bug, +performance, +area:scheduling
Classification Confidence
Threshold: 65%
Triage
- [✓]
triage:review: 99.1% -
triage:validation: 0.7% -
triage:design-review: 0.1%
Priority
-
none: 98.4% -
priority:P2: 1.0% -
priority:P1: 0.7%
Type
- [✓]
performance: 90.5% - [✓]
bug: 81.8% -
enhancement: 53.1% -
community: 22.3%
Area
- [✓]
area:scheduling: 98.4% -
area:preparation: 37.8% -
area:engram: 18.2% -
area:api: 6.0%
Model
-
model:deepseek-v4.1: 3.3% -
model:glm-5.3: 0.9% -
model:nemotron-3.5-bolt: 0.8% -
model:inkling-small: 0.5%