Explore report · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/647e2e40-5805-4a34-aa6b-10fab5d67f4e.md

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

https://github.com/NVIDIA/hyperflare-inference/pull/540 — open, ready for review, opened and last updated 2026-11-26, head 7ca5430c, base main at 33ab6df5. 25 files, +3,965 / −119. No comments, no reviews, no labels, no CI checks on the head commit.

Key findings

  1. The declarative half of the headline feature does not reach the core. heliopause/src/export/binding.rs:196-202 (not touched by this PR; identical on main) unconditionally executes graph.insert("draft_source", "MTP") for every speculative graph while building the Execution message. The only producer of draft_source = 2 is ignition/preparation/execution.py:316-319 (via GraphSignature.draft_source, execution.py:32,102-108), and the only consumer of that dict is heliopause/src/python.rs:225-237. The dict that becomes the exported core's wire metadata goes through RuntimeCore.write → export_capture → binding::execution, a different path that stamps MTP. So a recipe declaring copy-only wide graphs cannot get draft_source=2 into a standard exported core without patching code this PR does not touch. The PR's Limitations admit W=16/W=24 copy-only GPU export/replay was never benchmarked, so this end-to-end path has never been exercised.
  2. It reverses a contract written by the owner of the code it edits. RefreshState::idle no longer clamps the credit ledgers (refresh.rs, clamping moved into abort()), and two pre-existing tests asserting the old contract were renamed — ordinary_income_excludes_queued_wall_wait_and_idle_discards_only_positive_credit → ..._idle_retains_credit_while_abort_discards_positive, and the refresh-ordering test → refresh_skips_infeasible_shapes_and_ranks_unattempted_tier_by_expected_value. That design (funded refresh, ReadinessIntervals, expected-useful-value scheduling) is Luke Alonso's, the largest contributor in helios/src (207 commits) and docs (365). This is the first non-Luke change to refresh.rs since 2026-10-30.
  3. A same-day PR by the same author touches the same lines. #538 "Restrict cold pure-prefill discovery to natural-fit graph capacities" edits the same policy.rs, policy_tests.rs and docs/scheduling-runtime-design.md, and works the same ValueRate zero-duration theme. Neither is marked stacked on the other; textual conflicts are likely if both land.
  4. Undeclared behaviour changes. Metrics: copy-only speculative steps now report draft depth 0 to metrics.speculative_completed (server/runtime.rs:1718-1724), changing the meaning of flare_learned_draft_* counters for any core containing copy graphs. Default: DEFAULT_MIN_MATCH_LEN 3 → 6 (sam.rs:22) silently removes 3–5-token copy proposals for every existing --history-drafts user. Refresh targeting: the funded-refresh probe winner is now chosen by expected tokens via compare_refresh (policy.rs:1265-1332, 1413-1425), beyond the tier-key change the description mentions.
  5. Docs are partially stale and contradict the change. docs/scheduling-runtime-design.md is updated (+31/−23), but docs/mtp-design.md:22-40, 515-518 still describes copy proposals as a 65,536-token shared ring from decoded_history.rs and says only qwen3.8-flash declares copy inputs, and docs/cli-design.md:200-201 still asserts "--history-drafts … does not change the graphs", which the new draft_source=2 retention rule directly contradicts.
  6. The SAM is built synchronously on the admitting thread for every request whenever --history-drafts is enabled (scheduler.rs:1846-1852), at up to ~13 ms CPU and 4.52 MiB per 131k-token admission by the PR's own microbenchmark. The description reports the microbenchmark but not this admission-path cost.
  7. Evidence is strong on CPU, weak on GPU, and self-reported. 615 + 1,625 Rust tests and 120 randomized brute-force SAM oracle trials (sam.rs:1401-1469) are real and backed by test code in the diff; but no CI ran, and the live numbers come from one machine, one model (DeepSeek-V4.1-Flash TP4 on SM120), temperature 0, with the description itself saying throughput "reflects the combined runtime, recipe, and kernel stack". No new tests were added for the new Python side (pr_files has no tests/ entries).
  8. Zero engagement and no filed demand. No comments, no reviews, no CI on the head commit; no issue in the repository asks for any of the four changes (the closest, #534, is a different bug in the same cost-freshness subsystem and is not fixed here).

The change

Shape and size. 25 files, +3,965 / −119, four commits atop main 33ab6df5, described as atomic. Largest pieces: new helios/src/scheduler/sam.rs (+1,606), helios/src/scheduler/tests.rs (+583), helios/src/scheduler/policy_tests.rs (+501), helios/src/model/tests.rs (+324), helios/src/scheduler/rounds.rs (+194/−12), helios/src/scheduler.rs (+180/−9), helios/src/scheduler/cost.rs (+120), helios/src/scheduler/policy.rs (+119/−14), helios/src/runtime_core/selection.rs (+109/−12), helios/src/scheduler/speculation.rs (+103), docs/scheduling-runtime-design.md (+31/−23), heliopause/src/python.rs (+14/−3), ignition/preparation/execution.py (+10/−1). Roughly 1,400 of the added lines are tests.

Part 1 — cost-refresh recovery (a85be397). RefreshState::idle() becomes an empty body; the credit-clamping moves to abort() (refresh.rs:96-105). cost.rs gains observed_compute_duration_ns (observed minus ReadinessIntervals::wait_ns()) and timing_refresh_duration_ns (compute duration, else wall_ns); ordinary timing-refresh income and refresh-episode charges use these, while acceptance learning keeps raw physical duration. ActionCosts::refresh_order changes from u64 to (bool, u64) — tier 0 = never attempted since going stale, tier 1 = attempted-while-stale ordered by oldest attempt — and the funded probe is ranked by expected useful value (Candidate.expected, compare_refresh, policy.rs:1265-1332, 1413-1425). Per the description this exists because after a transient GPU slowdown, idle discarded positive timing-refresh credit while keeping negative debt, so sequential requests under 2,495 ms could never fund a refresh, and cold readiness waits were charged against timing-refresh debt.

Part 2 — per-request prompt+output suffix automaton (83ff9ed6). New sam.rs: PromptSAM (immutable, compacted flat edge array, topological max_endpos, DEFAULT_MAX_PROMPT_TOKENS = 131_072, sam.rs:25), OutputSAM (dynamic, link-cut tree over the suffix-link tree for O(log M) recency updates, sam.rs:564-735), and PromptOutputSAM (Arc<PromptSAM> + lazy OutputSAM seeded with DEFAULT_BOUNDARY_OVERLAP = 512 prompt tokens, 1-token lag, DEFAULT_MAX_OUTPUT_TOKENS = 131_072, DEFAULT_MIN_MATCH_LEN = 6, sam.rs:22-32). LiveRequest.sam is created at admission only when decoded_history.is_some() (scheduler.rs:1846-1852); committed tokens are pushed (scheduler.rs:1231-1237, ~3013). RequestScheduler::request_history_proposal[_with_match_len] (scheduler.rs:1099-1163) prefers the per-request SAM unless the shared ring has a strictly longer match, clipping out-of-vocabulary placeholders and falling back to DecodedHistory. Call sites in model/packing.rs:399-405 and server/runtime.rs:2145 switch from history_proposal(live.tokens(), …) to request_history_proposal(handle, …).

Part 3 — cost-calibrated wide copy-verify (35ab143a). Adds optional per-graph draft_source: ProposalSource (execution/manifest.rs:188-193), validated (manifest.rs:839-851), read from the proto (runtime_core/serving.rs:58-63) and from the Python manifest (heliopause/src/python.rs:225-237), declared by recipes through GraphSignature.draft_source (ignition/preparation/execution.py:32, 102-108, 315-319). Copy-only graphs must have confidence_width == 0, no speculative_prefix_limits, and the four copy input buffers. runtime_core/selection.rs retains draft_source=2 wide graphs only with proposal source MTP + history drafts + adaptive width (selection.rs:182-184, 277-298), otherwise narrowing speculative_widths back (selection.rs:379-393). New speculation::CopyCalibration (aged per-depth survival, prior WIDE_COPY_PRIOR_RATE = 0.88, speculation.rs:98-190), rounds.rs wide_copy_curve / expected_copy_tokens, and a wide-copy candidate inside packed_round_candidates (rounds.rs:749-900) gated on decoded_history present, adaptive width, shape.drafts > base_mtp_drafts, request.copy_allowed(), match_len >= WIDE_COPY_MIN_MATCH_LEN (6), copy_len >= base_mtp_drafts + 3. Copy-only rounds are excluded from MTP acceptance learning (scheduler.rs:2795-2801, 2860-2875) and from the MTP packed duration table (cost.rs:189-202).

Part 4 — padding dominance and threshold (7ca5430c). dominates_padding_with gains a strict-wider-batch branch with equal (packed_token_capacity, draft_tokens); prune_padding adds a whole-list pass marking any GPU-allocated ragged speculative candidate dominated when a strictly narrower batch (≥ active lanes) with the same (capacity, drafts) offers at least min(lane_ceilings_sum, own packed) (policy.rs:221-254). DEFAULT_MIN_MATCH_LEN 3 → 6.

What the change does that the description does not say.

What the description says that the change does not do. It presents copy-only wide graphs as declarable end-to-end by Ignition, and "existing W=8-only cores … load, prune, pack, and schedule with no Protobuf wire changes and no core re-export required" as compatibility. The wire-side plumbing to actually carry draft_source=2 from a recipe into an exported core is missing (Key finding 1), and the "existing cores load" claim is tested only against an in-process synthetic manifest (wide_copy_verify_catalog_packs_23_sam_tokens_and_preserves_legacy_w8_cores, helios/src/model/tests.rs), not an on-disk core.

The why

Recent activity

People

Community

Nothing found beyond the absence itself: pr_comments returns no comments, there are no reviews, no reactions, no labels, and no CI checks on 7ca5430c. Notably the case-file/auto-review bot has not posted on #540, whereas #538 (same author, same day) already carries a flare-autobot case-file comment, so even the automated intake report is missing. No maintainer has engaged.

Project fit

Charter points that line up:

Charter points that do not line up:

Claims and evidence

Claim Backing Where evidence stops
615 passed / 0 failed / 5 ignored (cargo test --locked --manifest-path helios/Cargo.toml (not opened)); 1,625 passed / 44 ignored (--lib --features runtime-core,server --skip template) on 7ca5430c Self-reported No CI checks exist on the head commit; nothing independently reproduced. Counts are branch-local (cf. #538 reporting 1,690 on a tree of the same base).
cargo check heliopause passed; pytest tests/preparation/test_core_boundary.py (not opened) 4 passed Self-reported No Python test file is modified (pr_files has no tests/ entries). The new validations in execution.py:102-108 and python.rs:225-237 are covered only by pre-existing tests (test_execution.py:299 asserts draft_source == 1 for a default signature; nothing asserts 2 or the rejection paths).
120 randomized brute-force SAM oracle trials Real test in the diff: exact_oracle_equivalence_randomized_streams_and_repetitions, sam.rs:1401-1469, over several min_match_len and prompt lengths Strongest evidence in the bundle; CPU-only.
SAM latency 0.80 / 2.72 / 13.05 ms build and 140/145/317 ns per step at 8,192 / 32,768 / 131,072 tokens; 0.37/1.27/4.52 MiB CPU release microbenchmark; a loop over those sizes exists (sam.rs:1547) but timings are not checked in Not reproduced, no artifact; and it is an admission-path cost the description does not connect to serving latency.
Live: max_b == C on every cell at C = 4/6/8/12/16 (vs B16 at C=4, B32 at C=6..16 before); C=4 9.19 vs 9.55 ms/rd / 617.7 vs 587.6 tok/s (+5.1%); C=6 −7.9%; C=8 −5.2% Single machine, single model, single core, temperature=0 No repeats, no scatter, no artifacts; the description concedes throughput "reflects the combined runtime, recipe, and kernel stack", i.e. the delta is not attributable to this parent alone.
--history-drafts + min len 6: 512-token repetitive code-edit prompt 3.078 → 3.650 emitted tokens/round, 408.0 → 460.8 tok/s (+12.9%); +0.25 ms/rd overhead on non-repetitive 256-token single-stream decode Same single run Same caveats; the overhead number is the only admission/scheduler cost quantified.
Aggregate timing-refresh bound P <= 0.002/0.998·O + D preserved Re-asserted in changed tests: refresh_funding_requires_earned_credit_and_accounts_for_repeated_attempts_and_idle (policy_tests.rs) and power_cap_restore_recovers_largest_prefill_chunk_across_idle_requests Only for the scenarios those tests cover; the idle-retains-credit change reshapes which histories are reachable.
Acceptance-learning bound P <= 0.01/0.99·O + D preserved Asserted Only implicitly — the code path is unchanged except for the readiness split and the copy-round exclusion; no new test targets this bound specifically.
"existing W=8-only cores … load, prune, pack, and schedule with no Protobuf wire changes and no core re-export required" Correct that the proto already carried DraftSource {NO_DRAFT, MTP, COPY_DRAFT} on main (helios/proto/runtime_core.proto:842,854), so no wire change "Existing cores load" is tested only against an in-process synthetic manifest (helios/src/model/tests.rs), not a real on-disk exported core.
Copy-only wide graphs are declared through Ignition execution.py:32,102-108,315-319 plus python.rs:225-237 The export path overwrites draft_source with MTP (binding.rs:196-202), so the declared value is lost on the standard export route; and Limitations concede W=16/W=24 export/replay was not benchmarked.
Merge-order: standalone on main, prerequisite for the external recipes PR Stated The consuming recipe lives outside this repository; nothing here exercises the feature end-to-end.

Reach

Process

Open questions / what could not be found