#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).
#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.