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