#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:
- L155-213 "Contribution scope and rejection criteria": every contribution must address maintainer request, demonstrated defect, measured perf/memory problem, or inaccurate docs. "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement." "Reject weakened guarantees. Preserve complete cache and speculative state ... Do not remove validation..." "Require focused, meaningful validation."
- L431-444 "Model core compatibility": every engine version must load models from previous versions without re-export; Protobuf additions must use defaults that preserve existing core behavior.
- L446-465 Configuration: never read env var for behavior; setting lives in recipe declaration, config file, or CLI flag.
- L484+ Validation and performance: "Compare other runtimes against an exported core running through flare run"; "performance claims require equivalent baselines".
- AGENTS.md L72-140 Required PR descriptions: why / what changed / claimed benefit / evidence, in order.
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:
helios/src/runtime_core/selection.rs:182-183—retain_wide_copy = source == 1 && history_enabled && fixed.is_none().selection.rs:277-299(diff hunk at 275) —copy_wideinsideexecution.graphs.retain, bypassing thedraft_source == source,draft_tokens <= draftsandmtp_verification_token_budgetfilters for copy graphs.selection.rs:382-396—retained_widths, rewriting the config'sspeculative_widthsto include widths that no MTP graph implements.helios/src/scheduler/cost.rs:192-201—has_mtpspecial case: copy shapes are excluded frompacked_round_durationswhenever any MTP packed shape exists, so the same (batch,width) cost table means different things depending on what else is in the core.helios/src/scheduler/rounds.rs:745-760+— the whole copy-shape branch inpacked_round_candidates, guarded byproposal_source == Mtp && shape.draft_source == Copy && width > 1.helios/src/scheduler.rs:2792andcost.rs:223—is_copy_only_stepkeyed offActionCostsentries rather than the step, so the sameScheduledStepshape is "copy" or "MTP" depending on which graph the manifest happened to bind.
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).
-
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_proposalat 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 updatesdocs/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). -
helios/src/scheduler/sam.rs:22DEFAULT_MIN_MATCH_LEN: usize = 6and the wide-copy constantsWIDE_COPY_PRIOR_RATE = 0.88/WIDE_COPY_MIN_MATCH_LEN = 6(helios/src/scheduler/speculation.rs:15,18) plusbase_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. -
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.rscopy 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 testhelios/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). -
helios/src/scheduler/refresh.rs:99pub fn idle(&mut self) {}— an empty method that silently no longer does anything; call sitehelios/src/scheduler.rs:1281. Suggest deleting the method and the call so "idle does nothing" is visible. Nit. -
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,abortstill discards positive credit, and the aggregate bound indocs/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:
- Producer emits the new field:
ignition/preparation/execution.py:316-319writesdraft_source=signature.draft_source(default 1, 2 = COPY_DRAFT, validated atexecution.py:102-108, stored onGraphSignature.draft_sourceat:32). - The sole route that turns that JSON into a wire
Executionfor a core isheliopause/src/export/capture.rs:3157-3160(request.execution->super::binding::execution(...)->output.index.ranks[0].execution = Some(execution)).binding::executionis defined atbinding.rs:136. - In
binding::execution,binding.rs:196-202unconditionally runsgraph.insert("draft_source".into(), "MTP".into())for every speculative/mixed-speculative graph, after the caller's value is in the map.verify_tokensis derived the same way (that part is legitimate), butdraft_sourceis overwritten rather than derived. Confirmed on main too (binding.rs:201identical atmain), so the PR adds a producer of value 2 without teaching the exporter about it. - Consequences at load:
helios/src/runtime_core/serving.rs:58-63maps 1 ->ProposalSource::Mtp.helios/src/runtime_core/selection.rs:277-298:copy_widerequiresgraph.draft_source == 2, so it is never true; the MTP branch then requiresgraph.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, andretained_widths(:382-391) reports widths no remaining graph implements unlessretain_wide_copyis set — which it isn't, becausesource == 1and history enabled.- The copy-only contract checks can never run either:
helios/src/execution/manifest.rs:845-846andhelios/src/model/catalog.rs:123-131both testdraft_source == Some(Copy), which the export path has already rewritten to Mtp.
- The in-process path is unaffected:
heliopause/src/python.rs:225-233readsdraft_sourcefrom the Python dict withNone => Speculative => Some(Mtp), soroller/ignition debug-serveand 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:4183constructGraphDescriptordirectly).
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").
-
docs/cli-design.md:200-202(not touched by this PR): "--history-draftsenables host history tracking and feeds continuations into the captured graphs' history inputs; it does not change the graphs." After this PR--history-draftschanges the loaded graph set and the configured widths:helios/src/runtime_core/selection.rs:182-184computesretain_wide_copyfrom history + no fixed width;:277-298retains or prunesdraft_source == 2graphs accordingly;:375-380drops kernels for pruned graphs;:382-396rewritesspeculative_widths(the new unit testwide_copy_graphs_retain_only_when_history_drafts_enabled,selection.rs:1876-1940, asserts[1,6,16,24]vs[1,6]). Alsodocs/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.
-
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 theqwen3.8-flashMTP 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 byRequestScheduler::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:359does mentiondraft_sourcein the field list, but nothing explainsCOPY_DRAFTor the wide copy-verify path. -
docs/scheduling-runtime-design.mdwas updated only for funded refresh (the diff touches:407-500); it never documentsdraft_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 newhelios/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:
helios/src/scheduler/cost.rs:190-208:has_mtpis an existence scan; if any MTP packed shape exists (measured or not), every copy packed shape is dropped frompacked_round_durations. Sopacked_round_duration(batch, width)(cost.rs:210-213) returnsNonefor a measured copy shape, andspeculative_duration(rounds.rs:559-568,policy.rs:775) silently loses the copy cost in a mixed catalog.cost.rs:223-232is_copy_only_stephas to infer the source by looking the step's key back up in the table, becauseKey(cost.rs:50-58) has no source field.prepared()rejects duplicate shapes (cost.rs:151-161), so an MTP graph and a copy graph with identical B/D/W/P cannot coexist at all.helios/src/scheduler/rounds.rs:755-902is a second, near-duplicate candidate loop guarded byproposal_source == Mtp && shape.draft_source == Copy && width > 1, withbase_mtp_drafts + 3(:766) as the gate andcurve[position]indexing.helios/src/model/catalog.rs:93-131adds copy-only contract checks keyed off the same field, in a file whose stated role is shape validation.helios/src/runtime_core/selection.rs:184,277-298,382-396bypasses the draft_tokens / fixed-width / verification-budget filters for copy graphs, so oneretainpredicate answers two different questions.
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:
1b0db227funded-refresh recovery (helios/src/scheduler/{cost,refresh,policy}.rs,docs/scheduling-runtime-design.md).450012d1per-request prompt+output SAM, a new 1,606-line module (helios/src/scheduler/sam.rs), wired throughscheduler.rs,model/packing.rs,server/runtime.rs.9caba2c7wide 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.14019718padding dominance in shared policy (policy.rs:119-197,221-254) plusDEFAULT_MIN_MATCH_LEN3->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).
-
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 fromhelios/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()atrefresh.rs:101-105now carries the discard logic.) -
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-15WIDE_COPY_PRIOR_RATE = 0.88;speculation.rs:21COPY_STEP_PRIOR_WEIGHT = 4.0;:24COPY_DEPTH_SHRINK_WEIGHT = 2.0(private);helios/src/scheduler/rounds.rs:766base_mtp_drafts.saturating_add(3);helios/src/scheduler/sam.rs:22DEFAULT_MIN_MATCH_LEN = 6(raised from 3 here). Only the6is argued in the description, and with a single 512-token repetitive prompt.0.88,4.0,2.0and the+3have no stated derivation anywhere in the tree. Fix: state the derivation indocs/scheduling-runtime-design.mdnext to the new copy section, or promote the policy-relevant ones into namedPolicyConfigfields.
-
helios/src/scheduler/sam.rsAPI 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 andwith_configusebuild_capped),push_slice(:1023),from_shared_prompt(:935),memory_bytes/state_count/transition_count/prompt_len/output_len/total_len/output_lenaccessors used only by tests. AGENTS.md:188-193 rejects speculative extension points; ~150 lines. Trim to whatproposeneeds or state the caller. -
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 adraft_source=2graph, would settle both AGENTS.md:431-444 compatibility and the wiring claim. -
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 rebuildssamfromspec.prompt(scheduler.rs:1849-1852);resume_decoded_sequence(scheduler.rs:1212-1235) restoresdecoded_sequenceand pushes only viahistory.append, notsam.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
heliopause/src/export/binding.rs:201overwritesdraft_sourcewith"MTP"on the sole export route (capture.rs:3157-3160), sodraft_source = 2produced byignition/preparation/execution.py:32,102-108,316-319never survives to a core:serving.rs:58-63reads MTP,selection.rs:277-298prunes the wide copy graphs (copy_wideneeds 2; the MTP branch needsdraft_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", elseinvalid) + onebinding::executionround-trip test (the existing test atbinding.rs:1431-1449never sets the field). Compatibility direction preserved by the absent=>MTP default, perAGENTS.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
refresh.rs:95-99emptyidle()plus its no-op call sites — delete.- ~150 lines of SAM API with no production caller (
propose_conditional_continuationssam.rs:1118-1189,propose_for_context:1070-1110,MatchSource/source,PromptSAM::build,push_slice,from_shared_prompt, test-only accessors). - Wide copy-verify (
W=16/W=24) never exported or replayed on GPU; cost-refresh never measured under live power-limit transitions (the PR says so itself). One load-and-serve of an exported W=8 core plus one with adraft_source=2graph would settle both the compatibility claim and the wiring defect above. - No test that a preempted-then-readmitted request still proposes continuations:
server/runtime.rs:2068-2110re-appends generated text to the prompt and admission rebuilds the SAM (scheduler.rs:1849-1852), butresume_decoded_sequence(scheduler.rs:1212-1235) only pushes intodecoded_history, notsam. Not proven a defect (the text is in the prompt again); untested either way.
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
- Q1: was the wide copy-verify path (new manifest field + new contract on speculative graphs) approved in advance, as
docs/design-review.mdrequires for new captured-graph operation families? Nothing in the description says so. - Q2: is
cost.rs:190-208has_mtpintended as "copy shapes only compete when no MTP packed shape exists"? No comment, no test asserts mixed-catalog cost semantics. - Q3: can commits 2–4's live numbers be reproduced without commit 1? Not determinable from the repository.
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.