Value proposition report · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/5a6bf87d-73b9-43be-8320-363473adce11.md

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.