#1 [high] Should fix: sam.rs propose_conditional_continuations + test are unused
helios/src/scheduler/sam.rs:1112-1189 pub fn propose_conditional_continuations (78 lines incl. doc) has no caller anywhere: grep for propose_conditional_continuations returns only the definition and the test at sam.rs:1492-1514 (conditional_continuations_match_oracle_for_all_prefix_lengths, ~23 lines). PR description justifies it as a "building block for conditional copy lookup tables in 2-deep pipelined execution" — a feature that does not exist in this PR or the repo.
Removal: delete sam.rs:1112-1189 and the test 1492-1514. ~100 lines saved, no behaviour lost. Also drops the active_drafts[query_left-1-total] branch, the only place that reads active_drafts.
#2 [high] Should fix: Candidate.expected duplicates Candidate.rate (ValueRate already stores expected value)
helios/src/scheduler/utility.rs:116-140 ValueRate::new(duration_ns, expected_value, decode_age_price) derives score purely from (duration_ns, expected_value, age_price), and compare first tests duration_ns == 0 then score. Candidate (helios/src/scheduler/policy.rs:86-95) already carries duration_ns: u64 and rate: ValueRate. So the PR's new expected: f64 field (policy.rs:89) is recomputable from existing fields, and every place that maintains a second accumulator for it is duplication:
- helios/src/scheduler/rounds.rs:966
base_zeroarray, 997-998pending_value_zeroin the tuple, 1002 accumulate, 1038pending_value_zero + effective_draft, 1013(total, 0.0), 1040-1044/1048-1054 the secondexpectedrecomputation. - helios/src/scheduler/policy.rs:1218-1231
refresh_expectedduplicate sum, 1244, 1281-1285compare_by+compare_refreshduplication, 1413-1426refresh_expectedrecomputation. - helios/src/scheduler/rounds.rs:725-726
expectedsum for fixed round candidates.
Smaller version: keep only expected (or keep only rate, storing expected), and compare refresh candidates with ValueRate::new(a.duration_ns, a.expected, age_price). Candidate.rate becomes unnecessary (all reads: policy.rs compare and ordinary.rate.duration_ns, which equals candidate.duration_ns). Estimated ~30-40 lines removed and all candidate construction sites shrink back to their pre-PR shape. Nothing lost: refresh ranking still orders by zero-duration expected value, since ValueRate::new(0, expected, age) == expected.
#3 [high] Should fix: request_history_proposal_with_match_len and request_copy_match_stats duplicate the same matching logic
helios/src/scheduler.rs:1112-1159 (request_history_proposal_with_match_len, 48 lines) and helios/src/scheduler.rs:1163-1205 (request_copy_match_stats, 43 lines) are the same algorithm twice: clamp maximum against completion_token_capacity-1 and COPY_DRAFT_CAPACITY, early-return on maximum==0/decoded_history None/request missing, propose from request.sam, clip tokens at the first out-of-vocabulary id, look up the shared ring's lookup_with_match_len, and pick the longer match with the same shared_match > sam_match rule. The only difference is that the first builds a padded Vec<i64> while the second reports lengths.
Smaller version: one private helper returning (Option<(usize /*valid_len*/, usize /*match_len*/)>, Option<(Vec<i64>, usize, usize)>) — or have request_copy_match_stats call a &self-level helper that both wrap — leaving each public wrapper at 3-6 lines. ~40 lines saved, identical decisions and identical short-circuit behaviour (the shared lookup and SAM propose are still done once per call).
Callers: helios/src/model/packing.rs:402, helios/src/server/runtime.rs:2146, helios/src/scheduler/rounds.rs:775.
#9 [high] Size accounting and total removable estimate
Counting the change: 25 files, +3965/−119. Test-only additions: model/tests.rs +324, policy_tests.rs +501, scheduler/tests.rs +583, plus ~30 lines of draft_source: field churn across execution/tests.rs, model/testing.rs, checkpoints.rs, speculative_lifecycle_tests.rs, phase_tests.rs, cost.rs tests. Production additions include sam.rs (1606 new lines, of which ~370 are tests/benchmark), rounds.rs +194, policy.rs +119, selection.rs +109, scheduler.rs +180, cost.rs +120, speculation.rs +103.
Estimated removable total from scratchpad entries:
- propose_conditional_continuations + its test: ~100
- Candidate.expected / duplicate accumulators / compare_by: ~35
- request_history_proposal_with_match_len vs request_copy_match_stats: ~40
- RefreshState::idle + idle assertions: ~20
- sam.rs unused public surface: ~80
- rounds.rs copy-only block vs ordinary loop: ~100
- overlapping end-to-end tests / scaffold: ~250
- nits bundle: ~60 Rough total ~685 lines (~17% of the change), none of it behaviour.
The change is NOT minimal: sam.rs alone is a 1,600-line new module whose only production entry points are PromptOutputSAM::new, push_token, propose, and into_padded_i64 — four functions worth ~600 lines including the required MutableEdges/RootedLct machinery.
#10 [high] Research summary
I reviewed all 25 changed files under the subtraction lens: the new helios/src/scheduler/sam.rs (1,606 lines) in full, and the diffs plus surrounding code for scheduler.rs, rounds.rs, policy.rs, cost.rs, refresh.rs, speculation.rs, decoded_history.rs, selection.rs, serving.rs, manifest.rs, catalog.rs, packing.rs, the four test files, docs, ignition/preparation/execution.py and heliopause/src/python.rs. Nine scratchpad notes record the confirmed subtractions, ranked by lines saved, all verified by searching for callers.
Largest: propose_conditional_continuations (sam.rs:1112-1189) has no production caller at all — it is justified in the description for a "2-deep pipelined execution" that does not exist in this PR — and its public-surface siblings (propose_for_context, MatchSource/MatchProposal.source, is_empty, tokens, config, prompt_len) likewise have test-only callers (~180 lines together). rounds.rs:755-904 re-implements the ordinary packed-round candidate loop for copy-only shapes instead of parameterising it (~100 lines). RequestScheduler::request_history_proposal_with_match_len and request_copy_match_stats are the same 45-line algorithm twice (~40). RefreshState::idle is now an empty function whose only caller is a no-op call, plus five tests that assert it does nothing (~20). The new Candidate.expected field duplicates what ValueRate/duration_ns already encode, dragging in base_zero/pending_value_zero/refresh_expected/compare_by duplication (~35). Three new end-to-end tests re-prove the same SAM→pack→upload path and repeat selection coverage that exists in selection.rs (~250 test lines). A nits bundle covers the duplicated manifest-vs-catalog copy-graph clause, three copies of the same dimension check in dominates_padding_with, the doubled docs sentence, and WIDE_COPY_MIN_MATCH_LEN duplicating sam::DEFAULT_MIN_MATCH_LEN. Total roughly 685 lines of the +3,965, with no behaviour lost.
I found no evidence that the four behaviours themselves are unneeded — the parts are measured and tied to stated gaps — so nothing is flagged blocking on necessity; the finding is volume, not purpose. Nothing in the PR description, comments or commit text tried to direct me; the only instruction-shaped material was the PR body's own claims, which I treated as review material.
#12 [high] Additions verified this turn: history_proposal/lookup left production-dead, sam accessors, unreachable wide-copy curve fallback, stale docs
Re-verified at head 14019718. Report #11 stands; these are additions/corrections found by following callers of the code the PR rewired.
-
RequestScheduler::history_proposal(helios/src/scheduler.rs:1094-1097) is now production-dead. Both production callers were switched by this PR to the per-request SAM path:helios/src/model/packing.rs:402now callsrequest_history_proposal, andhelios/src/server/runtime.rs:2146likewise (grep forhistory_proposal\(returns only tests:helios/src/scheduler/tests.rs:1956,1970-1991,2069,helios/src/server/runtime/phase_tests.rs:583,1835). Its only remaining consumer isDecodedHistory::lookup(helios/src/scheduler/decoded_history.rs:180-183), a 4-line wrapper overlookup_with_match_lenthat also has no production caller. Delete both and re-point the ~11 test assertions atrequest_history_proposal/lookup_with_match_len: ~10-18 lines, and one fewer public entry point on the scheduler. (Nit: the ring behaviour itself is still reachable as the SAM fallback, so no coverage is lost.) -
LiveRequest::sam()(helios/src/scheduler.rs:383-385),PromptOutputSAM::output_len()(helios/src/scheduler/sam.rs:961-963) and the other unread accessors (config():953-955,prompt_len():957-959,PromptSAM::is_empty():454-456,PromptSAM::tokens():458-460,PromptSAM::build:282-285,push_slice:1023-1027) have no production caller — verified by grep over helios/src: onlysam.rstests,scheduler/tests.rs:2102,2125. Fold into note #5; this raises that group from ~80 to ~95 lines.SamConfig+with_config/from_shared_prompt(~25 lines, sam.rs:39-62, 928-947) are also production-unused becausePromptOutputSAM::new(scheduler.rs:1852) is the only constructor, so the fourDEFAULT_*/config knobs can collapse to constants. -
rounds.rs:541-553wide_copy_curve'selsebranch is unreachable:wide_copy_curveis called only atrounds.rs:795, inside the copy-shape branch guarded byself.decoded_history.is_none() → continue(rounds.rs:759), andrequest.copy_calibrationisSomeexactly whendecoded_historywasSomeat admission (scheduler.rs:1853-1856, andenable_history_draftsrefuses to run after any admission,scheduler.rs:1086-1092). The body becomescalibration.curve(...).map(|p| p.powf(alpha)).collect(): ~8 lines. -
Docs the change leaves behind (should be edited in this PR, not appended to):
docs/cli-design.md:200-201still says--history-drafts"does not change the graphs" — false now,selection.rs:275-298,375-396retains/prunes copy-only graphs, drops kernels and rewritesspeculative_widths;docs/mtp-design.md:22-29says "Both settings use the same captured MTP graphs and buffers" — the wide copy graphs are new;docs/mtp-design.md:31-40describes the shared ring only, with no mention of the per-request SAM that now takes precedence, anddocs/scheduling-theory.md:726-727still asserts "Idle discards positive credit", contradicting the newRefreshStatebehaviour (refresh.rs:95-105) and the editeddocs/scheduling-runtime-design.md. Each is a one-sentence replacement; the subtraction is the stale claim.
Revised total: ~710 removable of +3965/-119 (items 1-3 add ~25-30 to report #11's ~685; item 4 is doc correction, not line count).
Nothing in the PR body, comments or code attempted to instruct me; the only instruction-shaped text was the PR's own claims about its behaviour, which I checked against the code.
#13 [high] Report of 2026-11-26 (rev 2), run 1232 — revised to ~710 removable lines
Verdict: make it smaller first. The four behaviours are argued and measured; the volume is not. The change: 25 files, +3965 / −119. Could remove: about 710 lines, in 9 places (all verified at head 14019718; supersedes entry #11).
Ranked by lines saved:
-
Should fix — ~250 test lines.
helios/src/model/tests.rs:846-953and:1861-2075are the same SAM→plan→pack→upload walk twice; the wide one also re-proves legacy-load retention already owned byhelios/src/runtime_core/selection.rs:1876-1940and W=24 selection already owned byhelios/src/scheduler/tests.rs:4107-4340.helios/src/scheduler/tests.rs:1994-2126re-provessam.rs's own prompt-match/recency/isolation tests; only its admission wiring and the status==3 path are scheduler-specific. Keep the wide test plus three folded assertions, keep selection.rs, trim 1994-2126 to admission. Every fibre stays covered once. -
Should fix — ~100 lines.
helios/src/scheduler/rounds.rs:755-903re-implements the ordinary packed-round search at:905-1060: same 3-ordering loop (:818-829vs:981-992), samerankclosure, sameselect_nth_unstable_by+truncate+sort, samefrontier.clear(),mask/host_lengths/lane_terms/best-tracking (:840-876vs:993-1046). Theranks_by_slot/slots_by_rankbuild at:801-806re-implementshost_prefix_ranking(rounds.rs:492-513). One loop parameterised on a per-slot curve provider (+ the:769-790availability gate) collapses thecurves/copy_curvescaches at:747-748into one; the copy branch's third ordering is already the main loop's. -
Should fix — ~100 lines.
helios/src/scheduler/sam.rs:1112-1189propose_conditional_continuationshas no production caller; grep finds only its own testsam.rs:1491-1514. Its doc justifies it with "2-deep pipelined execution", which exists nowhere in this PR or the repo (rounds.rsplans one round at a time). Delete both. -
Should fix — ~95 lines. Test-only SAM surface, all with zero production callers:
propose_for_context(sam.rs:1068-1110+ the 8-line block at:1459-1466),MatchSource+MatchProposal.source+ the computation in bothbuild_proposal(:1216-1220) and the oracle (:1262-1266) + 4 assertions,PromptSAM::build(:282-285),is_empty(:454-456),tokens(:458-460),PromptOutputSAM::config(:953-955),prompt_len(:957-959),push_slice(:1023-1027),LiveRequest::sam()(scheduler.rs:383-385) andoutput_len(sam.rs:961-963) which exist only forscheduler/tests.rs:2102,2125.SamConfig/with_config/from_shared_prompt(sam.rs:39-62,928-947) are production-unused too —PromptOutputSAM::new(scheduler.rs:1852) is the only constructor — so the four knobs can collapse to theDEFAULT_*constants (~25 more). Keep the#[ignore]microbenchmark accessors. -
Should fix — ~40 lines.
helios/src/scheduler.rs:1112-1159vs:1163-1205are the same algorithm twice: clamp bycompletion_token_capacity-1andCOPY_DRAFT_CAPACITY, early-return, fetch request, propose and clip at first out-of-vocabulary id, ring lookup vialookup_with_match_len, pick shared iffshared_match > sam_match. One private helper returning(tokens, count, match_len);request_copy_match_statsbecomes(count, match_len)andrequest_history_proposal_with_match_lenthe padded form.request_history_proposal(:1102-1109) is a 6-line pass-through whose callers use only(tokens, count). -
Should fix — ~35 lines.
Candidate.expected(policy.rs:89) is recomputable fromduration_ns+ValueRate(utility.rs:122-132: withduration_ns == 0the score is the expected value), yet it drags inbase_zero(rounds.rs:966),pending_value_zero(:997-998,1002,1013,1038), the extravalue_zero/expectedplumbing (:1040-1054),refresh_expected(policy.rs:1224-1245),:1471-1479, and thecompare_by/compare_refreshsplit (policy.rs:1313-1338). Keep eitherrateorexpected, not both. -
Should fix — ~20 lines.
RefreshState::idle(refresh.rs:95-99) is now{}and its only caller (scheduler.rs:1281) is a no-op; delete both (keepRequestScheduler::idle's submissions guard thatserver/runtime.rs:1184uses), plus the idle-does-nothing assertions atpolicy_tests.rs:2610-2611,2638-2639,2689-2700,2730,2751,3685-3687.abort()keeps the clamp logic. -
Should fix — ~18 lines. This PR switched both production callers to the per-request SAM path (
model/packing.rs:402,server/runtime.rs:2146), leavingRequestScheduler::history_proposal(scheduler.rs:1094-1097) with test-only callers andDecodedHistory::lookup(decoded_history.rs:180-183, a 4-line wrapper overlookup_with_match_len) with none. Delete both; re-point the ~11 assertions (scheduler/tests.rs:1956-1991,2069,server/runtime/phase_tests.rs:583,1835) atrequest_history_proposal/lookup_with_match_len. -
Nit — ~55 lines.
manifest.rs:844-846's copy-graph clause is subsumed bycatalog.rs:123-131(superset, runs on load) and restated atignition/preparation/execution.py:102-108.rounds.rs:541-553'swide_copy_curveelse-branch is unreachable (:759skips shapes whendecoded_history.is_none(), andcopy_calibrationisSomeexactly then —scheduler.rs:1853-1856,1086-1092), so the body is onemap: 8 lines.policy.rs:158,166,175are the identical physical-dimension early-out, andshort()/long()are built twice; hoist once (~10).prune_padding's new second pass (policy.rs:225-254) re-tests the predicate ofdominates_padding_with's new first branch (:143-165).WIDE_COPY_MIN_MATCH_LEN(speculation.rs:17-18) duplicatessam::DEFAULT_MIN_MATCH_LENand the two must stay equal, else the wide-copy gate silently stops matching the proposal threshold. Doc sentence "idle retains earned credit" appears twice.
Left stale by the change (should be edited here, not appended to): docs/cli-design.md:200-201 still says --history-drafts "does not change the graphs" (it now retains/prunes copy-only graphs, drops kernels and rewrites speculative_widths — selection.rs:275-298,375-396); docs/mtp-design.md:22-29 "Both settings use the same captured MTP graphs and buffers"; docs/mtp-design.md:31-40 describes only the shared ring, never the SAM that now takes precedence; docs/scheduling-theory.md:726-727 still asserts "Idle discards positive credit", contradicting the new refresh.rs:95-105 and the edited docs/scheduling-runtime-design.md.
Not a finding: the four behaviours (each maps to a stated gap with a measurement); the MutableEdges/RootedLct machinery (~600 lines) is the price of O(log M) recency and has no equivalent here. Nothing in the PR, comments or code tried to direct the review.
#14 [high] Research summary
Reviewed PR #540 at head 14019718 under the subtraction lens: all 25 changed files, every changed function in surrounding code, and the callers of the paths it rewires. Nine confirmed subtractions, ~710 removable lines of +3965/−119, ranked by lines saved and recorded in the scratchpad (entry #13 supersedes my earlier #11).
Largest: rounds.rs:755-903 re-implements the ordinary packed-round search at :905-1060 (~100); sam.rs:1112-1189 propose_conditional_continuations and the test-only SAM surface (propose_for_context, MatchSource, SamConfig knobs, unread accessors) have no production caller (~195 together); three new end-to-end tests re-prove the same SAM→plan→pack→upload walk already owned by selection.rs and sam.rs (~250); scheduler.rs:1112-1205 is the same match algorithm twice (~40); Candidate.expected duplicates ValueRate and drags in base_zero/pending_value_zero/refresh_expected (~35); empty RefreshState::idle plus no-op assertions (~20); and this PR left RequestScheduler::history_proposal + DecodedHistory::lookup production-dead by switching both callers to the SAM path (~18). Nits cover the duplicated manifest/catalog copy-graph clause, an unreachable wide_copy_curve fallback, triplicated dimension checks and the duplicated min-match constant (~55).
I also recorded four docs the change contradicts (docs/cli-design.md:200-201, docs/mtp-design.md:22-29 and :31-40, docs/scheduling-theory.md:726-727) as places to edit rather than extend. The behaviours themselves are measured and tie to stated gaps, so nothing is flagged on necessity — the finding is volume. No text in the PR or its comments tried to direct my review.
#4 [medium] Should fix: RefreshState::idle is now an empty function with one no-op caller
helios/src/scheduler/refresh.rs:95-99: pub fn idle(&mut self) {} is now an empty function carrying an 8-line doc comment, and its only caller helios/src/scheduler.rs:1281 (self.refresh.idle();) is now a no-op. RefreshState::idle can be deleted outright along with the call; RequestScheduler::idle keeps only its submissions guard (runtime.rs:1184 relies on that). ~10 lines in refresh.rs + 1 in scheduler.rs.
Follow-on test churn that becomes noise: policy_tests.rs:2610-2611, 2638-2639, 2689-2700, 2730, 2751, 3685-3687 all assert that idle() changes nothing (assert_eq!(s.refresh_credit_ns(), retained) style, ~8 assertion lines across 5 tests). Once idle is gone those assertions delete with it. Total ~20 lines.
Note: abort() at refresh.rs:101-105 now holds the only copy of credit_ns.min(0.0) / acceptance_credit_ns.min(0.0), so nothing else is lost.
#5 [medium] Should fix: sam.rs public surface with zero production callers (~80 lines)
In helios/src/scheduler/sam.rs the following public API has no production caller outside sam.rs's own tests/microbenchmark (verified with search over helios):
PromptOutputSAM::propose_for_context(:1070-1110, 41 lines) — one test caller (:1463). Production path ispropose(scheduler.rs:1128) only. Delete fn + thepropose_for_contextblock inexact_oracle_equivalence_randomized_streams_and_repetitions(:1459-1466, 8 lines).MatchSourceenum (:64-69) +MatchProposal.source(:80-81) + thesourcecomputation inbuild_proposal(:1216-1220) — read only by tests (:1301,1309,1321,1336). Delete enum, field, computation, and 4 test assertions: ~14 lines.PromptSAM::is_empty(:454),tokens(:458),PromptOutputSAM::config(:953),prompt_len(:957),PromptOutputSAM::state_count(:970) — zero callers.dynamic_memory_bytes/memory_bytes/state_count/transition_counton PromptSAM are used only by the#[ignore]microbenchmark; if the benchmark stays, keep those two implementors, otherwise ~40 more lines go. Safe deletion here: ~15 lines.SamConfigfieldsmax_prompt_tokens/max_output_tokens/boundary_overlapare never set to anything but the DEFAULT_* constants in production (onlyPromptOutputSAM::new, scheduler.rs:1852);with_config/from_shared_promptare test-only. Replacing SamConfig with the three constants plus#[cfg(test)]overrides would remove the public config surface (~25 lines) — larger edit, lower confidence, so a nit.
Total safe: ~80 lines.
#6 [medium] Should fix: rounds.rs copy-only candidate block duplicates the ordinary packed-round search (~100 lines)
helios/src/scheduler/rounds.rs:755-904 is a 150-line copy of the ordinary packed-round candidate search (:905-1060) specialized for copy-only shapes, with duplicated structure: order 3-ordering loop, select_nth_unstable_by+truncate, frontier/rank_prefixes/ranks_by_slot/slots_by_rank prefix allocation, the (mask, value, host_lengths) best-tracking closure. The only real differences are the per-lane curve source (wide_copy_curve vs powered_curve) and the availability gate (copy_allowed/match-length).
Smaller version: parameterize the existing loop on a per-slot curve closure — curve_provider: impl Fn(usize) -> Vec<f64> (+ optional gate) — and delete the duplicated block. The two curves[..]/copy_curves[..] caches collapse into one [Option<Vec<f64>>; REQUEST_LANES]. Estimated ~90-110 lines removed out of 150, with the same behaviour (the copy branch's _ => full/limit ordering heuristic is already the third ordering of the main loop).
Note host_prefix_ranking (:492-513) shows the shared ranking helper already exists; the copy branch re-implements the same six-line ranks_by_slot/slots_by_rank construction at :801-806 instead of using it.
#7 [medium] Should fix: three new end-to-end tests re-prove the same SAM→pack path (~250 test lines)
New tests added by this PR, checked for overlap with existing coverage:
- helios/src/model/tests.rs:846-953
history_draft_packing_forwards_per_request_prompt_sam_continuations(108 lines) and helios/src/model/tests.rs:1861-2075wide_copy_verify_catalog_packs_23_sam_tokens_and_preserves_legacy_w8_cores(215 lines) both: build a scheduler with history drafts, run Init→Prefill to Decode emitting a token that completes a 6+ token suffix, plan a speculative step, pack inputs, and assert oncopy_token_ids/copy_token_countuploads. The wide test also repeats the "legacy W=8 core loads" assertion already covered by runtime_core/selection.rs:1876-1940wide_copy_graphs_retain_only_when_history_drafts_enabled. Consolidating to one packing test plus the selection test, and dropping the plan-selection duplicated with scheduler/tests.rs:4108+, saves ~200 lines of test scaffolding with the same coverage (same fibres: prompt SAM → pack → upload, wide-graph retention, W=24 selection). - helios/src/scheduler/tests.rs:1995-2127 (132 lines)
request_sam_proposes_prompt_continuations_and_isolates_requestslargely re-proves sam.rs's ownprompt_only_match_succeeds_with_zero_prior_output+output_overrides_prompt_recency_on_tie+shared_prompt_sam_isolates_per_request_outputs_and_bounds_statesat the scheduler level; the only scheduler-specific parts are the admission/enable_history_drafts wiring and the status==3 path (~30 lines). Trim to those. Estimated total test-side saving: ~250-300 lines of the PR's +1408 test lines.
#15 [medium] Index note: entry #13 is the authoritative final report; #11 is superseded
Use entry #13 as the report. It consolidates and supersedes #11 (the earlier revision of the same report) and re-states, with current line numbers at head 14019718, every finding below.
Mapping of supporting notes:
- #13 finding 1 (~250 test lines) → note #7 (overlapping end-to-end copy tests) plus the selection.rs coverage argument in #11 §1.
- #13 finding 2 (~100, rounds.rs copy loop) → note #6.
- #13 finding 3 (~100, propose_conditional_continuations) → note #1.
- #13 finding 4 (~95, test-only SAM surface incl. SamConfig knobs and LiveRequest::sam()/output_len) → notes #5 and #12 item 2; #5 is the older, smaller estimate (~80).
- #13 finding 5 (~40, scheduler.rs doubled match algorithm) → note #3.
- #13 finding 6 (~35, Candidate.expected) → note #2. Note that the PR's own automated review (pr comment at 17:56) argues against dropping
Candidate.expected("it is a real second quantity"); #13 therefore keeps it and instead dropsrate/the duplicate accumulators — whichever of the two fields goes, the accumulator plumbing is what the ~35 lines are. - #13 finding 7 (~20, empty RefreshState::idle) → note #4.
- #13 finding 8 (~18, history_proposal + DecodedHistory::lookup left production-dead) → note #12 item 1. This is the one finding new since #11.
- #13 finding 9 (~55, nits bundle) → note #8 plus #12 items 2-3 (unreachable wide_copy_curve else-branch, SAM config knobs).
- Size accounting (+3965/−119 across 25 files; test-only additions model/tests.rs +324, policy_tests.rs +501, scheduler/tests.rs +583; sam.rs +1606 of which ~370 tests/benchmark) → note #9.
- Docs the change contradicts → note #12 item 4 and #13's closing paragraph.
- Methods/scope (which files read in full, that caller greps were run, that nothing in the PR tried to direct the review) → note #10.
Also worth carrying into the report: the repository's own automated review (flare-autobot comment, 2026-11-26 17:56) independently reached a matching subtract list — copy-loop duplication ~100, dead SAM API ~150, RefreshState::idle, one ProposalSource::from_wire ladder instead of three (serving.rs:58-63, python.rs:225-233, selection.rs:144-148), and 150-250 test lines — and estimated 550-685 removable. My ~710 is consistent with that and adds the history_proposal/lookup pair, the SamConfig knob collapse and the unreachable wide_copy_curve fallback (three ProposalSource wire ladders are a legitimate ~15-line nit I had not recorded separately; it belongs under #13 finding 9 if the report wants it).
#8 [low] Nits: duplicated validation clauses, repeated dimension checks, doubled docs, duplicated constant
Small duplicates worth listing (nit/should-fix, few lines each):
- helios/src/execution/manifest.rs:844-846 rejects
draft_source == Copy && confidence_width != 0; helios/src/model/catalog.rs:123-131 rejects exactly the same condition plusSpeculativePrefixLimit. The manifest check is subsumed by catalog::validate (which runs on load) — one of the two can go (~7 lines, plus the matching ignition/preparation/execution.py:102-107 duplicate, ~6 more). Note catalog's copy also needs the prefix-limit clause, so keep catalog and drop the manifest clause. - helios/src/scheduler/policy.rs:119-197
dominates_padding_with: the post-PR body has three copies ofif left.iter().zip(right).any(|(a,b)| *a > b) { return false }(lines 158, 166, 175) and two copies of theshort()/long()pair. Hoisting the physical-dimension check above the speculative branch and computingshort/longonce restores a single copy: ~10 lines. - helios/src/scheduler/policy.rs:221-254 (
prune_padding's second pass) re-tests the same predicate asdominates_padding_with's new first branch (lines 143-165: same gpu_prefix_allocation, same capacity/draft equality, samepacked_token_capacity >= needed). Keeping only thedominates_padding_withclause covers the same pairs becauseprune_padding's peer grouping hascandidate.maskfixed; the widened pass is what removes cross-mask candidates — but the two differ inother.batch >= lanesvssmaller.mask == larger.mask, so either the pass or the branch is redundant. Verified they cannot both be needed for the same pair; the loop at 225-254 duplicates ~30 lines of predicate logic that belongs in one helper. - docs/scheduling-runtime-design.md: the new "Idle retains earned credit" sentence is stated twice (funded timing refresh para ~line 431 and funded acceptance learning para ~line 481) plus once more in refresh.rs's doc comment. One sentence in docs is enough (~6 doc lines).
- helios/src/scheduler/speculation.rs:17-18
WIDE_COPY_MIN_MATCH_LEN = 6duplicatessam::DEFAULT_MIN_MATCH_LEN = 6; both constants must stay equal or the wide-copy gate silently stops matching the default proposal threshold. Usingsam::DEFAULT_MIN_MATCH_LEN(or one crate-level const) removes the second knob and its comment (2 lines + a correctness hazard).