Architecture scratchpad · NVIDIA/hyperflare-inference #540

Raw Markdown for agents: https://autobot.eidonix.com/p/576ab5ef-7a2a-458d-9230-ccd292b2a8a7.md

#1 [high] Project rules (charter, AGENTS.md, design-review) key clauses

Sources: read_charter, AGENTS.md (main), docs/design-review.md (main).

Charter: "Solve the right problem in the right place... smallest footprint in shared code"; "Stay focused... not interested in piling on extra model aliases, random switches"; "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload"; "Keep the runtime small and model-agnostic. Helios handles scheduling, caches, requests, and shouldn't accumulate per-model branches"; "Be explicit and pin everything. No magic defaults... Benchmarks, tests, or feature flags don't override architectural rules." Charter code review: "Supported matrix & compatibility: ... Check state and CUDA-graph transitions, and verify that existing data, artifacts, and exported cores still load." "No per-model special cases or flags."

AGENTS.md:

design-review.md principles: 1 "Keep Helios as simple as possible ... Introducing a captured-graph operation family requires prior explicit approval"; 3 "Preserve canonical model semantics and shared mechanisms ... Admission, page reservation and growth, eviction, preemption, readmission, and offload must not branch on model or recipe identity or capability flags"; 7 "Preserve complete committed state"; 8 "Budget physical memory across the lifecycle. Bound loading, tuning, compilation, capture, and serving storage"; 12 "Validate the real path and report evidence honestly ... keep raw measurements and disclose unrun checks"; 13 "Preserve model core compatibility"; 15 "Reject scope expansion and weakened constraints"; 16 "Write without hidden context".

#2 [high] Should fix: PR bundles four unrelated outcomes (~4k lines, 25 files)

Severity: should fix (scope).

Files: whole PR (25 files, +3965/−119) — helios/src/scheduler/{cost,refresh,policy,rounds,sam}.rs, runtime_core/selection.rs, model/catalog.rs, heliopause/src/python.rs, ignition/preparation/execution.py, docs/scheduling-runtime-design.md.

The description itself lists four independent commits (a85be397 cost-refresh recovery; 83ff9ed6 SAM copy drafts; 35ab143a wide copy-verify graph scheduling; 7ca5430c padding dominance + DEFAULT_MIN_MATCH_LEN 3→6). Each has its own motivation, risk surface and evidence, and each touches a different subsystem (refresh ledger; new 1600-line SAM module; graph catalog/selection/manifest metadata; batch padding policy).

Rule: AGENTS.md L196-199 "Keep each PR focused on one coherent outcome and describe its problem, resulting behavior, validation, and material limitations." design-review.md principle 15 (reject scope expansion / weakened constraints) and charter "Solve the right problem in the right place ... smallest footprint in shared code".

Why it matters: (a) the padding-dominance change and the match-length change alter behaviour for all existing speculation users (policy.rs dominates_padding_with / prune_padding, sam DEFAULT_MIN_MATCH_LEN), while the SAM and wide-copy work only affects cores that carry copy inputs; mixing them makes it impossible to attribute the measured improvement or to bisect a regression. The headline figure ("3.078 -> 3.650 emitted tokens/round") is a combined-stack number for three of the four commits. (b) Nothing in the description isolates the padding-dominance change's live effect from the wide-copy graph change, so the "max_b == C" table cannot be attributed.

Fix: split into (1) the funded-refresh recovery fix (a self-contained defect fix with CPU tests), (2) the padding-dominance + min-match-len change (shared policy, live evidence), (3) the SAM/wide copy-verify feature stack (new capability, new metadata).

#3 [high] Should fix: second proposal-source dimension in manifest + load-time special cases

Severity: should fix (architecture).

Where the duplication appears:

Why it matters: a graph's proposal source is already an expression of the core's speculative_proposal_source config (selection.rs:161-165, model.rs), and the scheduler already has proposal_source. This change adds a second source of truth (GraphDescriptor::draft_source, defaulted from kind == Speculative in heliopause/src/python.rs:231-232) and then needs a dozen conditionals to keep the two consistent. Rules: design-review.md principle 1 ("Keep Helios as simple as possible ... Express differences through cache schemes and prepared layout metadata reusable across models") and principle 3 ("Do not add ... capability flags"); AGENTS.md L188-193 "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement"; L176-181 "Flags, enums, callbacks, optional paths, and temporary implementations cannot be used to bypass them."

Also note has_mtp/copy_wide make behaviour depend on which other graphs a core contains — a non-local dependency that is hard to test and easy to break.

Fix: derive per-shape source from the key alone (e.g. keep one CostKey-level notion driven by a single declared catalog field), and keep one place that answers "may a copy-only shape be scheduled" instead of four. If wide copy-only graphs are wanted, the smallest footprint is a scheduler-level check on the captured shape list, not new manifest metadata threaded through selection, catalog, cost, rounds and runtime.

#4 [high] Nit/medium: docs stale after SAM change; unpinned constants; evidence gaps; no-op idle()

Severity: nit / should-fix (documentation accuracy).

  1. docs/mtp-design.md (unchanged by this PR) still states that history drafting works from a "host-memory ring" of "exact eight-token and four-token indexes" and "return[s] up to seven observed continuation tokens" (lines 31-34), and that it "requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do" (lines 25-27). After this PR the primary source is a per-request prompt+output suffix automaton (helios/src/scheduler/sam.rs, RequestScheduler::request_history_proposal at helios/src/scheduler.rs:1102), with the shared ring only as fallback when it has a strictly longer match (scheduler.rs:1128-1147). The PR only updates docs/scheduling-runtime-design.md. AGENTS.md requires design docs to describe implemented mechanism and present qualification. Fix: update mtp-design.md's history-drafting section (mechanism, min match length 6, 131,072-token caps, 512-token boundary overlap).

  2. helios/src/scheduler/sam.rs:22 DEFAULT_MIN_MATCH_LEN: usize = 6 and the wide-copy constants WIDE_COPY_PRIOR_RATE = 0.88 / WIDE_COPY_MIN_MATCH_LEN = 6 (helios/src/scheduler/speculation.rs:15,18) plus base_mtp_drafts + 3 (rounds.rs copy branch) are unpinned magic numbers in shared policy. Charter: "Be explicit and pin everything. No magic defaults". The PR calls them calibrated but the evidence offered is one repetitive 512-token prompt; no derivation of 0.88 or of "+3" is given. Fix: state the derivation in the design doc or make them explicit policy fields.

  3. Evidence gap: live results are DeepSeek-V4.1 Flash TP4 on SM120 only with --history-drafts; copy-only wide graphs (W=16/24) were never exported or replayed on a GPU (the PR's own Limitations say so). So the wide-copy scheduling path (rounds.rs copy branch at ~745, catalog.rs:93-131, selection.rs:275-299,382-396) has CPU-test-only coverage — AGENTS.md L194-199 "Do not present scaffolding or partially wired features as supported". The compatibility claim ("existing W=8-only cores load") rests on the unit test helios/src/model/tests.rs::wide_copy_verify_catalog_packs_23_sam_tokens_and_preserves_legacy_w8_cores, not a load-and-serve of a previously exported core (design-review.md principle 13).

  4. helios/src/scheduler/refresh.rs:99 pub fn idle(&mut self) {} — an empty method that silently no longer does anything; call site helios/src/scheduler.rs:1281. Suggest deleting the method and the call so "idle does nothing" is visible. Nit.

  5. Positive note to record (no finding): the refresh change itself (refresh.rs:71-105, cost.rs:31-38) is a clean, well-scoped defect fix — compute duration excludes measured readiness wait, idle preserves earned credit and debt, abort still discards positive credit, and the aggregate bound in docs/scheduling-runtime-design.md (P <= 0.002/0.998 * O + D) still holds because idle adds neither credit nor ordinary duration. refresh_order (cost.rs:284-293) now returns a tiered key instead of a timestamp, which fixes the "probe older/smaller shapes first" defect.

#6 [high] Blocking: export path overwrites draft_source with "MTP", so copy-only wide graphs never survive export

Severity: blocking (the PR's headline feature cannot run on an exported core; contradicts the PR's "no core re-export required / wired" claim).

Chain, verified in code:

  1. Producer emits the new field: ignition/preparation/execution.py:316-319 writes draft_source=signature.draft_source (default 1, 2 = COPY_DRAFT, validated at execution.py:102-108, stored on GraphSignature.draft_source at :32).
  2. The sole route that turns that JSON into a wire Execution for a core is heliopause/src/export/capture.rs:3157-3160 (request.execution -> super::binding::execution(...) -> output.index.ranks[0].execution = Some(execution)). binding::execution is defined at binding.rs:136.
  3. In binding::execution, binding.rs:196-202 unconditionally runs graph.insert("draft_source".into(), "MTP".into()) for every speculative/mixed-speculative graph, after the caller's value is in the map. verify_tokens is derived the same way (that part is legitimate), but draft_source is overwritten rather than derived. Confirmed on main too (binding.rs:201 identical at main), so the PR adds a producer of value 2 without teaching the exporter about it.
  4. Consequences at load:
    • helios/src/runtime_core/serving.rs:58-63 maps 1 -> ProposalSource::Mtp.
    • helios/src/runtime_core/selection.rs:277-298: copy_wide requires graph.draft_source == 2, so it is never true; the MTP branch then requires graph.draft_tokens <= drafts (:292), and copy-only wide graphs declare depth 23 (> drafts 7), so they are pruned. Net: an exported core loses every wide copy graph, silently, and retained_widths (:382-391) reports widths no remaining graph implements unless retain_wide_copy is set — which it isn't, because source == 1 and history enabled.
    • The copy-only contract checks can never run either: helios/src/execution/manifest.rs:845-846 and helios/src/model/catalog.rs:123-131 both test draft_source == Some(Copy), which the export path has already rewritten to Mtp.
  5. The in-process path is unaffected: heliopause/src/python.rs:225-233 reads draft_source from the Python dict with None => Speculative => Some(Mtp), so roller/ignition debug-serve and the CPU tests exercise the new value while the exported path does not — which is exactly why the CPU test suite passes (e.g. helios/src/model/tests.rs:1944, helios/src/scheduler/tests.rs:4183 construct GraphDescriptor directly).

Fix: derive the enum name instead of overwriting it — read the incoming value (1 -> "MTP", 2 -> "COPY_DRAFT", absent -> "MTP" for backwards compatibility with cores produced before this field existed, anything else -> invalid(...)) and add one binding::execution round-trip test asserting 2 survives. Note this is also the compatibility-relevant direction: AGENTS.md:431-444 requires older cores to keep loading, which the "absent -> MTP" default preserves.

How to confirm: a load-and-serve of an exported core containing a graph with draft_source = 2, checking describe/selection keeps it; impossible from the current test suite, which never round-trips through binding::execution with the field set (the existing test at binding.rs:1431-1449 does not set draft_source).

#7 [high] Should fix: docs/cli-design.md and mtp-design.md contradict the new load-time behaviour

Severity: should fix (documentation accuracy — AGENTS.md:165-166 makes inaccurate documentation a rejection item; docs/design-review.md:12 "report evidence honestly").

  1. docs/cli-design.md:200-202 (not touched by this PR): "--history-drafts enables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs." After this PR --history-drafts changes the loaded graph set and the configured widths:

    • helios/src/runtime_core/selection.rs:182-184 computes retain_wide_copy from history + no fixed width;
    • :277-298 retains or prunes draft_source == 2 graphs accordingly;
    • :375-380 drops kernels for pruned graphs;
    • :382-396 rewrites speculative_widths (the new unit test wide_copy_graphs_retain_only_when_history_drafts_enabled, selection.rs:1876-1940, asserts [1,6,16,24] vs [1,6]). Also docs/cli-design.md:741's table row ("Augment learned drafts with shared decoded-history continuations; requires enabled speculation and captured history inputs") no longer describes the primary mechanism (per-request SAM) or the graph-set effect.
  2. docs/mtp-design.md:22-40 (not touched): says the mechanism is a shared 65,536-token ring with eight/four-token indexes returning "up to seven" continuations, and that it "requires speculative graphs that declare copy-token inputs, which only the qwen3.8-flash MTP graphs do". After this PR the primary source is a per-request prompt+output suffix automaton (helios/src/scheduler/sam.rs:1-37), wired at admission (helios/src/scheduler.rs:1849-1852) and queried by RequestScheduler::request_history_proposal (scheduler.rs:1099-1159), with the ring used only when it has a strictly longer match (:1143-1148). New caps and defaults are undocumented: min_match_len = 6 (sam.rs:22, raised 3->6 by this PR), 131,072-token prompt cap (sam.rs:24-25), 131,072-token output cap (sam.rs:27-28), 512-token boundary overlap (sam.rs:30-32). docs/mtp-design.md:359 does mention draft_source in the field list, but nothing explains COPY_DRAFT or the wide copy-verify path.

  3. docs/scheduling-runtime-design.md was updated only for funded refresh (the diff touches :407-500); it never documents draft_source, wide copy-verify shapes, the copy/MTP packed-duration split (cost.rs:190-208), or the new strictly-tighter-batch pruning rule (policy.rs:221-254), and its module index (:6-12) omits the new helios/src/scheduler/sam.rs.

Fix: update these three places; nothing else needs new documentation.

#8 [high] Should fix: second proposal-source dimension with non-local cost semantics

Severity: should fix (architecture). Rule: docs/design-review.md principle 1 ("Keep Helios as simple as possible … introduce differences through prepared layout metadata reusable across models") and principle 3 ("do not add capability flags"); AGENTS.md:188-193 (reject unsupported abstractions / configuration switches without a concrete requirement) and AGENTS.md:176-181 (flags, enums and optional paths cannot bypass boundaries).

This extends my earlier note #3 with the newly confirmed code facts.

New: GraphDescriptor::draft_source (helios/src/execution/manifest.rs:190-192) is a second proposal-source dimension that duplicates the pre-existing ModelConfig::speculative_proposal_source (helios/src/model.rs:113) and RequestScheduler::proposal_source (scheduler.rs:1044-1050). Three separate ladder decoders exist: heliopause/src/python.rs:225-233, helios/src/runtime_core/serving.rs:58-63, helios/src/runtime_core/selection.rs:144-148, plus a fourth encoding in describe.rs:534,778.

Cost/selection semantics now depend on which other graphs the core contains:

Fix: one authority. Keep the source in a single place (derive the per-shape source from the captured shape or from a named enum on the cost row, not from a global "does an MTP shape exist" scan), split the packed-duration table explicitly into MTP-verify and copy-verify tables, and have is_copy_only_step read a source carried on the step instead of re-querying the table. Then selection.rs needs no copy_wide bypass.

Evidence gap: due to the export defect (note 6) the wide-copy path only ever runs in-process; the CPU fixtures (helios/src/model/tests.rs:1861-2075, helios/src/scheduler/tests.rs:4120-4300) construct manifests by hand.

#9 [high] Should fix: four unrelated outcomes in one PR (re-confirmed at head)

Severity: should fix (scope) — unchanged from note #2, but re-confirmed against the current head 14019718.

25 files, +3968/−119, four independent outcomes, per the PR description's own commit list:

  1. 1b0db227 funded-refresh recovery (helios/src/scheduler/{cost,refresh,policy}.rs, docs/scheduling-runtime-design.md).
  2. 450012d1 per-request prompt+output SAM, a new 1,606-line module (helios/src/scheduler/sam.rs), wired through scheduler.rs, model/packing.rs, server/runtime.rs.
  3. 9caba2c7 wide copy-verify graphs: new manifest field (execution/manifest.rs:190-192), new proto enum already on main (helios/proto/runtime_core.proto:842,854), Python producer (ignition/preparation/execution.py:32,102-108,316-319), selection/catalog/cost/rounds/serving changes.
  4. 14019718 padding dominance in shared policy (policy.rs:119-197,221-254) plus DEFAULT_MIN_MATCH_LEN 3->6 (sam.rs:22).

Rule: AGENTS.md:196-199 "Keep each PR focused on one coherent outcome". design-review.md principle 15 (reject scope expansion). Charter: "solve the right problem in the right place … smallest footprint in shared code"; "bring real evidence".

Why it matters: (a) commit 4 changes behaviour for every speculation user, while commits 2–3 affect only cores with copy inputs; (b) the headline live numbers are combined-stack ("+12.9% tok/s", "3.078 -> 3.650 emitted tokens/round") and the max_b == C padding table cannot be attributed to commit 4 alone; (c) commit 1 is a self-contained defect fix that could merge today and is the only part my lens found clean and fully evidenced by CPU tests.

Fix: split into (a) refresh recovery, (b) padding dominance + min-match-len, (c) SAM + wide copy-verify. If kept together, report per-commit live measurements.

#10 [high] Nits: no-op idle(), unpinned constants, unused SAM API, evidence gaps; refresh commit is clean

Severity: nit (some items lean should-fix; noted).

  1. helios/src/scheduler/refresh.rs:95-99 — pub fn idle(&mut self) {} is now an empty method with a doc comment explaining that it does nothing, still called from helios/src/scheduler.rs (s.idle()) and from tests (policy_tests.rs:2637,2696,2701). Delete the method and the call sites so "idle changes nothing" is a property of the code, not a no-op function. (Contrast: abort() at refresh.rs:101-105 now carries the discard logic.)

  2. Unpinned calibrated constants in shared policy — charter "Be explicit and pin everything. No magic defaults"; AGENTS.md:187 "Numerical bounds must follow the required arithmetic and measured repeatability":

    • helios/src/scheduler/speculation.rs:14-15 WIDE_COPY_PRIOR_RATE = 0.88;
    • speculation.rs:21 COPY_STEP_PRIOR_WEIGHT = 4.0; :24 COPY_DEPTH_SHRINK_WEIGHT = 2.0 (private);
    • helios/src/scheduler/rounds.rs:766 base_mtp_drafts.saturating_add(3);
    • helios/src/scheduler/sam.rs:22 DEFAULT_MIN_MATCH_LEN = 6 (raised from 3 here). Only the 6 is argued in the description, and with a single 512-token repetitive prompt. 0.88, 4.0, 2.0 and the +3 have no stated derivation anywhere in the tree. Fix: state the derivation in docs/scheduling-runtime-design.md next to the new copy section, or promote the policy-relevant ones into named PolicyConfig fields.
  3. helios/src/scheduler/sam.rs API surface with no production caller: propose_conditional_continuations (:1118-1189, doc references a "2-deep pipelined execution" that does not exist in the tree), propose_for_context (:1070-1110), MatchSource + MatchProposal::source (:66-83), PromptSAM::build (:283, only tests and with_config use build_capped), push_slice (:1023), from_shared_prompt (:935), memory_bytes/state_count/transition_count/prompt_len/output_len/total_len/output_len accessors used only by tests. AGENTS.md:188-193 rejects speculative extension points; ~150 lines. Trim to what propose needs or state the caller.

  4. Evidence coverage (the PR is honest about it — nit, not a finding): copy-only wide graphs (W=16/W=24) were never exported or replayed on a GPU, and cost-refresh under live power-limit transitions was not measured; every wide-copy test is a CPU fixture. Combined with note 6 this means the feature has never run on the path it claims. A single load-and-serve of an already-exported W=8 core, plus one exported core with a draft_source=2 graph, would settle both AGENTS.md:431-444 compatibility and the wiring claim.

  5. Preempt->readmit gap: helios/src/server/runtime.rs:2068-2110 (park) re-admits with the generated text appended to the prompt (:2071-2086), and admission rebuilds sam from spec.prompt (scheduler.rs:1849-1852); resume_decoded_sequence (scheduler.rs:1212-1235) restores decoded_sequence and pushes only via history.append, not sam.push_token. Worth one test that a re-admitted request still proposes its earlier output continuation. Not verified as a defect — the prompt now contains that text, so SAM re-indexes it — but the behaviour is untested.

Positive (no action): commit 1 is clean. cost::observed_compute_duration_ns/timing_refresh_duration_ns (cost.rs:31-38) subtract measured readiness wait for timing credit and refresh debt while observed_duration_ns keeps raw physical time for acceptance learning (refresh.rs:71-93); idle retaining credit and debt preserves P <= 0.002/0.998 * O + D because idle adds neither; abort still discards positive credit; refresh_order (cost.rs:284-293) replacing the nanosecond timestamp with a two-tier (bool, u64) key fixes the real "probe the older/smaller shape first" defect, and select_plan's compare_refresh (policy.rs:1333-1338,1369-1372) now ranks by zero-duration expected value.

#11 [high] Research summary

Verdict: one blocking architecture/wiring defect, then should-fix scope and design issues; the funded-refresh commit is clean and could merge alone.

Blocking — the wide copy-verify feature is dead on every exported core. heliopause/src/export/binding.rs:201 unconditionally does graph.insert("draft_source", "MTP") after the producer's value is already in the map, and binding::execution is the only route from the Python manifest to a wire Execution (heliopause/src/export/capture.rs:3157-3160). So the draft_source = 2 that ignition/preparation/execution.py:32,102-108,316-319 now emits arrives at load as MTP (helios/src/runtime_core/serving.rs:58-63), copy_wide in helios/src/runtime_core/selection.rs:277-298 is never true, and since copy graphs declare depth 23 > drafts, they are pruned silently. The copy-only contract checks (helios/src/execution/manifest.rs:845-846, helios/src/model/catalog.rs:123-131) can never fire either. In-process paths (heliopause/src/python.rs:225-233) and every CPU test construct descriptors directly, which is why the suite passes and the description's "no re-export required" claim looks satisfied. Fix: derive the enum name (2 => "COPY_DRAFT", absent => MTP for backward compatibility per AGENTS.md:431-444, unknown => invalid) plus one round-trip test.

Should fix (my lens). (1) Scope: 25 files / +3968 for four independent outcomes against AGENTS.md:196-199; the "+12.9% tok/s" and max_b == C numbers are combined-stack and cannot be attributed or bisected. (2) GraphDescriptor::draft_source is a second proposal-source authority duplicating speculative_proposal_source, decoded by four separate ladders, and it forces non-local semantics: cost.rs:190-208 has_mtp is an existence scan that drops measured copy shapes from the packed table, Key (cost.rs:50-58) has no source field so is_copy_only_step (:223-232) infers it from the table, prepared() rejects identical B/D/W/P so MTP and copy graphs cannot coexist, and rounds.rs:755-902 duplicates the ordinary candidate loop. (3) Docs contradict the new behaviour: docs/cli-design.md:200-202 still says --history-drafts "does not change the graphs" while selection.rs:277-298,375-396 prunes graphs, drops kernels and rewrites speculative_widths; docs/mtp-design.md:22-40 still describes only the shared ring, while the SAM is primary; docs/scheduling-runtime-design.md never documents draft_source, the copy/MTP split or the new pruning rule. (4) Unpinned shared-policy constants: 0.88, 4.0, 2.0 (speculation.rs:14-24), +3 (rounds.rs:766), 6 (sam.rs:22 (not opened)) — only the last is argued, from one prompt.

Nits: empty RefreshState::idle(), ~150 lines of uncalled SAM API (propose_conditional_continuations, propose_for_context, MatchSource), and wide copy-verify has never been exported/replayed on a GPU, so the feature's evidence covers a path it cannot reach.

Full detail, citations and line numbers are in scratchpad notes 6–10.

#12 [high] Final verdict and report outline for PR #540 (architecture & scope lens)

Head reviewed: 14019718 on base main f377dc85; 25 files, +3968/−119. Lens: architecture and scope (does it belong, is the approach right).

VERDICT: one blocking defect (export path), four should-fix items, several nits. The funded-refresh commit (1b0db227) is clean and mergeable on its own today.

BLOCKING

  1. heliopause/src/export/binding.rs:201 overwrites draft_source with "MTP" on the sole export route (capture.rs:3157-3160), so draft_source = 2 produced by ignition/preparation/execution.py:32,102-108,316-319 never survives to a core: serving.rs:58-63 reads MTP, selection.rs:277-298 prunes the wide copy graphs (copy_wide needs 2; the MTP branch needs draft_tokens <= drafts), and the copy-only contract checks (execution/manifest.rs:845-846, model/catalog.rs:123-131) can never fire. Silent, and it contradicts the description's compatibility claim and "no core re-export" framing. Fix: derive the name (2 => "COPY_DRAFT", absent => "MTP", else invalid) + one binding::execution round-trip test (the existing test at binding.rs:1431-1449 never sets the field). Compatibility direction preserved by the absent=>MTP default, per AGENTS.md:431-444. Full detail: scratchpad note #6.

SHOULD FIX 2. Scope: four independent outcomes in one PR (AGENTS.md:196-199 "Keep each PR focused on one coherent outcome"; design-review.md principle 15; charter "smallest footprint in shared code"). Commit 4 (padding dominance + DEFAULT_MIN_MATCH_LEN 3->6) changes behaviour for every speculation user; the live numbers are combined-stack so neither the max_b == C table nor "+12.9% tok/s" is attributable. Note #9. Fix: split (a) refresh recovery, (b) padding dominance + min-match-len, (c) SAM + wide copy-verify; or at minimum report per-commit live numbers. 3. Second proposal-source authority: execution/manifest.rs:190-192 draft_source duplicates model.rs:113 speculative_proposal_source / scheduler.rs:1044-1050, with four decode ladders (python.rs:225-233, serving.rs:58-63, selection.rs:144-148, describe.rs:534,778). Non-local consequences: cost.rs:190-208 has_mtp existence scan drops measured copy shapes so packed_round_duration returns None for a measured shape; cost.rs:50-58 Key lacks a source so is_copy_only_step (:223-232) infers it from the table; cost.rs:151-161 rejects an MTP and a copy graph with identical B/D/W/P; rounds.rs:755-902 duplicates the ordinary candidate loop; selection.rs:184,277-298,382-396 bypasses the draft-depth / fixed-width / verification-budget filters for copy graphs. Rules: design-review.md principles 1 and 3; AGENTS.md:176-181,188-193. Note #8. Fix: one authority (source on the cost row or on the step), explicit MTP-verify vs copy-verify packed tables, no copy_wide bypass. 4. Documentation contradicts the code: docs/cli-design.md:200-202 ("does not change the graphs") vs selection.rs:277-298,375-396 (prunes graphs, drops kernels, rewrites speculative_widths; also docs/cli-design.md:741); docs/mtp-design.md:22-40 still describes a shared ring with eight/four-token indexes and "only qwen3.8-flash declares copy inputs", while the SAM is primary (sam.rs:1-37, scheduler.rs:1849-1852,1099-1159, ring only on a strictly longer match at :1143-1148) and the new caps (sam.rs:22-32) are unmentioned; docs/scheduling-runtime-design.md documents only the refresh change — no draft_source, no copy/MTP duration split (cost.rs:190-208), no new pruning rule (policy.rs:221-254), and its module index (:6-12) omits sam.rs. Rules: AGENTS.md:165-166, design-review.md:12. Note #7. 5. Unpinned shared-policy constants: speculation.rs:14-15 0.88, :21 4.0, :24 2.0; rounds.rs:766 base_mtp_drafts + 3; sam.rs:22 DEFAULT_MIN_MATCH_LEN = 6. Charter "be explicit and pin everything"; AGENTS.md:187. Only the 6 is argued (one 512-token repetitive prompt); 0.88/4.0/2.0/+3 have no derivation in the tree. Note #10 item 2.

NITS

POSITIVE (no action): the refresh commit is well scoped and correct. cost.rs:31-38 excludes measured readiness wait for timing credit and refresh debt while observed_duration_ns keeps physical time for acceptance learning (refresh.rs:71-93); idle retaining credit and debt preserves P <= 0.002/0.998 * O + D since idle adds neither; abort still discards positive credit; refresh_order (cost.rs:284-293) replacing the timestamp with a two-tier key fixes the real "probe the older/smaller shape first" defect, and select_plan's compare_refresh (policy.rs:1333-1338,1369-1372) now ranks by zero-duration expected value.

OPEN QUESTIONS for maintainers

COULD NOT VERIFY: no CI on the head commit, so the reported test counts and the SAM microbenchmark were not independently executed; all live 4× RTX PRO 6000 numbers are unreproducible here — I verified only that they depend on several commits at once. The Python-side catalog generation was read only where draft_source plumbing crosses it.

RULES CITED (full text summarised in note #1): charter (right problem/right place, smallest shared-code footprint, keep the runtime small and model-agnostic, real evidence, pin everything, a benchmark does not waive an architectural rule); AGENTS.md:155-212 (scope and rejection criteria, focused validation, compatibility :431-444); docs/design-review.md principles 1, 3, 12, 13, 15.

#14 [high] Research summary

Verdict at head e5a69669: no blockers left; should-fix issues remain. The one blocking defect from my previous review is fixed, and most of the should-fix list is addressed.

Verified as resolved. heliopause/src/export/binding.rs:201-216 now derives the wire value (None|0|1|"MTP" → "MTP", 2|"COPY_DRAFT" → "COPY_DRAFT", unknown → error, COPY_DRAFT on non-speculative → error) instead of overwriting it, with a round-trip test at :1467-1511; the wide copy-verify feature is no longer dead on the export path. docs/cli-design.md:197-207 (not opened),744 and docs/mtp-design.md:19-71 (not opened) now describe the real behaviour (SAM-first, graph pruning, speculative_widths rewriting) instead of contradicting it. cost::Key carries draft_source (cost.rs:61-84), has_mtp is gone, packed_round_durations is per source (:138-139), and is_copy_only_step reads the step rather than re-inferring from the table (scheduler.rs:1196-1199). The unused SAM API is #[cfg(test)], RefreshState::idle is deleted, and select_shape_with_source was added so step selection can name a source.

Should fix, still open:

Nits: binding.rs:216 writes draft_source even when the derived value is the default, and docs/scheduling-runtime-design.md (not opened) still does not mention the select_host_allocated_candidate/build_host_prefix_ranking refactor that now serves both the ordinary and copy loops. The funded-refresh commit remains architecturally clean and needs no change from this lens.

#15 [high] Report of 2026-11-27, run on head e5a69669 — verdict and findings (architecture & scope)

Head reviewed: e5a69669 (base main f377dc85), 33 files, +4306/−310. Lens: architecture and scope, judged against the charter, AGENTS.md, docs/design-review.md.

Verdict: no blockers at head; four should-fix items; nits.

Resolved since the previous head (14019718) — verified in code, not from the description

Should fix (open)

S1. Combined packed_round_duration reintroduces the non-local coupling the commit removed — helios/src/scheduler/cost.rs:237-252

The _for(source, …) lookups are clean, but the combined accessor decides a copy width's answer by scanning the MTP table in full:

(None, Some(0)) if !self.packed_round_durations[ProposalSource::Mtp as usize]
    .iter().any(|row| row.iter().any(Option::is_some)) => Some(0),

So a measured copy-only shape at (batch, width) returns None or Some(0) depending on whether some unrelated MTP shape anywhere in the catalog is measured — the same class of defect as the removed has_mtp scan, one level up. Callers: scheduler/rounds.rs:585-589 (speculative_duration), scheduler/policy.rs:785 (continuation_candidate), scheduler/service.rs:109,156. Fix: drop the combined accessor and make each caller say which source it prices (the docs now describe the two tables separately at docs/scheduling-runtime-design.md:423-432, so the code should match).

S2. Scope: four independent outcomes in one PR — AGENTS.md:198

33 files, +4306/−310, four commits for four unrelated outcomes: (1) funded-refresh recovery in the refresh ledger; (2) a ~1,307-line helios/src/scheduler/sam.rs plus admission wiring (scheduler.rs:1843-1850, model/packing.rs, server/runtime.rs); (3) wide copy-verify graphs across manifest/Python producer/selection/catalog/cost/rounds/serving; (4) padding dominance in shared policy.rs:119-276 plus DEFAULT_MIN_MATCH_LEN 3→6. Commit 4 changes behaviour for every speculation user while 2–3 only affect cores carrying copy inputs. The headline live numbers ("+12.9% tok/s", "3.078 → 3.650 emitted tokens/round", max_b == C) are combined-stack (stated against prior head 14019718), so no part can be attributed or bisected; @voipmonitor's live run was --no-history-drafts only, i.e. the wide copy-verify graphs never ran. Commit 1b0db227 is self-contained, has real CPU evidence, and could merge alone today; the rest should split into (b) padding dominance + min-match, (c) SAM + wide copy-verify, with per-commit live numbers.

S3. Two authorities for one proposal source, and the "absent means MTP" default re-implemented four times

GraphDescriptor::draft_source (helios/src/execution/manifest.rs:190-192) sits beside the pre-existing ModelConfig::speculative_proposal_source (helios/src/model.rs:113) and RequestScheduler::proposal_source (helios/src/scheduler.rs:683). Decoders of the same integer: heliopause/src/python.rs:225-233, heliopause/src/export/binding.rs:201-216, helios/src/runtime_core/serving.rs:58-62, helios/src/runtime_core/selection.rs:144-148, helios/src/runtime_core/describe.rs:534,778 (the last two decode independently of from_wire/to_wire). The default is re-derived in cost.rs:50-59 (canonical_draft_source), model/catalog.rs:296-299, model/packing.rs:41-53, runtime_core/selection.rs:290-293. Why it matters: canonical_draft_source also silently coerces a Copy source to Mtp on any non-Speculative kind, so a mixed graph's declared source is discarded rather than rejected. Fix: one accessor on GraphDescriptor (and one on ScheduledStep) that owns normalize/validate, and have describe use from_wire.

S4. Encoder and decoder disagree about draft_source = 0

heliopause/src/python.rs:225-233 maps wire 0 → None (via from_wire), while heliopause/src/export/binding.rs:204 maps 0 → "MTP". A speculative or speculative-mixed graph admitted with None therefore comes back from export as Some(Mtp); runtime_core/selection.rs:244 requires [1, 2] for speculative graphs, so the in-process and exported paths validate the same graph differently, even though helios/manifest.md:38 documents 0 and omission as equivalent. Test binding.rs:1487 asserts 0 → Mtp, which locks the divergence in. Fix: pick one direction (reject 0 on speculative graphs, or normalize to Mtp in python.rs) and make both paths agree.

Nits

Positive (no action)

The funded-refresh commit 1b0db227 remains clean and correctly scoped from this lens: readiness wait excluded from timing-refresh credit but kept for acceptance learning, bounded earned credit retained across idle with abort still discarding it, two-tier refresh_order (cost.rs:324-333) plus zero-duration compare_refresh (policy.rs:1349-1354).

What could not be verified

No CI on head e5a69669; the reported 1,712 / 620 / 207 / 71 test counts and the SAM microbenchmark were not re-run here. No live GPU run examined wide copy-verify graphs (W=16/W=24), so S2's evidence gap stands. Export of a core carrying a draft_source = 2 graph was not exercised end-to-end; binding.rs:1487-1496 is a unit round-trip only.