Value proposition scratchpad · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/2feed326-36e6-4b43-aa78-8b068ee3f0b7.md

#1 [high] PR 540 overview: scope, files, claims

PR #540 (open, author FujitsuPolycom), "helios: cost-refresh recovery, prompt+output SAM copy-drafts, and calibrated wide copy-verify". 25 files, ~+3,900/-100. New file helios/src/scheduler/sam.rs (+1606).

Commits: a85be397 (cost refresh: observed_compute_duration_ns excluding readiness wait_ns, credit retained across idle, refresh_order two-tier key), 83ff9ed6 (per-request PromptSAM+OutputSAM copy drafts, LiveRequest::sam at admission when --history-drafts), 35ab143a (draft_source metadata on graphs 1=MTP/2=COPY, selection pruning, CopyCalibration with WIDE_COPY_PRIOR_RATE 0.88 / WIDE_COPY_MIN_MATCH_LEN 6, copy-only step isolation from MTP acceptance), 7ca5430c (dominates_padding_with strictly-wider pruning, DEFAULT_MIN_MATCH_LEN 3->6).

Claims: B16/B32 over-padding eliminated (max_b==C); history-drafts on 512-token repetitive prompt 3.078->3.650 tok/round, 408->460.8 tok/s (+12.9%); non-repetitive adds +0.25 ms/rd opt-in overhead. PromptSAM build 0.80/2.72/13.05 ms at 8k/32k/128k tokens, 0.37/1.27/4.52 MiB; push+propose 140-317 ns/step. Tests claimed: 615 passed helios, 1,625 passed lib w/ runtime-core+server, 102 py tests. Live HW: 4x RTX PRO 6000 Blackwell SM120, DeepSeek-V4.1 Flash TP4 only.

Charter hits: "bring real evidence" (has benches but on one model/one HW), "keep runtime small and model-agnostic", "no per-model special cases or flags" (this is guarded by existing --history-drafts flag but adds draft_source core metadata), "captured-graph op contracts require owner approval" (draft_source is new graph metadata). Roadmap: not on roadmap; cost-refresh recovery is a bug-fix-shaped item.

Discussion so far: only an autobot case-file comment (no human review). Related: #289 (merged fix that bounded history proposals), #287 (crash bug history drafts). Prior art check: Link-Cut Tree claimed in description but code uses splay tree (RootedLct with splay_stack, cut_parent/link) — verify.

#3 [high] Verified export blocker: wide copy-verify is dead on every exported core

VERIFIED INDEPENDENTLY in the repo at PR head and at main.

Chain:

  1. Producer emits integer draft_source: ignition/preparation/execution.py:32 (draft_source: int = 1), validated at :102-108 (1 or 2; 2 = COPY_DRAFT; copy-only graphs must have confidence_width==0 and no speculative_prefix_limits), serialized into the graph dict at :316-319.
  2. Only export route to the wire Execution: heliopause/src/export/binding.rs:136 pub(crate) fn execution(...), called once at heliopause/src/export/capture.rs:3158, stored at capture.rs:3160 (output.index.ranks[0].execution = Some(execution)). No other writer found (grep .execution = Some in heliopause returns only that). Python never builds the proto Execution directly (ignition/preparation/execution.py only produces the JSON-shaped dict; runtime_core_pb2 importers are packing/contract/core_file/protection/rebuild_manifest).
  3. binding.rs:196-202, for kind=="speculative" (or mixed && speculative): graph.insert("draft_source".into(), "MTP".into()) at :201 — UNCONDITIONALLY overwrites whatever the producer sent. This line exists on main too (read at ref=main, same line 201), i.e. it predates the PR and the PR did not extend it.
  4. Load side accepts 1 or 2 (helios/src/runtime_core/selection.rs:244 ![1,2].contains(&graph.draft_source)), so the coerced "MTP"=1 passes validation silently — no error, no warning.
  5. Retention then drops them: selection.rs:277-298, copy_wide requires graph.draft_source == 2 (:280); the fallback MTP branch requires graph.draft_source == source (source=1, :291) AND draft_tokens <= drafts (mtp-draft-tokens max, :292). A W=16/W=24 copy graph has depth 15/23 > MTP max 7, so it fails both and is pruned.
  6. Also reads draft_source as Copy in serving.rs:58-63 (only ever 1) and cost.rs:229 (is_copy_only_step, never true).

Consequence: all of commit 3's runtime machinery — CopyCalibration, wide_copy_curve, the copy branch of packed_round_candidates (rounds.rs:755-903), is_copy_only_step — is unreachable on any core produced by the supported export path. It only works in unit tests, which construct GraphDescriptor directly and bypass binding.rs (e.g. helios/src/scheduler/tests.rs:4179-4194).

Why it escaped: pr_files shows heliopause/src/python.rs changed but heliopause/src/export/binding.rs is NOT touched and has no round-trip test for draft_source. The contract checks in helios/src/execution/manifest.rs:844-846 and helios/src/model/catalog.rs:123-131 are also bypassed by the coercion, so copy-only graphs are never contract-validated on a real core.

Fix is small: map the producer value to the enum name (1=>"MTP", 2=>"COPY_DRAFT", other=>invalid) instead of overwriting, plus one binding::execution round-trip test. Note prost_reflect JSON mapping (binding.rs:132 transcode_to) accepts enum name strings, consistent with describe.rs:534 and flare-cli/src/inspect.rs:1609 already using "MTP"/"NO_DRAFT".

#5 [high] Verified doc staleness: three docs now contradict the code

DOC STALENESS — now verified directly (stronger than my last report, where I marked cli-design as "not opened").

docs/cli-design.md:200-201, verbatim: "--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs." This is now false: commit 3 makes the flag change which captured graphs are retained and which kernels load — selection.rs:277-298 (copy_wide retention), the kernel prune at selection.rs:375-380, and selection.rs:382-396 rewrites speculative_widths to retained_widths. A flag that used to mean "augment drafts" now silently controls graph retention and must be set at load, not just startup.

docs/cli-design.md:741 (flag table) is stale in the same way: "Augment learned drafts with shared decoded-history continuations; requires enabled speculation and captured history inputs, as Qwen Flash provides" — no mention of per-request SAM, the 6-token threshold, or graph retention.

docs/mtp-design.md:22-29: "It requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do. Both settings use the same captured MTP graphs and buffers." Now wrong twice over: the graphs differ (copy-only wide graphs), and admission builds a per-request SAM for any --history-drafts run regardless of recipe.

docs/mtp-design.md:31-40: describes history drafting solely as the 65,536-token shared 4/8-gram ring ("Exact eight-token and four-token indexes match the active request's suffix, preferring eight-token matches"). After this PR the primary source is a per-request prompt+output suffix automaton (sam.rs) with the ring as fallback and min_match_len=6 (sam.rs:22). "Prompt ingestion ... do[es] not populate the ring" is carefully still true — the SAM is deliberately separate, which is exactly the right-problem argument (see entry on SAM-vs-ring).

Docs ARE correct where the PR updated them: docs/scheduling-runtime-design.md (+31/-23) now documents compute-duration credit, idle-retains-credit ("accumulates across idle-separated requests"), the two-tier refresh order, and the Startup/abort asymmetry. That is a genuinely good, invariant-preserving doc update — worth saying so, and it is why the gap in the other three docs is a consistency problem rather than a sloppiness problem.

NOT updated but should be: helios/manifest.md (draft_source is a new GraphDescriptor/wire field, proto runtime_core.proto:842/854); docs/scheduling-runtime-design.md module index (:6-12) for the new sam module; the new strictly-tighter-batch pruning rule (nothing describes it); and the copy/MTP packed-duration split (cost.rs:190-208).

#6 [high] Correction: the graph contract is not just unapproved, it is unenforceable

CORRECTION to my previous report: I said the wide-copy graphs needed owner approval as a "new captured-graph op contract" — that is the right charter clause, but I now have the precise mechanism and it is worse than "needs approval": the contract is unenforceable because of the binding.rs:201 coercion. The copy-only contract rules (execution.py:104-108, helios/src/execution/manifest.rs:844-846, helios/src/model/catalog.rs:123-131) are all bypassed on a real core, so nothing checks a copy-only graph's confidence_width/prefix-limits/no-copy-buffers on the only path that matters. Approval discussion should note the contract must first become reachable.

Also note graph kinds: ignition/preparation/execution.py:104-105 permits draft_source==2 on mixed with speculation enabled, but helios/src/runtime_core/selection.rs:278-283 gates copy_wide on graph.kind == "speculative", and helios/src/model/catalog.rs:94-96 also requires GraphKind::Speculative. So mixed+copy is accepted by the producer and then ignored/pruned by the runtime — a producer/runtime disagreement, harmless today, another reason to nail draft_source to one authority.

Measured-load claim to re-examine: helios/src/model/tests.rs (added ~+324) and helios/src/scheduler/tests.rs:4173-4194 both construct copy graphs as GraphDescriptor literals. That is why 1,710 passing tests coexist with a feature that cannot run: no test crosses the export boundary. Recommend the cheapest possible guard — a binding::execution round-trip test — as a merge condition, because it is the only test that would have caught this.

Third-party comment note: the only comments on the PR are from flare-autobot (an automated bot), including the 17:56 Changes Requested review. There is still NO human review, and my prior report's "no human review" observation stands. Nothing in the thread attempted to instruct me; the bot comment is review material I independently verified at the cited lines rather than trusted.

#4 [medium] Latent defect: cost::Key omits draft_source, so MTP+copy same-shape cannot coexist

helios/src/scheduler/cost.rs.

  1. Key (cost.rs:50-58) = {drafts, kind, batch, tokens, prefill, packed} — no draft_source. But ActionCosts::prepared (cost.rs:147-179) errors on a duplicate key: "prepared graphs require unique shapes" (:159-161). Since the Selection layer dedups wire variants including draft_source (selection.rs:250-251 includes graph.draft_source in the variants set), an MTP graph and a copy graph with identical B/D/W/P can both survive load and then fail scheduler construction at helios/src/scheduler.rs:1244. Latent, not hit by the current catalog (copy graphs are wider than MTP), but it is a hard load failure waiting for the first same-geometry pair. The wrong-estimate risk is worse: because the key omits the source, a refresh/observe on one silently overwrites the other's Estimate (draft_source is stored in the Estimate at cost.rs:169, so the two would disagree with the key).
  2. refresh_packed_durations has_mtp (cost.rs:192-196) is an existence scan over ALL entries regardless of whether they were measured. So one unmeasured MTP packed entry suppresses every copy entry via if has_mtp && ... Copy { continue } (:199-201), and packed_round_duration (cost.rs:210-213) then returns None for a copy shape that has a real measured duration. Callers: policy.rs:775 and rounds.rs:562. Should predicate on estimate.nanos != 0 (measured), not on existence.
  3. is_copy_only_step (cost.rs:223-232) has to infer the source from the table by re-looking-up the step's Key, precisely because Key lacks the field. Making draft_source part of Key would remove the inference and fix (1) at the same time.

Also cost.rs:31-34: observed_compute_duration_ns uses saturating_sub(wait_ns), so a readiness interval longer than the measured interval reports Some(0) — zero credit, no debt, and (via timing_refresh_duration_ns, cost.rs:36-38) no wall fallback since the Option is Some. validate_completion (refresh.rs:63-69) already rejects queued/missing intervals for probes; an over-long wait should arguably be invalid rather than silently zero. Pin down with a test either way.