PR #540: helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/c4cf2583-d300-4cd8-8fc7-566e82d46ebc

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.

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:

Full report · Notes

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:

  1. "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
  2. "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."
  3. "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:

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:

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:

  1. Half-wired generality. from_shared_prompt shares an Arc<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). Likewise propose_for_context (sam.rs:1070) and propose_conditional_continuations (sam.rs:1118) are used only in sam.rs tests; propose_conditional_continuations exists "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.
  2. Aggregate memory is unaccounted. The PR reports 0.37/1.27/4.52 MiB per 8k/32k/131k-token prompt SAM, but not the per-request total across max_active requests (prompt SAM + up to 131,072-token OutputSAM + LCT nodes). At C=16..32 on a workstation this could be hundreds of MiB of host RAM that nothing budgets against, even though the runtime already has MemoryLimit machinery (helios/src/runtime_core/limits.rs (not opened)). One line of accounting is enough.
  3. 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:

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.

Worth it with changes, in this order:

  1. 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 trimming propose_for_context / propose_conditional_continuations / unwired from_shared_prompt, adding per-request memory accounting, and fixing docs/mtp-design.md + docs/cli-design.md (not opened); (c) wide copy-verify, held until somebody runs copy-only W=16/W=24 export and replay on real hardware and reports a win over the existing W=8 copy path on a served workload — and until a maintainer signs off on the copy-only speculative graph contract.
  2. 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 in policy.rs:139-174 vs policy.rs:225-254 and test that they agree.
  3. 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:

Should fix:

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

Full report · Notes

Simplicity

Verdict: should-fix issues only

Blocking:

Should fix:

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.

Full report · Notes

Conventions

Verdict: should-fix issues only

Blocking:

Should fix:

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

Full report · Notes

Correctness

Verdict: blocking issues

Blocking:

Should fix:

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).

Full report · Notes

Prose

Verdict: blocking issues Blocking:

Full report · Notes

Subtractive

Verdict: make it smaller first The change: +3965 / -119 lines (25 files) Could remove: about 685 lines, in 8 places Biggest subtractions:

Full report · Notes

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:

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

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)

  1. Two independent "dominated" predicates — policy.rs:139-174 vs policy.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.
  2. Second proposal-source dimension — GraphDescriptor::draft_source duplicates speculative_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).
  3. Cost semantics depend on catalog composition — cost.rs:192-201 skips 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.
  4. Unpinned constants — WIDE_COPY_PRIOR_RATE=0.88, COPY_STEP_PRIOR_WEIGHT=4.0, COPY_DEPTH_SHRINK_WEIGHT=2.0 (speculation.rs:15-21), +3 at rounds.rs:766, and 6 duplicated in sam.rs:22 (not opened) and speculation.rs:18 with nothing keeping them equal. Only the 6 has any derivation (one 512-token prompt).
  5. Dead/speculative code — RefreshState::idle is now pub fn idle(&mut self) {} (refresh.rs:99) under a doc comment claiming a guarantee; propose_conditional_continuations (~78 lines) has no caller outside sam.rs:1505 (not opened) and cites a "2-deep pipelined execution" that does not exist; ~150 lines of pub SAM surface are test-only.
  6. Duplication with drift — request_copy_match_stats (scheduler.rs:1163-1205) re-implements request_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

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.

  1. A/B main vs branch on cn5, single model, TP1 (not TP4 — irreproducible variable).
  2. ≥200 short requests, each < 2,495 ms, separated by idle gaps beyond the estimate TTL.
  3. Assert flare_scheduler_executions_total{reason="timing_refresh"} and ..._execution_nanoseconds_total{reason="timing_refresh"} (metrics.rs:932-939): ~0 before, >0 after.
  4. Confirm readiness-wait exclusion via flare_replay_readiness_wait_nanoseconds_total / ..._readiness_samples_total (metrics.rs:941-948).
  5. Regression guard: refresh spend must stay inside P <= 0.002/0.998 * O + D.

Test B — Padding dominance (7ca5430c), ~2–3 h

  1. Same rig. Sweep C = 1, 2, 3, 4, 6, 8, 12, 16 (include C=2/3, which the PR does not measure).
  2. Assert max(batch) in flare_speculative_rounds_total{batch,width} equals C on every cell (vs B16 at C=4 and B32 at C=6..16 on main).
  3. 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.
  4. Guard §3.1: confirm no lane starvation — over-pruning shows up as a regression at some C.
  5. 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


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.

Full report · Notes

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:

Should fix:

Subtract / Simplify:

Could remove ~550–685 of +3,965 added lines:

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.

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:


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)

  1. The export defect is now independently confirmed as the blocker. My earlier finding that a recipe cannot get draft_source=2 onto 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, where graph.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)).
  2. 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-fit policy.rs hunks and the docs/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.
  3. 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 requires smaller.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.
  4. New caveat: proposal source has no single authority in the cost model. cost::Key (cost.rs:50-58) has no draft_source and prepared() rejects duplicate shapes (cost.rs:159-161), while refresh_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).
  5. 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

2. Escalation: the export coercion, confirmed as the sole blocker

3. New verified findings at the current head

4. Process

Open questions still unanswered

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.

Full report · Notes

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

  1. "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
  2. "Solve the right problem in the right place… the smallest footprint in shared code."
  3. "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it."
  4. "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:

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.

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:

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.

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:

  1. Half-wired generality (~150 lines with no production caller). I confirmed by search that propose_for_context (sam.rs:1070) and propose_conditional_continuations (sam.rs:1118) are referenced only from sam.rs tests. 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 the Arc sharing is exercised only in tests (sam.rs:1523-1530). Delete these or state the planned caller.
  2. Aggregate memory is unaccounted. The PR reports 0.37/1.27/4.52 MiB per prompt SAM but not the per-request total across max_active requests (prompt SAM + up to 131,072-token OutputSAM + LCT nodes). dynamic_memory_bytes() and memory_bytes() exist (sam.rs:976-983) but are read only by tests. At C=16..32 this could be hundreds of MiB of host RAM that nothing budgets against, even though MemoryLimit machinery exists (runtime_core/limits.rs (not opened)). One line of accounting into the existing summary is enough.
  3. 13 ms build on the admission path is unexplained. PromptSAM::build is 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:

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:

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.

Worth it with changes, in this order:

  1. 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.
  2. Unblock (d) first with the smallest possible change: make binding.rs:201 derive the value instead of overwriting, plus a binding::execution round-trip test. Then re-run the tests — expect the wide-copy coverage to start exercising something real, and expect any latent cost::Key collision 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.
  3. Fix in (a) before merging: drop the empty RefreshState::idle; decide whether readiness-wait > interval means zero compute or an invalid observation.
  4. 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:

Full report · Notes

Subtractive

Verdict: make it smaller first The change: 25 files, +3968 / −119 Could remove: about 710 lines, in 9 places Biggest subtractions:

Full report · Notes

Conventions

Verdict: should-fix issues only Blocking:

Full report · Notes

Prose

Verdict: blocking issues

Blocking:

Should fix:

Nits: 3 Link: https://github.com/NVIDIA/hyperflare-inference/pull/540

Full report · Notes

Correctness

Verdict: blocking issues Blocking:

Full report · Notes

Architecture

Verdict: blocking issues Blocking:

Full report · Notes

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:

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

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)

  1. Two independent "dominated" predicates — policy.rs:133-174 (pairwise, requires equal mask/prefill_slot via the guard at :132-140) vs policy.rs:221-254 (a second pass over all candidates with other.batch >= lanes, equal capacity/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.
  2. Second proposal-source authority — GraphDescriptor::draft_source (manifest.rs:190-192) duplicates speculative_proposal_source and 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).
  3. No single cost authority — cost::Key (cost.rs:50-58) has no draft_source, while prepared() 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; and 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 packed_round_duration.
  4. 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), and 6 duplicated in sam.rs (not opened) and speculation.rs:18 with nothing keeping them equal. Only the 6 has any derivation, from one 512-token prompt.
  5. Dead/speculative code — RefreshState::idle is now pub 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 of pub SAM surface are test-only.
  6. Duplication with drift — request_copy_match_stats (scheduler.rs:1163-1205) re-implements request_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

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.

  1. A/B main vs branch, cn5, one model, TP1 (not TP4 — an irreproducible variable).
  2. ≥200 short requests, each well under the 2,495 ms funding threshold, separated by idle gaps longer than the estimate TTL.
  3. Assert flare_scheduler_executions_total{reason="timing_refresh"} and flare_scheduler_execution_nanoseconds_total{reason="timing_refresh"} (metrics.rs:937): ~0 before, >0 after.
  4. Confirm readiness-wait exclusion via flare_replay_readiness_wait_nanoseconds_total / ..._readiness_samples_total (metrics.rs:941-948).
  5. Regression guard: refresh spend must stay within P <= 0.002/0.998 * O + D, and reason="acceptance_learning" must still be charged on raw physical time.

Test B — Padding dominance (14019718), ~2 h

  1. Same rig. Sweep C = 1, 2, 3, 4, 6, 8 — include C=2/3, which the PR does not measure, and stop at 8 since the PR reports no effect beyond 8 and expects a flat max_b == C.
  2. Assert max(batch) in flare_speculative_rounds_total{batch,width} equals C on every cell (vs B16 at C=4 and B32 at C=6..16 on main).
  3. 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.
  4. 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.
  5. 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


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.

Full report · Notes

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:

Should fix:

Subtract / Simplify:

Could remove ~500–600 of +3,968 added lines:

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:

Full report · Notes

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

  1. "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
  2. "Solve the right problem in the right place… the smallest footprint in shared code."
  3. "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it."
  4. "Be explicit and pin everything. No magic defaults."
  5. 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.

Worth it with changes, in this order:

  1. 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_padding through dominates_padding_with, and add SAM memory accounting to the existing summary.
  2. Hold commit 3 for exactly two things, both narrow: (a) one live GPU export/replay + served number for W=16/W=24 with --history-drafts — the author already has the 4× RTX PRO 6000 Blackwell rig 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.
  3. Re-run the C=4..16 padding sweep and the 512-token repetitive-prompt cell on the merge head. The measured numbers belong to 14019718; e5a69669 rewrote the cohort-selection path they traverse. This is the cheapest, highest-value evidence item and it protects the one claim that most needs protecting.
  4. Fix the observed_compute_duration_ns over-long-wait case with a test either way (zero compute or invalid observation), and replace the new .expect() in wide_copy_curve with a fallback or a debug_assert plus 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:

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.

Full report · Notes

Prose

Verdict: should-fix issues only Blocking:

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.

Full report · Notes

Simplicity

Verdict: should-fix issues only Blocking:

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.

Full report · Notes

Architecture

Verdict: should-fix issues only Blocking:

Full report · Notes

Correctness

Verdict: should-fix issues only Blocking:

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.

Full report · Notes

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:

Full report · Notes

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)

  1. Export blocker — FIXED. heliopause/src/export/binding.rs:201-216 no 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"), and COPY_DRAFT on 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 at binding.rs:1461-1514 asserting Mtp/Mtp/CopyDraft and rejecting 3, -1, "UNKNOWN" and mixed+copy. Wide copy graphs now survive to a loadable core. This was the one defect that made commit 3 dead code.
  2. 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 rewrites speculative_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).
  3. Cost authority — FIXED. cost.rs:50-59 adds canonical_draft_source; Key now carries draft_source (:63-79); packed_round_durations is [[Vec<Option<u64>>; 7]; 2], one table per source; the has_mtp existence scan and Estimate.draft_source are deleted; is_copy_only_step moved to scheduler.rs:1196-1199 and reads the step. MTP and copy graphs at identical B/D/W/P now coexist, pinned by cost.rs:533-586.
  4. Producer — FIXED. ignition/preparation/execution.py:104 (not opened) now rejects draft_source == 2 on any non-speculative graph including mixed; test at tests/preparation/test_execution.py:374-392 (not opened).
  5. ~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; PromptSAM is now a private non-Arc struct; the three draft_source wire ladders are unified behind ProposalSource::from_wire/to_wire (speculation.rs:55-70 (not opened)); the duplicated copy-cohort loop collapsed into select_host_allocated_candidate (rounds.rs:764-862); @shieldstar's zero_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:

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)

  1. One prepare of nvidia/GLM-5.3-Flash-NVFP4 on cn5, TP1, --history-drafts enabled. GLM has learned MTP (docs/core-design.md:357, docs/mtp-design.md:5), so it can exercise commits 1 and 4.
  2. Copy-input probe (~2 min, free): attempt flare run CORE --history-drafts. model/catalog.rs:97-122 hard-errors at load if the speculative graphs lack any of CopyTokenIds/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.
  3. Confirm GPU prefix allocation. Inspect the prepared core manifest for speculative_prefix_limits inputs on speculative graphs. Test B is vacuous without this (policy.rs:234-246 gates the whole-list pass on gpu_prefix_allocation, which requires that input per model.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.

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.

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


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.

Full report · Notes

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:

Subtract / Simplify:

Could remove ~85–90 of +4,306 added lines:

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:

Full report · Notes

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

What I verified myself at head

Must fix before merge (all small)

  1. helios/README.md:437 still says "Idle discards positive credit and preserves debt." That is false now. The PR updates docs/scheduling-runtime-design.md:436-500 and docs/scheduling-theory.md:577-583,727-738 but not this file, which is the one an engine contributor reads.
  2. Three copies of gpu_ns − wait_ns: cost.rs:334 (observe), the new cost.rs:43-44, and checkpoints.rs:764. Make observe call 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.
  3. Evidence on the actual head: one cargo test --locked --release --features runtime-core,server on 982a9ce3, plus a git diff proving the tree matches 3e2fcd27. Right now "byte-identical" is an assertion, not an artifact.

Should fix

  1. The acceptance ledger has one-sided evidence. This PR retains acceptance_credit_ns (refresh.rs:78,85) across idle too, but scripts/scheduling_sim/ has no acceptance-learning ledger at all — searches for 0.01, 0.99, acceptance_credit return nothing, and the targeted policy's harm_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).
  2. 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_plan returns RefreshStart (policy.rs:1240-1274), and plan_requires_feedback is 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 only group == "core" replenished scenarios, while the idle fixtures (learning_scenarios.py:88-93) are group="transient" with passed=None and 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

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:

Full report · Notes

Conventions

Verdict: should-fix issues only

Blocking:

Should fix:

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

Full report · Notes

Prose

Verdict: should-fix issues only Blocking:

Full report · Notes

Correctness

Verdict: should-fix issues only

Blocking:

Should fix:

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.

Full report · Notes

Architecture

Verdict: should-fix issues only Blocking:

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).

Full report · Notes

Subtractive

Verdict: make it smaller first The change: +647 / −47 lines, 10 files Could remove: about 140 lines, in 6 places Biggest subtractions:

Full report · Notes

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)

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:

  1. helios/README.md:437 still 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.
  2. scripts/scheduling_sim/learning_policy.py:47 — retain_idle_credit defaults to False, so the simulator's default retained-refresh models the policy Helios no longer implements; Helios retains unconditionally. Simulator-only; the 64-seed validation used True. Should fix (default True, or make it mandatory as __post_init__ already does for funded/estimator).
  3. cost.rs:31-45 naming/"Mirrors ActionCosts::observe" overstates the formula (the helper folds in wall_ns for isolated executions; observe at cost.rs:330-337 does not), and cost.rs:53-57's unwrap_or(timing.wall_ns) is unreachable behind validate_completion. Documentation/dead-code only.
  4. 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 the else of executor.outstanding() > 0). Rename to assert_idle(&self) or fold in.
  5. Nits: large_prefill_engine (policy_tests.rs:5812-5878) is the third copy of a test fixture; observed_compute_duration_ns is a fourth hand-written "max gpu − wait" alongside observe, checkpoints.rs:764 (not opened), metrics/scheduler.rs:179-206 (not opened); income-rate literals re-typed instead of refresh::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:

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.

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).

Explicitly out of scope — do not spend rig time

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.

Full report · Notes

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.

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

Priority

Type

Area

Model