#1 [high] should fix: RefreshState::idle is an empty function that callers still route through
helios/src/scheduler/refresh.rs:95-99 — pub fn idle(&mut self) {} with a 5-line doc comment explaining that it does nothing. Its only caller is RequestScheduler::idle (helios/src/scheduler.rs:1277-1283), which still validates submissions.is_empty() then calls the no-op; server calls it at helios/src/server/runtime.rs:1184.
Smaller version: delete RefreshState::idle entirely. RequestScheduler::idle collapses to the empty-submissions check (or is renamed to assert_idle). abort already contains the exact discard logic that idle used to share (refresh.rs:101-105, inlined by this PR), so nothing is lost. ~6 lines of dead API plus a doc paragraph that describes a call that has no effect.
Tests also lean on the no-op: helios/src/scheduler/policy_tests.rs:2689, 2699, 2730, 2751, 5714-5765 call s.idle().unwrap() and then assert credit is unchanged — the assertion holds whether or not idle exists, so those lines now only assert that a validator accepts an empty queue.
Docs: docs/scheduling-runtime-design.md:430-433 says "Idle retains earned credit and negative debt; abort discards positive credit and preserves debt" — with an empty idle the only remaining difference is the active flag, which the prose does not mention.
#2 [high] should fix: sam.rs ships large API surface no production caller uses
helios/src/scheduler/sam.rs (new, 1606 lines). Production uses only: PromptOutputSAM::new (scheduler.rs:1852), propose (scheduler.rs:1128, 1179), push_token (scheduler.rs:1232, 3016), MatchProposal::into_padded_i64 (scheduler.rs:1151), plus match_len/tokens.
Test-only or unconsumed:
propose_for_context(sam.rs:1070-1110, 40 lines) — called only from sam.rs:1463 in the randomized oracle test.propose_conditional_continuations(sam.rs:1118-1189, 72 lines) — called only from sam.rs:1505; its doc claims it is "a building block for conditional copy lookup tables in 2-deep pipelined execution", and no such caller exists in the tree.MatchSourceenum +MatchProposal::sourcefield (sam.rs:66-92, 1216-1220):sourceis read only by sam.rs tests (1301, 1309, 1321, 1336). Nothing in helios branches on prompt-vs-output provenance.PromptSAM::build(sam.rs:282) exists only for tests/benchmark; production always goes throughbuild_cappedviawith_config.PromptSAM::{len,is_empty,tokens,state_count,transition_count,memory_bytes}(sam.rs:450-476),PromptOutputSAM::{state_count,dynamic_memory_bytes,memory_bytes,prompt_sam,config,prompt_len}(949-984),push_slice(1023) — only tests and the ignored microbenchmark read them.memory_bytescosts acapacity()-based accounting function with no consumer (there is no scheduler metric wired to it).
Smaller version: keep push_token, propose, new/from_shared_prompt, into_padded_i64, and the internal builders; drop propose_for_context, propose_conditional_continuations, MatchSource/source, PromptSAM::build, and the accessor block (keep whatever the retained tests need). That removes roughly 150 lines of code plus ~6 tests that only exercise them (sam.rs:1313-1324 source assertions, 1492-1514, 1517-1541). It also removes the MatchSource/endpos public surface from a module declared pub mod sam (scheduler.rs:23), i.e. from Helios' external API.
#3 [high] Research summary
Reviewed PR #540 through the simplicity lens (what can be deleted), against AGENTS.md, docs/design-review.md and the charter, reading every changed hunk in context and following callers (scheduler.rs, rounds.rs, policy.rs, packing.rs, server/runtime.rs, selection.rs, catalog.rs, planning.py (not opened) side).
Two findings are on the scratchpad:
-
should fix —
RefreshState::idleis an empty function (refresh.rs:95-99). The PR emptied it and wrote a five-line doc comment saying it does nothing;RequestScheduler::idle(scheduler.rs:1277) still validates the queue then calls it, and server/runtime.rs:1184 still calls that. Delete the method (and collapse/rename the scheduler wrapper);abortalready carries the discard logic the old body shared. Several policy tests now only assert that a validator accepts an empty queue. -
should fix — sam.rs ships a large test-only API surface.
propose_conditional_continuations(sam.rs:1118-1189) andpropose_for_context(1070-1110) have no production caller and no planned 2-deep consumer exists;MatchSource/sourceis only read by tests;PromptSAM::buildand the accessor block (state_count,transition_count,memory_bytes,dynamic_memory_bytes,prompt_sam,config,prompt_len,push_slice) are test/benchmark-only. Deleting them removes ~150 lines plus the tests that only exercise them, and shrinks thepub mod samsurface.
Two more observations I did not get onto the scratchpad in time, both nits from the same lens: ExecutionManifest/catalog/serving/python.rs each repeat the same 0=>None, 1=>Mtp, 2=>Copy decoding (serving.rs:55-64 and python.rs:223-232 could share one conversion), and request_copy_match_stats (scheduler.rs:1163-1205) is a near-duplicate of request_history_proposal_with_match_len (1112-1159) — one of the two could be expressed in terms of the other to avoid two copies of the SAM-vs-shared-history arbitration rule drifting apart.
#6 [high] should fix: history_proposal became test-only in this PR — public scheduler entry point with no production caller
Verified at head 1401971.
RequestScheduler::history_proposal (helios/src/scheduler.rs:1094-1097, pub fn) had exactly two production callers before this PR: helios/src/model/packing.rs and helios/src/server/runtime.rs:2146. Both were switched in this PR to request_history_proposal (packing.rs:402, server/runtime.rs:2143-2150).
Full caller list after the change (search history_proposal\b): only tests —
- helios/src/scheduler/tests.rs:1956, 1970, 1972, 1973, 1974, 1979, 1985, 1991 (the
shared_drafts_learn_committed_outputs_...test) - helios/src/server/runtime/phase_tests.rs:583, 1835
So the PR leaves three entry points for the same lookup: the handle-keyed request_history_proposal (prod), the handle-keyed request_copy_match_stats (prod, rounds.rs:775), and the context-keyed history_proposal (dead outside tests), plus DecodedHistory::lookup (helios/src/scheduler/decoded_history.rs:180-183) which now only history_proposal and the decoded_history oracle tests call.
Smaller version: delete the pub fn history_proposal wrapper. Move the ~8 assertions of that test onto request_history_proposal (the test already admits a live request h/next, so it has a handle) — this is also the more faithful test, since the shared-ring assertions it makes are about the fallback path that production reaches through the handle-keyed API. Keep DecodedHistory::lookup as pub(crate) because the ring's own brute-force oracle test (decoded_history.rs:276) is worth keeping.
Why it matters in this lens: history_proposal also bypasses the SAM entirely, so a future caller could silently reintroduce prompt-blind copy drafts; the PR's own claim is that the SAM is now first. Leaving the bypass as public API works against that.
#7 [high] should fix: rounds.rs copy-only candidate loop duplicates the ordinary packed loop (~110 lines)
Verified at head 1401971 (helios/src/scheduler/rounds.rs).
packed_round_candidates now contains two cohort-scoring loops over the same shape table:
- ordinary path: rounds.rs:925-1060 (after the fixed-width early continue at 905-924)
- copy-only path added by this PR: rounds.rs:755-903, entered on
proposal_source == Mtp && shape.draft_source == Some(Copy) && shape.width > 1, endingcontinue
The copy block re-implements, statement for statement:
scores/rank_prefixes(791-800) vsforecasts/gains/ranks(929-956)- per-lane
base/full(808-816) vsbase/base_zero/full/limits(965-976) - the 3-ordering loop with
select_nth_unstable_by+sort_unstable_by+cohort(818-838) vs 981-992 — identical text apart from the closure frontier.clear(),host_lengths,lane_terms,mask |= 1 << slot(839-867) vs 993-1012- the
besttie-break on(mask.count_ones(), Reverse(mask))(868-875) vs 1040-1045 - the final
expectedrecompute +Candidate { .. }construction (878-902) vs 1048-1059
Differences that are real, and all expressible as flags/callbacks: copy lanes are filtered to copy_available (769-787), the copy path has no host_ranking and no surplus_table, and its per-lane curve comes from wide_copy_curve rather than powered_curve. Both paths also carry parallel per-slot memo arrays — curves and copy_curves (rounds.rs:747-748) — used at 794/812/857/881 and 934 respectively.
Smaller version: one loop taking lanes: &[usize] (available or copy_available), a curve: impl Fn(&LiveRequest, bool) -> Vec<f64> provider, and surplus: Option<..>/host_ranking: Option<..>; replace curves/copy_curves with a single [Option<Vec<f64>>; REQUEST_LANES] populated by that provider. Net approximately -110 lines, and the two paths can no longer drift on the cohort tie-break — which is the property the new padding-dominance tests and the wide-copy tests both depend on.
Neither loop is wrong today; this is dedup, not a defect. It is the single largest deletable block in the diff.
#8 [high] should fix: sam.rs documents cross-request sharing that production never does; SamConfig is constants in prod
Verified at head 1401971, extends the sam.rs finding.
The SAM module advertises cross-request sharing that does not exist:
- Module doc sam.rs:9-13: "compacts transitions into a flat sorted edge table suitable for zero-copy sharing across requests via
Arc";PromptOutputSAM"pairs anArc<PromptSAM>with a lazy per-request dynamic automaton". - Production builds a fresh, private automaton per request at admission:
sam::PromptOutputSAM::new(&spec.prompt)at helios/src/scheduler.rs:1849-1852. Nothing is shared between requests. PromptOutputSAM::from_shared_prompt(sam.rs:935-947) — the only way to actually share — has no non-test caller: only sam.rs:931 (with_config) and tests at sam.rs:1523/1524/1572.PromptOutputSAM::with_config(sam.rs:929-932) is called only bynew(sam.rs:924-926) withSamConfig::default(). SoSamConfig's four fields (sam.rs:41-61) are constants in production; the only non-defaultSamConfigvalues in the tree are test literals (sam.rs:1340-1344, 1381, 1385, 1395, 1423-1427).- Consequently
PromptOutputSAM::config()(sam.rs:953) andprompt_sam()(sam.rs:949) are test-only accessors.
Smaller version: PromptOutputSAM::new(prompt) calls PromptSAM::build_capped(prompt, DEFAULT_MAX_PROMPT_TOKENS) and reads DEFAULT_MIN_MATCH_LEN / DEFAULT_MAX_OUTPUT_TOKENS / DEFAULT_BOUNDARY_OVERLAP directly. Move SamConfig, with_config, from_shared_prompt, config(), prompt_sam() under #[cfg(test)] so the oracle can still vary thresholds and overlap. Then fix the module doc to say the prompt automaton is per-request today (or keep the wording only if a sharing caller lands with it). The Arc<PromptSAM> may then also collapse to a plain PromptSAM if nothing clones PromptOutputSAM — worth one grep before doing it; I did not confirm clone usage.
Total deletable sam.rs surface after this plus entries #2/#6: ~150 lines of API plus the SamConfig indirection.
#10 [high] Report of 2026-11-26, run 2 — final simplicity verdict at head 1401971
Supersedes/extends entry #5 as the current report. Head 1401971, 25 files, +3965/-119.
Should fix (4):
- refresh.rs:95-99 —
RefreshState::idleis nowpub fn idle(&mut self) {}under a 5-line doc; scheduler.rs:1277-1283 wrapper and server/runtime.rs:1184 still route through it. Delete; several policy tests (policy_tests.rs:2689/2699/2730/2751/5714/5720/5765, 3685) only assert the no-op. - sam.rs — test-only surface: propose_for_context (1070-1110), propose_conditional_continuations (1118-1189, doc claims a 2-deep pipelined consumer that does not exist), MatchSource/source (64-82), PromptSAM::build (283), push_slice (1023), accessor block (462-476, 949-984), and now also SamConfig/with_config/from_shared_prompt/config()/prompt_sam() (41-61, 929-955) — production only calls
new(scheduler.rs:1852) which uses SamConfig::default(). Module doc (sam.rs:9-13) claims zero-copyArcsharing across requests that never happens. ~150 lines + tests. - scheduler.rs:1094-1097
history_proposallost both production callers in this PR (packing.rs:402 and server/runtime.rs:2146 moved torequest_history_proposal); now only tests call it (scheduler/tests.rs×8, phase_tests.rs:583/1835). It is also the prompt-blind bypass the PR is replacing. Delete; re-point the test atrequest_history_proposal. - rounds.rs:755-903 duplicates rounds.rs:925-1060 statement-for-statement (~110 lines) plus the curves/copy_curves twin memo arrays (747-748). One loop with a lane-list argument and a curve provider.
Nits (4): draft_source ladder written 3× (serving.rs:58-63, python.rs:225-233, selection.rs:144-148) though ProposalSource::parse exists; request_copy_match_stats (scheduler.rs:1163-1205) duplicates the arbitration in request_history_proposal_with_match_len (1112-1159) with no test they agree; two 6 match thresholds (speculation.rs:18, sam.rs:22); unreachable else in wide_copy_curve (rounds.rs:545-548).
Rules cited: docs/design-review.md:16 ("Keep Helios as simple as possible"), AGENTS.md:231 (scheduling changes must follow docs/scheduling-runtime-design.md).
Open question for the author: is propose_conditional_continuations the front half of an unlanded PR? Nothing in the tree says.
#11 [high] Research summary
Re-reviewed PR #540 at head 1401971 through the simplicity lens, reading each changed function in its surrounding code and following callers. Four should-fix findings and four nits; no blockers. Full text is scratchpad entry #10 (detail in #1, #2, #4, #6, #7, #8, #9).
Should fix
-
RefreshState::idleis an empty function (helios/src/scheduler/refresh.rs:95-99) carrying a five-line doc comment that describes behaviour it no longer implements — retention is now the absence of mutation.RequestScheduler::idle(scheduler.rs:1277-1283) still validates the queue and calls it, andserver/runtime.rs:1184still calls that. Delete the method and collapse the wrapper; several policy tests only assert the no-op survives. -
sam.rsexports ~150 lines with no production caller:propose_for_context,propose_conditional_continuations(whose doc names a "2-deep pipelined execution" that exists nowhere in the tree),MatchSource/MatchProposal::source,PromptSAM::build,push_slice, the accessor block — and, newly confirmed this pass, the entireSamConfig/with_config/from_shared_promptlayer, since production only callsPromptOutputSAM::newwith defaults. The module doc claims zero-copyArcsharing across requests that never happens; each admission builds a private automaton (scheduler.rs:1849-1852). -
New this pass:
RequestScheduler::history_proposal(scheduler.rs:1094-1097) lost both of its production callers in this PR —packing.rs:402(not opened) andserver/runtime.rs:2146were moved torequest_history_proposal. It is now reachable only from tests, and it is also the prompt-blind lookup path the PR exists to replace, so leaving it public works against the change. Re-point its test at the handle-keyed API and delete it. -
New this pass:
rounds.rs:755-903re-implementsrounds.rs:925-1060statement for statement (~110 lines: prefix ranking, the 3-ordering cohort loop, frontier bookkeeping, the(mask.count_ones(), Reverse(mask))tie-break, theexpectedrecompute andCandidateconstruction), with twin per-slot memo arrays atrounds.rs:747-748. One loop with a lane-list argument and a curve provider removes it.
Nits: the 0/1/2 → Option<ProposalSource> ladder written three times though ProposalSource::parse exists; request_copy_match_stats duplicating the arbitration rule of request_history_proposal_with_match_len with no test they agree; two separate 6-token match thresholds (speculation.rs:18, sam.rs:22) whose equality is what makes the second gate meaningful; and an unreachable non-calibrated branch in wide_copy_curve (rounds.rs:545-548).
One question to settle with the author: whether propose_conditional_continuations is the front half of an unlanded follow-up; if so, naming it converts finding 2 from "delete" to "lands with its consumer".
#12 [high] Cleared at head 1401971 — what I checked and found load-bearing (so the report can scope its "no blocking" claim)
Simplicity lens, head 1401971. Areas I read in context and cleared — every path below has a live non-test caller, so the report should say the rest of the diff reads as load-bearing, not merely unexamined:
cost.rsrefresh arithmetic:observed_compute_duration_ns/timing_refresh_duration_ns(cost.rs:31-40) are used byRefreshState::complete(refresh.rs:74, 77, 84, 87);is_copy_only_step(cost.rs:223-232) has three production callers (scheduler.rs:1207-1209 → server/runtime.rs:1722, scheduler.rs:2507, scheduler.rs:2796);max_mtp_draft_tokens(cost.rs:234) one (rounds.rs:751).- Padding dominance rewrite (policy.rs:133-262): reached from
prune_paddingon the ordinary planning path; no parallel old path left behind — the exact-equality branch was replaced, not duplicated. New tests policy_tests.rs:58-200 exercise it throughs.prune_paddingands.plan(), i.e. real behaviour, not the internals. - Copy-only graph gating: selection.rs:275-299 (
copy_wide) + retained_widths 379-396, catalog.rs:91-131, manifest.rs:840-851, serving.rs:55-64, python.rs:223-233 — each is the only gate on one boundary (wire load, catalog validate, scheduler retain). I found no redundant second gate, only the duplicated decoding recorded as a nit in #4. draft_sourceplumbing through GraphDescriptor (manifest.rs:188-191) is required by cost.rs/serving.rs/selection.rs; not removable.Candidate.expected(policy.rs:86, 1085-1097, 1263-1295, 1465-1480; rounds.rs:722-735, 878-902, 1048-1059): a genuinely second quantity used only bycompare_refresh(policy.rs:1329-1339) — keep.expected_copy_tokens/wide_copy_curve(rounds.rs:541-557) are called from scheduler.rs:2507-2518 on the real magnitude path; only their non-calibrated branch is dead (nit in #9).LiveRequest.sam/copy_calibration(scheduler.rs:265-266): pushed on both commit paths (scheduler.rs:1233, 3016) and read on both proposal paths (1127, 1178) and the rounds loop (rounds.rs:774) — no orphan field.- New SAM tests: the randomized brute-force oracle (sam.rs:1400-1469) and
request_sam_proposes_prompt_continuations_and_isolates_requests(scheduler/tests.rs:1995-2126) do prove behaviour (per-request isolation, output-over-prompt recency, status==3 leaving SAM untouched) — worth keeping even after the API trim; only the two tests keyed topropose_for_context/propose_conditional_continuations(sam.rs:1463, 1491-1514) go with them.
Cleared-but-not-note-worthy: no over-commented blocks beyond refresh.rs:95-99; no #[allow(dead_code)]; no feature flags or env-var fallbacks added.
Rules cited for the report: docs/design-review.md:16 ("Keep Helios as simple as possible"), AGENTS.md:231 (scheduling changes must follow docs/scheduling-runtime-design.md), AGENTS.md:338 (same simplicity principle, cited via entry #5).
#14 [high] Research summary
Verdict: should-fix issues only — two small should-fix, three nits. No blocking issues.
This round reviewed head e5a69669 against docs/design-review.md:16 ("Keep Helios as simple as possible") and AGENTS.md's simplicity rule. The commit deleted most of what the previous review flagged and I verified each deletion landed: RefreshState::idle no longer exists (refresh.rs ends at 99), SamConfig/with_config/from_shared_prompt/propose_for_context/propose_conditional_continuations/MatchSource are gone and the remaining accessors are #[cfg(test)] (sam.rs:420-436, 681, 819-826), the 0/1/2 ladder is now ProposalSource::from_wire/to_wire (speculation.rs), and the duplicated copy-cohort loop is now one factored path (build_host_prefix_ranking rounds.rs:505-527 + select_host_allocated_candidate rounds.rs:764-862, called from both the copy branch at 927-934 and the ordinary host branch at 963-971). What remains:
Should fix
-
helios/src/scheduler.rs:1101-1104—pub fn history_proposal(&self, context, maximum)still has no production caller. Both production call sites were moved to the handle-keyed API in this PR:helios/src/model/packing.rs:405andhelios/src/server/runtime.rs:2146callrequest_history_proposal; onlyscheduler/tests.rs:1956-1991andphase_tests.rs:583,1835still callhistory_proposal. It is also the prompt-blind bypass this PR exists to replace (it goes straight toDecodedHistory::lookup,decoded_history.rs:180-183), so leaving itpubinvites a future caller to reintroduce prompt-blind drafts. Fix: delete the wrapper and move that test's shared-ring assertions ontorequest_history_proposal— the test already admits a live request, so the handle-keyed path is both smaller and the faithful one. -
helios/src/scheduler.rs:1267-1277—RequestScheduler::idleis now a pure validator (if !self.submissions.is_empty() { Err }) under a five-line doc comment describing refresh-credit retention that it does not implement, invoked fromserver/runtime.rs:1184. The retention is now simply the absence of mutation inrefresh.rs:71-99, so the name and the comment both point at behaviour that lives elsewhere. Fix: rename toassert_idle, cut the doc to one line ("no execution may be in flight while the worker waits"), and letdocs/scheduling-runtime-design.mdcarry the retention argument (refresh.rs:95-99abortis the only discard path).
Nits
-
helios/src/scheduler/rounds.rs:920-926—probabilities[slot] = curve.clone()copies the whole per-slot forecast vector once per shape per lane, and the memo arrayscurves/copy_curves(874-875) still exist in parallel although both feed the samebuild_host_prefix_ranking. Smaller version: one[Option<Vec<f64>>; REQUEST_LANES]where the warm-start provider is just the curve source, and pass&[f64](orCow) into the ranking builder instead of cloning. -
helios/src/model/catalog.rs:240-245—select_shape_with_draftsnow has no caller at all:catalog.rs:133validates viaselect_shape_with_source,runtime.rs:2238dispatches viaselect_shape_with_source, andselect_shape(233) goes straight to it. The wrapper exists only to passNone; delete it and letselect_shapecallselect_shape_with_sourcedirectly. -
helios/src/scheduler/speculation.rs:25andhelios/src/scheduler/sam.rs:23— two independent6s for one threshold (WIDE_COPY_MIN_MATCH_LENvsDEFAULT_MIN_MATCH_LEN, used atrounds.rs:905and insidepropose), tied together only by prose. Make rounds.rs referencesam::DEFAULT_MIN_MATCH_LEN, or drop the rounds gate sinceproposealready enforces it.
What I could not finish: I did not re-run the GPU or Rust test suites at this head, and I did not re-read every unmodified hunk of binding.rs, selection.rs, serving.rs and policy.rs this round; my earlier pass cleared those as single-authority gates. The two should-fix items are deletions/renames that need no behavioural test — a one-line confirmation from the author that history_proposal is not an out-of-tree API would settle item 1 the other way.
#15 [high] Report of 2026-11-26, run 4 — final simplicity verdict at head e5a6966
Review of PR #540 (simplicity lens) at head e5a69669, 33 files, +4306/−310.
Verdict: should-fix issues only. No blocking findings. Standard applied: docs/design-review.md:16 "Keep Helios as simple as possible"; AGENTS.md simplicity rule (cited in earlier entries #5/#13 as AGENTS.md:338).
Verified as landed (so the report can credit the cleanup and not re-flag it)
The e5a69669 commit removed nearly everything the previous pass flagged, and I checked each by search:
RefreshState::idledeleted —helios/src/scheduler/refresh.rsends at line 99 withabort(); nopub fn idle(&mut self) {}remains.sam.rstrimmed:SamConfig,with_config,from_shared_prompt,propose_for_context,propose_conditional_continuations,MatchSource/source,PromptSAM::build,push_sliceare all gone; surviving accessors are#[cfg(test)](sam.rs:420-436state_count/transition_count/memory_bytes on PromptSAM,sam.rs:681Lct memory_bytes,sam.rs:819-826OutputSAM,sam.rs:887PromptOutputSAM::state_count,sam.rs:173MutableEdges::heap_bytes). Module doc no longer claims Arc sharing (sam.rs:7-17).ProposalSource::from_wire/to_wireadded (speculation.rs) and used byruntime_core/serving.rs,heliopause/src/python.rs:225-228,runtime_core/selection.rs:144-149— the three-way 0/1/2 ladder is gone.- The duplicated copy-cohort loop is gone:
rounds.rsnow has onebuild_host_prefix_ranking(505-527) and oneselect_host_allocated_candidate(764-862), called from the copy branch (927-934, insidepacked_round_candidatesat 864) and the ordinary non-GPU host branch (963-971). Net −~110 lines vs the previous head. - Unreachable
wide_copy_curvefallback replaced byexpect("wide copy requires history drafts enabled before admission")(rounds.rs:570-579) — nit from previous report resolved.
Should fix
-
helios/src/scheduler.rs:1101-1104—pub fn history_proposal(&self, context: &[u32], maximum: usize)has no production caller. Both production call sites were moved off it in this PR:helios/src/model/packing.rs:405(scheduler.request_history_proposal() andhelios/src/server/runtime.rs:2146(self.scheduler.request_history_proposal(). Remaining callers are tests only:helios/src/scheduler/tests.rs:1956, 1970, 1972, 1973, 1974, 1979, 1985, 1991, 2069andhelios/src/server/runtime/phase_tests.rs:583, 1835. It is also the prompt-blind bypass the PR exists to replace — it ignoresLiveRequest.samentirely and goes straight toDecodedHistory::lookup(decoded_history.rs:180-183). Leaving itpublets a future caller silently reintroduce prompt-blind drafts. Fix: delete the wrapper; move the shared-ring assertions ontorequest_history_proposal(the test already admits a live requesta/h, so the handle-keyed path is both smaller and faithful). KeepDecodedHistory::lookupaspub(crate)for the ring's own oracle test (decoded_history.rs:199-297). -
helios/src/scheduler.rs:1267-1277—RequestScheduler::idleis now a pure validator carrying a 5-line doc comment about refresh credit it does not implement. Body is onlyif !self.submissions.is_empty() { return Err("idle requires no submitted execution") } Ok(()). Called fromhelios/src/server/runtime.rs:1184. Credit retention is now just the absence of mutation (refresh.rs:71-99;abortat 95-99 is the only discard). Fix: rename toassert_idle, cut the doc to one line, and leave the retention argument todocs/scheduling-runtime-design.md/docs/scheduling-theory.md(which the PR already updated). Tests that calls.idle().unwrap()then assert credit unchanged (policy_tests.rs:2612, 2640, 2691, 2701, 2732, 2753, 6102, 6108, 6153) still work after the rename; the only meaningful one ispolicy_tests.rs:2628(assert!(s.idle().is_err())).
Nits
-
helios/src/scheduler/rounds.rs:920-926— the copy branch doeslet curve = copy_curves[slot].get_or_insert_with(...); probabilities[slot] = curve.clone();i.e. a full per-slot forecast vector clone for every shape×lane, andcurves/copy_curves(874-875) are still two parallel memo arrays feeding the samebuild_host_prefix_ranking. Smaller: one memo array plus a curve-source parameter, and pass&[f64]into the ranking builder instead of cloning.build_host_prefix_rankingtakesmut probabilities: Vec<Vec<f64>>andresizes it (509, 525), so slices would need a small signature change. -
helios/src/model/catalog.rs:240-245—select_shape_with_draftsnow has no caller:catalog.rs:133validates withselect_shape_with_source,runtime.rs:2238dispatches withselect_shape_with_source, andselect_shape(233-238) forwards toselect_shape_with_draftsonly to passNone. Delete the wrapper and haveselect_shapecallselect_shape_with_source(..., None, mode)directly. -
helios/src/scheduler/speculation.rs:25vshelios/src/scheduler/sam.rs:23— two independent6s for one threshold:WIDE_COPY_MIN_MATCH_LENgates copy lanes atrounds.rs:905andDEFAULT_MIN_MATCH_LENgates insidepropose(sam.rs:1055 even assertsDEFAULT_MIN_MATCH_LEN == 6); related only by prose (speculation.rs:22-24 says "Matches sam::DEFAULT_MIN_MATCH_LEN"). Have rounds.rs referencesam::DEFAULT_MIN_MATCH_LEN, or drop the rounds gate sinceproposealready enforces it.
Cleared this pass (read in context, live production callers)
cost.rscanonical_draft_source(50-59) used byKey::from_step(81),prepared(170),exact_duration(292),fresh_duration(313),Candidate::cost_key(policy.rs ~97-104), andpolicy.rs:1074— one authority, not duplicated.cost.rspacked_round_durations: [[Vec<Option<u64>>; 7]; 2]split per source (139) withhas_mtpscan removed;packed_round_duration_for(223-235) has add'l callers at rounds.rs:588 and policy.rs:785 viapacked_round_duration(237-251), whose(None, Some(0))arm guards the all-unmeasured case.is_copy_only_stepmoved toscheduler.rs:1196-1199(source fromstep.draft_source); production callersscheduler.rs:2502, 2790→server/runtime.rs:1722.resolve_copy_match/clamp_copy_capacity(scheduler.rs:1106-1149) — the previous "two arbitrations" nit is resolved:request_history_proposal_with_match_len(1164-1179) andrequest_copy_match_stats(1183-1194) now share one arbitration, differing only in whether the padded vector is built.bind/serving/selectionfrom_wireunification;binding.rs:201-216derivesdraft_source(0|1|"MTP" → MTP, 2|"COPY_DRAFT" → COPY_DRAFT, else invalid) and rejects COPY_DRAFT on non-speculative — matchesignition/preparation/execution.py:102-104after thekind != "speculative"tightening.BoundGraph::matches_step(packing.rs:40-53) replaced two identical inline closures (302, 386) — a dedup, not a new path.catalog.rs:247-307select_shape_with_sourcegatesdraft_sourceonly forGraphKind::Speculative(296-299), harmless for other kinds.
Could not verify / limits
- Did not run the Rust or GPU suites at this head; the two should-fix items are deletion/rename and need no behavioural test.
- Did not re-read the untouched interior of
binding.rs,selection.rs,serving.rs,policy.rsthis round (cleared in an earlier pass, entry #12). - Open question: if
history_proposalis intended as a stable out-of-tree API, a one-line reply settles item 1 the other way.
#4 [medium] nit: two duplicated mappings/arbitrations worth collapsing
Two duplicate-logic items seen in the diff but not written up in detail before the time limit:
-
nit — draft_source decoding is written four times with the same
0 => None, 1 => Mtp, 2 => Copy, _ => errorladder, each with its own error text:- helios/src/runtime_core/serving.rs:55-64 (
invalid("unknown graph draft source")) - heliopause/src/python.rs:223-232 (
PyValueError::new_err("unsupported graph draft_source"), plus a default-to-Mtp rule when the key is absent, which the other three do not have) - helios/src/execution/manifest.rs:841-850 (validation: copy ⇒ confidence_width == 0)
- helios/src/runtime_core/selection.rs:144-148 + 166-190 (same ladder again for the
speculative_proposal_sourceconfig string, now needed in two scopes because thesourcebinding moved above themaximumcomputation) Smaller version: oneProposalSource::from_wire(u32) -> Result<Option<ProposalSource>>with the absent-key default handled at the one place that needs it (python.rs), likeGraphKind::try_fromis already used. That is one conversion and one error message instead of four.
- helios/src/runtime_core/serving.rs:55-64 (
-
nit — helios/src/scheduler.rs:1163-1205
request_copy_match_statsduplicates the arbitration rule ofrequest_history_proposal_with_match_len(1112-1159): both clampmaximumthe same way, bothreturn (0/[-1], 0)whendecoded_history.is_none(), both truncate the SAM proposal at the first out-of-vocabulary token, and both implement "prefer shared history only whenshared_match > sam.match_len". The two differ only in whether a padded upload vector is built. Smaller version: keeprequest_copy_match_statsas the primitive returning(count, match_len)and haverequest_history_proposal_with_match_lenbuild the padded vector from the winning source (it needs the tokens anyway, andproposeis O(1) amortized). One copy of the tie-break rule, so the invariant the PR description states ("shared ring wins only on a strictly longer match") cannot drift between the packing path and the scheduling path — today they agree, but nothing tests that they do.
Neither is blocking. Both are worth mentioning as deletions, since each removes a parallel path that must otherwise be kept in sync.
#9 [medium] nit: two 6-token match thresholds and a dead wide_copy_curve fallback
Verified at head 1401971. Two small leftovers in the new wide-copy path.
-
nit — two constants for one threshold.
speculation::WIDE_COPY_MIN_MATCH_LEN = 6(helios/src/scheduler/speculation.rs:18) gates wide copy eligibility at rounds.rs:776 (if match_len < speculation::WIDE_COPY_MIN_MATCH_LEN ... continue), whilesam::DEFAULT_MIN_MATCH_LEN = 6(helios/src/scheduler/sam.rs:22, viaSamConfig::default(), sam.rs:56) is the threshold insidepropose, so a proposal never reportsmatch_lenbelow it. The second gate is only meaningful because the two are equal by coincidence; sam.rs:1287 even assertsDEFAULT_MIN_MATCH_LEN == 6. Raise the SAM default to 8 and the rounds gate becomes subsumed; lower it to 4 and the rounds gate does all the work. One constant (or rounds.rs referring toDEFAULT_MIN_MATCH_LEN) removes the coincidence; today nothing states the relationship in a comment. -
nit — unreachable fallback arm.
wide_copy_curve(helios/src/scheduler/rounds.rs:541-553) has anelsearm producing a raw geometric prior whenrequest.copy_calibrationisNone.copy_calibrationanddecoded_historyare both created from the same condition at admission (helios/src/scheduler.rs:1849-1856:.decoded_history.is_some().then(...)twice), and the copy-only block requiresself.decoded_history.is_some()(rounds.rs:759) before any curve is taken, socopy_calibrationis alwaysSomeon that path — andexpected_copy_tokens(rounds.rs:555) is only called underis_copy_only_step(scheduler.rs:2507-2518), for graphs the loader only retains with--history-drafts(runtime_core/selection.rs:184retain_wide_copy). A 3-lineexpect/unwrap(or taking&CopyCalibrationas the argument) says the same thing without an unreachable branch. Note: only tests construct schedulers with copy graphs and no history, so this is inference from the constructors, not something a test currently contradicts.
Both are small; listed as nits, not asked to block.