#1 [high] Should fix: helios/README.md left stale on anchor selection (third copy of the spec)
The anchor-selection contract is stated in four places. This PR updates three: docs/cli-design.md:700-711, docs/core-design.md:1435-1445, docs/scheduling-runtime-design.md:551-561. It leaves helios/README.md:372-379 unchanged:
"Checkpoint selection prioritizes the last eligible message boundary, using the prompt end when no message boundary is eligible. Earlier messages and a distinct prompt end compete within a work allowance of scheduler_checkpoint_extra_work_fraction times estimated uncached prefill work, defaulting to 0.05. ... Unknown costs exclude extras while preserving best-effort anchor retention."
That now contradicts the code on both new rules:
- zero snapshot capacity emits no cuts at all (helios/src/scheduler/checkpoints.rs:460-462), so "using the prompt end when no message boundary is eligible" no longer holds;
- with
checkpoint_extra_work_fraction == 0an interior boundary is only kept when the split prices at zero work, otherwise the prompt end is the anchor (checkpoints.rs:467-511).
Precedent for keeping the copies in sync: the recent checkpoint PRs updated the prose copies together (#568 touched 5 shared files; #550/#426 same area). docs/api.md:696 only cross-references core-design, so it is fine.
Fix: add the two conditions to helios/README.md:372-379 in the same wording used in docs/cli-design.md:703-709, or replace that paragraph with a cross-reference to docs/core-design.md#exact-endpoint-capture.
#2 [high] Should fix: effective anchor is now derived in three places instead of one
Before the PR there was one definition of the anchor: LiveRequest::checkpoint_anchor() (checkpoints.rs:109-116), used by selection, plan_checkpoints, promote_request_anchor and the inbound role classification. The PR adds two more derivations:
checkpoint_selection_uncached(checkpoints.rs:467-511) computes the effective anchor and memoizes it inaccounting.anchor_fallback_from.plan_checkpoints(checkpoints.rs:671-685) re-derives it: takes the Anchor cut, elseaccounting.anchor_fallback_from == Some(raw_anchor) ? prompt_tokens : raw_anchor.is_request_anchor_endpoint(checkpoints.rs:390-420) re-derives it a third time for the inbound ticket role (scheduler.rs:1794) and forpromote_request_anchor(checkpoints.rs:757-767), but with a different interval: it prices0..prompt_tokens(line 415) while selection pricesstart..prompt_tokens(line 478) orbaseline_start..prompt_tokens(line 495). It also ignores theanchor_fallback_frommemo except as theSome(raw_anchor)early accept, so it must recompute whenever selection has not yet run (the inbound path runs during admit, before any planning).
The consequence is visible in section 2 and 3 of zero_fraction_aligned_interior_anchor_and_mixed_prefill_preserve_exact_contracts (checkpoints.rs:2757+): the tests have to assert the promotion path separately because it does not share selection's decision. Two verdicts for the same request/endpoint pair can disagree when consumed_tokens != 0 and the per-chunk pricing differs from the whole-prompt pricing (e.g. re-admitted or restored requests).
Fix: expose one function that returns the effective anchor for a request (taking start/baseline as parameters and reusing the memo), and have selection, plan_checkpoints, the inbound classification and promotion all call it. That also removes the closure at checkpoints.rs:675-683.
Note on severity: I did not construct a failing case where the two derivations disagree with observable effect; a test that admits an inbound ticket for a zero-budget request whose interior boundary prices zero for the whole prompt but not for consumed..prompt (or the reverse) would settle it.
#9 [high] Research summary
Reviewed all 7 changed files (helios/src/scheduler.rs, checkpoints.rs, checkpoint_lifecycle_tests.rs, three docs, verification/helios-lifecycle/check.py) in context against the charter, AGENTS.md, docs/design-review.md and the repo-prose skill, and recorded 8 scratchpad notes: 2 "should fix", 2 more "should fix"-level duplication notes, 3 nits, and 1 note listing what I checked and found consistent.
Headline findings, all duplication/convention in kind rather than behavioural:
- helios/README.md:372-379 states the anchor-selection rule and was not updated, so it now contradicts the code on both new rules (zero snapshot capacity, zero-fraction interior-anchor fallback); the PR updated the three other copies of the same paragraph.
- The effective anchor is now derived in three places (
checkpoint_selection_uncached, a closure insideplan_checkpoints, andis_request_anchor_endpoint) with different intervals and different memo handling, where previouslyLiveRequest::checkpoint_anchor()was the single definition that all four callers used. anchor_split_is_zero_costduplicates the inline split pricing in the candidate loop, and flattens unknown costs into "not zero" without counting them as unknown; a singleOption<u64>split helper would serve both.complete_test_stepis a fourth copy of the test step driver that already exists in policy_tests/boundary_tests/checkpoint_lifecycle_tests, with a hardcoded 3-token speculative acceptance. Nits cover duplicatedterminal_window/catalog derivation, hand-built graph descriptors thatextra_graphs()already provides, and inconsistent naming/sentence placement across the three doc updates. check.py's new mutation registration follows the existing pattern exactly.
#10 [high] Report summary: findings in severity order, with the one-line ask
Lens: conventions and duplication. Verdict: no blocking finding; the change is conventional where it matters (mutation-guard registration, accounting field lifecycle, early-return shape) and the real problems are that one definition of "the anchor" became three derivations, and one spec paragraph exists in four places while only three were updated.
Ordered findings (entry numbers are scratchpad notes):
- Should fix — helios/README.md:372-379 stale (note 1). Same paragraph as docs/cli-design.md:700-711 / core-design.md:1435-1445 / scheduling-runtime-design.md:551-561, all three updated, README not. Now contradicts checkpoints.rs:460-462 (zero capacity) and 467-511 (zero fraction). Fix: port the two conditions into the README paragraph, or replace it with a cross-reference to docs/core-design.md#exact-endpoint-capture.
- Should fix — anchor derived three ways (note 2): checkpoints.rs:467-511, the closure at 671-685, and is_request_anchor_endpoint at 390-420 whose pricing interval (0..prompt, line 415) differs from selection's (start..prompt, 478; baseline_start..prompt, 495) and which re-derives because the inbound path runs during admit (scheduler.rs:1794) before planning. Fix: one effective-anchor function reused by all four call sites. Not proven to misdecide in a runnable case; a test admitting an inbound ticket for a zero-budget request with nonzero consumed_tokens would settle it.
- Should fix — anchor_split_is_zero_cost (364-388) duplicates candidate-loop split pricing (557-591) minus the
betweencache, and turns unknown into "not zero" without touching stats.checkpoint_skip_unknown_cost (note 3). Fix: one Option split helper, compare to zero at the call site. - Should fix — complete_test_step (1942-2018) is a fourth completion-record driver alongside policy_tests.rs:162, boundary_tests.rs:93, checkpoint_lifecycle_tests.rs:94; hardcodes 3 speculative tokens (1959) (note 4).
- Nit — new tests rebuild GraphDescriptors that extra_graphs()/walk_scheduler (1094-1138) already build (note 5).
- Nit — duplicated catalog + terminal_window derivation at 406-410 and 446-450 (note 6).
- Nit — three doc updates name the same object three ways; cli-design inserts the zero-capacity sentence mid-paragraph (note 7).
Clean (note 8): check.py:325-343 mutation registration matches existing entries at 296/318; early return at checkpoints.rs:460 keeps the initial_prefill_ns contract of other early returns (520-525); anchor_fallback_from cleared only via clear_reservations (line 49) as used by scheduler.rs:1726; docs/api.md:696 only cross-references core-design so needs no edit.
Lead the report with finding 1: it is a one-file docs contradiction any reviewer can confirm from the diff, and if nothing else is fixed this one should be.
#3 [medium] Should fix: anchor_split_is_zero_cost duplicates the candidate-loop split price
anchor_split_is_zero_cost (checkpoints.rs:364-388) is a near-copy of the split pricing already inline in checkpoint_selection_uncached's candidate loop (checkpoints.rs:557-591):
let split = if endpoint == right { Some(0) } else {
let whole = ...interval_prefill_ns(left, right)...;
whole.and_then(|whole| {
let before = interval_prefill_ns(left, endpoint)?;
let after = interval_prefill_ns(endpoint, right)?;
Some(before.saturating_add(after).saturating_sub(whole))
})
};
The new helper does exactly before + after - whole == 0 but with three differences worth noting:
- it takes an optional precomputed
known_whole(selection also cachesinitial_prefill_ns, so the caching concern is shared); - the inline version caches
betweenso a run of candidates in one interval priceswholeonce (checkpoints.rs:560-573); the helper has no such reuse, so the fallback check at line 474 and line 491 re-prices intervals that selection will price again immediately afterwards, andis_request_anchor_endpoint(line 411) re-prices0..prompta third time; - the inline version returns
Option<u64>(unknown →unknown = true, cut skipped), while the helper flattens every unknown intofalse, i.e. "not zero cost" → prompt-end fallback (lines 375, 381, 386). That is a deliberate policy choice, but it means an unmeasured catalog now silently changes which endpoint is the anchor instead of just skipping extras, and it is not counted instats.checkpoint_skip_unknown_cost.
Fix: factor the split price into one helper returning Option<u64> (fn split_prefill_ns(request, catalog, terminal_window, left, endpoint, right, known_whole) -> Option<u64>) and let both the candidate loop and the zero-cost test use it, comparing to zero at the call site. Precedent for the pattern: reference_interval_prefill_ns (checkpoints.rs:1023) exists precisely because a second pricing walk was suspected of drifting from the first.
#4 [medium] Should fix: complete_test_step is a fourth copy of the test step driver
Three test-driver helpers now exist that build CompletionRecords from a ScheduledPlan:
helios/src/scheduler/policy_tests.rs:162 completion_records(+complete_timed), which also finishes completed requests and supports publishing;helios/src/scheduler/boundary_tests.rs:93 run_step, which computesFence(s.submitted.0 + 1)itself;helios/src/scheduler/checkpoint_lifecycle_tests.rs:94 complete_records, projection-oriented (no output publication, fixed 2-element record vec);- NEW
helios/src/scheduler/checkpoints.rs:1942 complete_test_step, which re-implements the emitted/consumed/status logic, addsproduced_outputpublication, and takes adur_nsforExecutionTiming.gpu_ns[0].
The new one is the closest yet to policy_tests::complete_timed and to boundary_tests::run_step; checkpoints.rs tests sit in the same crate and could reach either if made pub(super). Differences from its neighbours: it hardcodes up to 3 speculative tokens (GraphKind::Speculative => 3.min(lane.tokens)..., line 1959) instead of taking an accepted parameter, and it publishes output. The hardcoded 3 couples the balanced-batch test (balanced_c16_short_prompts_skip_interior_anchor_tails_and_reach_full_batch, line 2450) to enable_speculation(&[1, 2, 4, 8]) widths.
Fix: either take the accepted-count as a parameter, or hoist one complete_test_step-style helper into scheduler/tests.rs (already the shared home for scheduler()/duration_graphs) and have policy_tests/boundary_tests/checkpoints use it. Precedent: tests::duration_graphs (helios/src/scheduler/tests.rs:157) is shared across all four test modules for exactly this reason.
#5 [low] Nit: new tests rebuild graph descriptors that extra_graphs() already builds
Both new tests that drive a full request to decode reproduce policy_tests' engine construction instead of using the existing helpers:
zero_fraction_falls_back_to_prompt_end_when_interior_anchor_splits_prefill(checkpoints.rs:2365) rebuilds a scheduler withRequestScheduler::new(..., SchedulerLimits{..template.limits}, template.capabilities.clone()), callsprefill_graphs(&[...]), then pushes hand-builtGraphDescriptors for the two larger capacities and callsmeasure(...)per capacity.engine_with_terminal_prefill/ thegraphclosure inextra_graphs()(checkpoints.rs:1094-1116) already build exactly this shape of descriptor (tuned_bindings,confidence_width,draft_tokens,packed_token_capacity,sampling_mode,prefill_capacity) and are in the same file 1250 lines above.zero_fraction_aligned_interior_anchor_and_mixed_prefill_preserve_exact_contractsPart C (checkpoints.rs:2797+) hand-builds aGraphKind::Mixeddescriptor, whichextra_graphs()(line 1114:graphs.push(graph(GraphKind::Mixed, 2, 1, 512));) andwalk_scheduler(line 1118) already provide, including themixed_graphs(&[(2, 1, 512)])registration call.
Nit-level because tests, but the duplication is the same "second copy of a graph-catalog builder" pattern that extra_graphs was introduced to remove; a new GraphDescriptor field would now need editing in four places in this file.
#6 [low] Nit: duplicated catalog + terminal_window derivation
checkpoints.rs:406-410 and :446-450 are now character-identical:
let terminal_window = if request.prompt_logprobs { 0 } else { self.terminal_prefill_window() };
(is_request_anchor_endpoint and checkpoint_selection_uncached). The same three-line idiom also exists in the test path at checkpoints.rs:1029 for the catalog choice, and the catalog choice itself (request.prompt_logprobs ? scored_prefill_catalog : prefill_catalog) is duplicated in prefill_catalog_costs (line 164).
Fix: a fn pricing_inputs(&self, request) -> (Vec<PrefillCatalogCost>, usize) (catalog + terminal window) used by all three call sites; it also states once that scored-prefill requests price with no terminal window. Precedent: prefill_catalog_costs was itself introduced to read catalog state once per selection (doc comment lines 160-162), so a second, separately-written copy of the sibling derivation works against that intent.
#7 [low] Nit: inconsistent terminology and sentence placement in the three doc updates
The three updated paragraphs use three different names for one object: "the last eligible message endpoint" (docs/cli-design.md:703), "the last eligible complete-message boundary" / "interior message boundary" (docs/core-design.md:1436-1441), "the last eligible completed message" / "interior message boundary" (docs/scheduling-runtime-design.md:555-558). The code calls it message_boundaries / checkpoint_endpoint_eligible (checkpoints.rs:109-125).
Also in docs/cli-design.md:700-711 the new sentence "Zero snapshot capacity disables all checkpoint cuts." is inserted in the middle of the anchor paragraph, between the anchor rule and the sentence "Earlier messages and a distinct prompt end consume the fraction...", so the paragraph no longer reads in the order anchor → extras → accounting it describes.
Nit: pick one term ("message boundary") for the three docs and move the zero-capacity sentence to the end of the paragraph, matching core-design.md's ordering (anchor rule, then zero capacity, then earlier boundaries).
#8 [low] Checked and clean: check.py registration, early return, field reset, api.md
Verified as consistent with existing precedent (no finding):
- verification/helios-lifecycle/check.py:325-343 registers the new mutation under
CHECKS[7][1](the CheckpointReservation suite) usingcheck_mutations, exactly as the existing entries at check.py:296, 318 do; the "update the ... mutation" guard at check.py:95 catches a stale needle. checkpoint_selection_uncached's earlyreturn (accounting, false, false)for zero snapshot capacity (checkpoints.rs:460-462) sits afterinitial_prefill_nsis computed, so the returned accounting still carries a prefill price like every other early return (lines 520-525); andCut,ArmedCapture,CapturePlankeep their existing shapes.anchor_fallback_fromis a private field onCheckpointAccounting(checkpoints.rs:28) cleared byclear_reservations(line 49), which is the single reset point used by admission (scheduler.rs:1726) — consistent with howbaseline_interval/cutsare handled.- docs/api.md:696 only cross-references core-design for anchor priority, so it needs no edit.
- The new
is_request_anchor_endpointtakesendpoint: u64whilecheckpoint_anchor()/prompt_tokensareusize; call sites convert (scheduler.rs:1794,checkpoints.rs:763), which matches the pre-existing mixed use ofconsumed_tokens as u64in the same function.