Verdict: worth it with changes — split it, keep two of the four commits as-is, hold the third until it has GPU evidence
What the charter says that decides this
Three charter rules matter most here:
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." - "Solve the right problem in the right place… Look for the smallest footprint in shared code, or a way to solve it without new code at all."
- "Captured-graph op contracts: Adding a new one—even if it reuses an existing graph kind—requires owner approval before you write it."
Plus the documented-matrix rule: new graph kinds "must prove they export and serve cleanly from the PR branch."
The PR meets (1) for three of its four commits and explicitly fails it for the fourth. It partly meets (2). It never claims (3).
The four commits, judged separately — they are not one change
Commit 1 (a85be397, cost-refresh recovery) — merge as-is. Highest-value, lowest-cost part.
This is a real bug fix against a limitation the project already documents. docs/scheduling-runtime-design.md (pre-PR) said: "Funding the first refresh requires 2,495 ms of credited ordinary execution. Repeated shorter busy periods separated by idle can leave unused graph estimates stale indefinitely." The PR names the cause exactly: RefreshState::idle (helios/src/scheduler/refresh.rs:99) clipped positive credit to zero, so idle-separated short requests could never accumulate the 5 ms cap, and refresh_order (helios/src/scheduler/cost.rs:284) re-probed stale shapes in raw-timestamp order.
Why this matters for this project specifically: Flare is aimed at "long conversations, coding agents, and heavy tool use" — i.e. exactly the bursty, idle-separated traffic pattern whose cost estimates the old code could never refresh. After a transient power cap or a post-idle clock drop, the scheduler would keep pricing those graphs at stale durations forever. This is a throughput bug that hits the primary use case.
Cost is small and proportionate: observed_compute_duration_ns / timing_refresh_duration_ns (cost.rs:31-40), a (bool, u64) two-tier key, idle() becoming a no-op, abort() taking over the discard behavior. The accounting invariant is preserved and re-stated in the docs rather than quietly broken (P <= 0.002/0.998 * O + D now defined over compute time; acceptance learning deliberately keeps raw physical time). That is exactly what "bug fixes need to address the root cause" (#397) asks for.
Two nits, not blockers:
idle()is nowpub fn idle(&mut self) {}(refresh.rs:99) with a doc comment — a dead method. Delete the method and its call site athelios/src/scheduler.rs:1281instead of leaving an empty hook.observed_compute_duration_nsusessaturating_sub(wait_ns), so a readiness interval longer than the measured interval silently reports0(zero credit, no debt) rather than treating the observation as invalid the wayvalidate_completionalready does forqueued/missing intervals. Worth pinning down with a test either way.
Commit 4a (7ca5430c, dominates_padding_with + prune_padding) — merge, but de-duplicate the logic first.
The measured claim is clean and defensible: max_b == C on every cell instead of B16 at C=4 and B32 at C=6..16, with 9.19 vs 9.55 ms/rd at C=4 (+5.1%), -7.9% at C=6, -5.2% at C=8. Over-padding a B=16 graph for a 4-request cohort is a straightforward waste, and tightening dominance is the right layer for the fix.
The concern is that the change now contains two different definitions of "dominated" in the same function:
dominates_padding_with(policy.rs:139-174) gained a four-branch GPU-ragged speculative path with three early returns;prune_padding(policy.rs:225-254) then re-implements a weaker, differently-shaped predicate inline (other.batch >= lanes, capacity/draft_tokensequality,packed_token_capacity >= needed) rather than reusing the first.
Two dominance predicates that are meant to agree but are written independently is a classic source of silent over-pruning (a shape gets dropped that a future cohort needed) or under-pruning. Please either route the second pass through the first or state in a comment why the criteria must differ, and add a test that asserts the two predicates never disagree on a dominated pair.
Commit 4b (DEFAULT_MIN_MATCH_LEN 3 → 6) — merge. One line, motivated (3-token coincidental matches were overriding learned drafts), covered by sam.rs:1287-1290.
Commit 2 (83ff9ed6, prompt+output SAM) — worth it, but trim it and document it.
There is a genuine gap: DecodedHistory (helios/src/scheduler/decoded_history.rs) only indexes committed output in a 4-/8-token hash ring, so it is prompt-blind by construction. A request that quotes a file, diff, or retrieved chunk gets nothing until it re-emits its own output. The PR's own test asserts this deliberately (helios/src/scheduler/tests.rs:2069: shared history did not ingest prompt A), so the SAM is not duplicating the ring — it fills a hole the ring intentionally leaves. That is the right problem.
But this is where "smallest footprint" bites. helios/src/scheduler/sam.rs is 1,606 lines implementing a compacted suffix automaton plus a splay-based link-cut tree with lazy path updates over the dynamic output automaton (sam.rs:564-737). Much of it is genuinely good work — CSR edge compaction, the brute-force oracle harness (sam.rs:1236-1273), 120 randomized oracle trials, per-request Arc sharing — and the reported 140–317 ns per push + propose at 8k–128k tokens is the right order of magnitude. Still, there are three concrete scope problems:
- Half-wired generality.
from_shared_promptshares anArc<PromptSAM>(sam.rs:935), but nothing in the runtime calls it — every request builds its own automaton at admission (helios/src/scheduler.rs:1849-1852). Likewisepropose_for_context(sam.rs:1070) andpropose_conditional_continuations(sam.rs:1118) are used only insam.rstests;propose_conditional_continuationsexists "for 2-deep pipelined execution," which does not exist in this codebase. That is ~150 lines of public API surface on the hot path with no caller. - Aggregate memory is unaccounted. The PR reports
0.37/1.27/4.52 MiBper 8k/32k/131k-token prompt SAM, but not the per-request total acrossmax_activerequests (prompt SAM + up to 131,072-tokenOutputSAM+ LCT nodes). AtC=16..32on a workstation this could be hundreds of MiB of host RAM that nothing budgets against, even though the runtime already hasMemoryLimitmachinery (helios/src/runtime_core/limits.rs(not opened)). One line of accounting is enough. - 13 ms build on the admission path is plausible but unexplained. Fine relative to prefill of a 131k-token prompt, but say so.
The measured win is real for the target workload: 3.078 → 3.650 tokens/round and 408.0 → 460.8 tok/s (+12.9%) on a 512-token repetitive code-edit prompt, at +0.25 ms/rd overhead for non-repetitive single-stream, and it stays behind --history-drafts. Note that this result comes from commits 2 and 4b together, not from the wide copy graphs (see below) — a 4/8-gram ring can never emit more than 8-token continuations, so longer SAM matches alone explain 3.65 tokens/round.
Commit 3 (35ab143a, per-graph draft_source + wide copy-verify) — do not merge yet. Split it out.
This is the largest and riskiest slice, and it is the one that fails the evidence bar:
- The PR's own Limitations section says: "copy-only wide graph (
W=16/W=24) GPU export/replay … were not benchmarked on live hardware." The Result section contains no measurement attributable to this commit. The +12.9% figure needs only commits 2 and 4b. So a ~450-line change acrossignition/preparation/execution.py,heliopause/src/python.rs,helios/src/execution/manifest.rs,runtime_core/{selection,serving}.rs,model/{catalog,packing}.rs,scheduler/{speculation,rounds,cost}.rsships with no served-workload speedup of its own — exactly what #210 forbids. - It introduces a new captured-graph contract: speculative graphs that are copy-only (
confidence_width == 0, nospeculative_prefix_limits, four copy input buffers) coexisting with MTP graphs in one core, plus retention/pruning rules inruntime_core/selection.rs:278-297and a newCopyCalibrationwith priors0.88/min_match_len 6/copy_len >= base_mtp_drafts + 3. Minting that contract needs the owner approval the charter requires, and the PR does not say it has it. - It is also the most speculative calibration in the diff:
WIDE_COPY_PRIOR_RATE = 0.88,COPY_STEP_PRIOR_WEIGHT = 4.0,COPY_DEPTH_SHRINK_WEIGHT = 2.0(speculation.rs:14-23), plus a 3-way ordering heuristic loop withselect_nth_unstable_byinlined intopacked_round_candidates(rounds.rs:745-900) — roughly 150 lines dropped into an already-dense function. Against the charter's "Be explicit and pin everything. No magic defaults", these priors need either a derivation or a measurement behind them.
Compatibility work here is good, and worth keeping whenever it lands: unknown cores still load, draft_source defaults to MTP (heliopause/src/python.rs:224-235), --mtp-draft-tokens still validates against the MTP maximum only (selection.rs:149), and the selection test at selection.rs:1876-1945 covers retain-vs-prune. That is the right instinct; it just isn't evidence of a win.
Documentation gap (a charter-listed mergeable defect)
Only docs/scheduling-runtime-design.md is updated. docs/mtp-design.md:22-40 still states that history drafting "requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do" and describes history drafting solely as the 65,536-token shared 4/8-gram ring. After this PR that is wrong in three ways: copy drafts now come primarily from a per-request prompt suffix automaton, --history-drafts now also controls graph retention in runtime_core::selection (it prunes copy-only graphs when off — a flag that used to mean "augment drafts" now changes which captured graphs survive), and min_match_len default moved to 6. docs/cli-design.md:200-202 (not opened), 742 is stale in the same way. Given the charter lists "bad docs" as mergeable work and this PR changes documented behavior of an existing flag, these should be updated in the same series.
Who benefits, and how much
| Change | Beneficiary | Magnitude | Cost |
|---|---|---|---|
| Cost-refresh recovery | every user with idle-separated requests = the core local/chat/agent case | unbounded (stale pricing never recovers today) | ~40 real lines |
| Padding dominance | multi-session C=4..16 serving |
+5.1% to +7.9% latency | ~30 lines, one duplication risk |
| SAM prompt drafts | code-edit / repetitive / retrieval workloads | +12.9% tok/s on the tested shape; +0.25 ms/rd elsewhere, opt-in | ~1,250 lines + 370 test lines |
| Wide copy-verify | hypothetical | unmeasured | ~450 lines + new graph contract |
Roughly half the diff is tests (policy_tests +501, scheduler/tests +583, model/tests +324, plus sam oracle trials) — that is a genuine strength and better than the project average. Test counts claimed (615 / 1,625 / 102 Python) are plausible and specific. The PR description has all four charter-mandated parts and an honest limitations section — also better than average.
Recommended disposition
Worth it with changes, in this order:
- Split into three PRs. (a) cost-refresh recovery + padding dominance +
min_match_len = 6— small, root-cause, measured, merge quickly; (b) prompt+output SAM after trimmingpropose_for_context/propose_conditional_continuations/ unwiredfrom_shared_prompt, adding per-request memory accounting, and fixingdocs/mtp-design.md+docs/cli-design.md(not opened); (c) wide copy-verify, held until somebody runs copy-onlyW=16/W=24export and replay on real hardware and reports a win over the existingW=8copy path on a served workload — and until a maintainer signs off on the copy-only speculative graph contract. - Fix in (a) before merging: drop the empty
RefreshState::idle; decide whether readiness-wait > interval is zero compute or an invalid observation; de-duplicate the two dominance predicates inpolicy.rs:139-174vspolicy.rs:225-254and test that they agree. - Justify in (c) before merging:
0.88,+3,>= 6, and the 3-ordering heuristic — each needs a derivation or a measurement, not a default.
Nothing in the diff violates "keep the runtime small and model-agnostic" in the per-model sense (the SAM is token-ID-only, no model branches, gated by an existing flag), and nothing in it is off-roadmap in kind — idle-separated cost recovery and tight batch selection are squarely inside "squeeze the most out of workstation hardware." The objection is scope discipline and evidence, not direction. The thread currently has no human review (only the automation case-file comment), so this is a first substantive review.