Pre-Test Report — PR #540 "helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify"
Recommendation: DO NOT REFER TO HARDWARE TESTING YET
Retest after fixes. One commit is excellent and testable; the two largest commits are either unreachable in production (confirmed defect) or untestable on our rigs. Testing now would spend rig time on behavior that will change.
1. What the PR contains
Four independent outcomes in one 25-file, +3965/−119 change, by a first-time contributor to this subsystem (AGENTS.md:194-199 (not opened) asks for one coherent outcome).
| Commit | Change | Hardware-testable? |
|---|---|---|
a85be397 |
Cost-refresh recovery: retain credit across idle, exclude readiness waits from timing credit, two-tier refresh ordering | Yes — clean, valuable |
83ff9ed6 |
New 1,606-line per-request prompt+output suffix automaton (sam.rs (not opened)) for copy drafts; min_match_len 3→6 |
Only with a copy-capable model + recipe — neither available |
35ab143a |
Per-graph draft_source + wide copy-verify (W=16/24) graph scheduling |
No — see §2.1 |
7ca5430c |
Padding dominance for ragged batch grids | Yes — measurable |
2. Blocking defects (why testing is premature)
2.1 The headline capability of commit 3 is dead on the export path — verified in code
I confirmed this myself rather than relying on the reviews:
heliopause/src/export/binding.rs:196-202unconditionally runsgraph.insert("draft_source".into(), "MTP".into())for every speculative graph. It never reads the incoming value.- That file is absent from this PR's changed-file list. The producer change (
ignition/preparation/execution.py:315-319, now emittingdraft_source=signature.draft_source) is overwritten before it reaches the wire. - Export path is live:
binding.rs:17 export_capture→capture.rs:3158 super::binding::execution(execution, &allocations)→capture.rs:3160 output.index.ranks[0].execution = Some(execution). - The wire format already supports it:
helios/proto/runtime_core.proto:842,854definesDraftSource { NO_DRAFT=0; MTP=1; COPY_DRAFT=2; }. Only the writer is hard-coded. - Load side then discards the graphs:
selection.rs:277-298treats a shape ascopy_wideonly whengraph.draft_source == 2; the fallback MTP branch at:291-293requiresdraft_tokens <= drafts, which wide shapes (depth> draftsby construction,:283) fail.
Consequence: every exported core re-imports its wide copy-verify graphs as MTP and drops them. This path has never run from an exported core — consistent with the PR's own Limitations conceding W=16/W=24 GPU export/replay "was not benchmarked."
Why the 615 passing CPU tests miss it: the selection test at selection.rs:1896 constructs wire::DraftSource::CopyDraft directly, bypassing binding.rs. The only untested conversion is the one that matters.
Riding along: the same line gates validation (manifest.rs:845-846 (not opened), model/catalog.rs:93-96 (not opened) — no GPU confidence, no speculative_prefix_limits, four copy buffers), so the silent coercion also lets a mislabelled invalid copy graph skip its contract checks. The in-process reader (heliopause/src/python.rs:225-233) correctly rejects unknown values; the export reader accepts anything.
Additionally, nothing in the tree produces draft_source=2 (full-repo search: only the proto enum, the Python validator, and tests reference it). GraphSignature.draft_source defaults to 1 (execution.py:32); no recipe sets it. The PR defers this to a companion PR in local-inference-lab/hyperflare-recipes.
2.2 User-facing docs contradict the code
docs/cli-design.md:200-201— "--history-drafts… does not change the graphs." After this PR the flag decides whetherdraft_source=2graphs load and rewritesspeculative_widths(selection.rs:184, 277-298, 382-396). Not touched by the PR.docs/mtp-design.md:22-40— still describes copy drafts as only the 65,536-token shared ring returning "up to seven" tokens, and says onlyqwen3.8-flashMTP graphs declare copy inputs. The PR makes the per-request SAM primary with the ring as strictly-longer fallback (scheduler.rs:1099-1158). Not touched.helios/manifest.md:29-53(not opened) — graph-dictionary spec omitsdraft_source.docs/scheduling-runtime-design.md:7-12— module index omitssam.rs(not opened).
The one doc that was updated (the refresh sections) is accurate — I checked it line by line against refresh.rs:71-105 and cost.rs:31-38,190-296.
2.3 Scope
Four outcomes in one PR defeats attribution: the headline +12.9% requires commits 2+3+4 together and the PR itself calls throughput "combined-stack". No part can be bisected or selectively reverted.
3. Should-fix (will need code change, not blocking)
- Two independent "dominated" predicates —
policy.rs:139-174vspolicy.rs:221-254. The second runs across all candidates rather than same-group peers, so it can prune using a shape from a different mask/cohort: silent over-pruning introduced by the very commit that fixed over-padding. - Second proposal-source dimension —
GraphDescriptor::draft_sourceduplicatesspeculative_proposal_source(speculation.rs:30-38,selection.rs:144-148) and the two can disagree, which is the exact hole in §2.1. Copy-specific bypasses now sit in shared code (selection.rs:277-298,382-391;cost.rs:190-208,223-232;rounds.rs:752-790). - Cost semantics depend on catalog composition —
cost.rs:192-201skips all copy shapes if any MTP packed shape exists, so the same(batch,width)entry means different things depending on the rest of the core. Not coverable by a shape-level unit test. - Unpinned constants —
WIDE_COPY_PRIOR_RATE=0.88,COPY_STEP_PRIOR_WEIGHT=4.0,COPY_DEPTH_SHRINK_WEIGHT=2.0(speculation.rs:15-21),+3atrounds.rs:766, and6duplicated insam.rs:22(not opened) andspeculation.rs:18with nothing keeping them equal. Only the6has any derivation (one 512-token prompt). - Dead/speculative code —
RefreshState::idleis nowpub fn idle(&mut self) {}(refresh.rs:99) under a doc comment claiming a guarantee;propose_conditional_continuations(~78 lines) has no caller outsidesam.rs:1505(not opened) and cites a "2-deep pipelined execution" that does not exist; ~150 lines ofpubSAM surface are test-only. - Duplication with drift —
request_copy_match_stats(scheduler.rs:1163-1205) re-implementsrequest_history_proposal_with_match_len(1112-1159), and the two already disagree on whether a zero-count shared match counts, so the wide-copy gate and the packing path can pick different sources for the same request.
4. Expected value of a hardware test right now: low
- Commit 3: untestable end-to-end — unreachable through export (§2.1) and no producer exists.
- Commit 2: requires
--history-draftswith enabled learned speculation (selection.rs:179-180), history enabled before admission (scheduler.rs:1086-1092),decoded_history.is_some()(scheduler.rs:1120), and non-grammar/host-stop requests (scheduler.rs:373-375). No qualifying model on either rig: cn5 has no Qwen3.8-Flash; cn7 hasQwen3.8-Flash-Next-FP4-Localbut is a single GB10, arm64, 60 GiB — the SM121/GB10 configuration the PR explicitly does not qualify. - All PR live numbers came from DeepSeek-V4.1-Flash TP4 on 4× RTX PRO 6000, a model on neither rig — no headline figure is reproducible here.
- No CI ran on the head commit, so even the 615/1,625 test counts are unverified.
The real value is concentrated in the two small commits below.
5. Proposed test plan (hold until §2 fixed; ~4–6 GPU-hours on cn5)
Test A — Cost-refresh recovery (a85be397), ~2 h — highest value in the PR
Covers exactly the bursty, idle-separated traffic Flare targets, where stale graph pricing currently never recovers.
- A/B
mainvs branch on cn5, single model, TP1 (not TP4 — irreproducible variable). - ≥200 short requests, each < 2,495 ms, separated by idle gaps beyond the estimate TTL.
- Assert
flare_scheduler_executions_total{reason="timing_refresh"}and..._execution_nanoseconds_total{reason="timing_refresh"}(metrics.rs:932-939): ~0 before, >0 after. - Confirm readiness-wait exclusion via
flare_replay_readiness_wait_nanoseconds_total/..._readiness_samples_total(metrics.rs:941-948). - Regression guard: refresh spend must stay inside
P <= 0.002/0.998 * O + D.
Test B — Padding dominance (7ca5430c), ~2–3 h
- Same rig. Sweep
C = 1, 2, 3, 4, 6, 8, 12, 16(include C=2/3, which the PR does not measure). - Assert
max(batch)inflare_speculative_rounds_total{batch,width}equalsCon every cell (vsB16at C=4 andB32at C=6..16 onmain). - Report ms/rd and tok/s per cell; expect +5.1% at C=4, −7.9% ms/rd at C=6, −5.2% at C=8.
- Guard §3.1: confirm no lane starvation — over-pruning shows up as a regression at some C.
- Cheap add: load-and-serve an already-exported W=8-only core (minutes) to back the backwards-compatibility claim, currently supported by a unit test alone.
Explicitly out of scope
- Wide copy-verify (commit 3) until §2.1 is fixed, a
draft_source=2recipe exists, and the new graph contract is owner-approved. - SAM copy drafts (commit 2) — no qualifying model; cn7's GB10/arm64 is outside the PR's qualified scope.
- Power-limit transitions — conceded unmeasured; fragile and low-yield.
- Do not re-test SAM matching logic,
refresh_ordertiering, or Protobuf round-trips beyond one load-and-serve smoke check — CI covers these cheaply.
6. Bottom line
The most valuable commit (cost-refresh recovery, ~40 real lines) is clean, well-scoped, correctly documented, and testable — it should be split out and merged. Padding dominance is measurable and worth a short A/B. But the two largest commits cannot be meaningfully validated on our hardware today, and the copy-verify path has a confirmed defect that makes its graphs unreachable in production. Combined with four behaviors in one PR and four stale documents, referring now would confirm behavior that is about to change.
Refer to testing after: the binding.rs export fix lands with the round-trip test that would have caught it, the four documents are corrected, and the PR is split or its bundling argued. Then test commits 1 and 4 for ~4–6 GPU-hours on cn5.