#1 [high] Overview: PR 582 shape and diff
PR #582 "helios: avoid splitting prefill on zero-budget checkpoint anchors", head a3c6483, base main. 7 files, +931/-16.
- helios/src/scheduler.rs +11/-3 (is_request_anchor_endpoint used for inbound ticket role, line ~1794)
- helios/src/scheduler/checkpoints.rs +746/-4 (new: anchor_split_is_zero_cost 364-388; is_request_anchor_endpoint 390-420; anchor fallback block 460-511; plan_checkpoints anchor 671-685; promote_request_anchor or_else 758-767; tests 1942+)
- helios/src/scheduler/checkpoint_lifecycle_tests.rs +136 (new test 277-415)
- verification/helios-lifecycle/check.py +19 (mutation with 14-line source literal, 325-343)
- docs 3 files +19/-9 (cli-design.md ~703-710, core-design.md ~1438-1447, scheduling-runtime-design.md ~554-562) Review by voipmonitor (CHANGES_REQUESTED): 2 blocker duplicate-anchor bugs from stale known_whole EWMA + baseline_start re-pricing; majors on is_request_anchor_endpoint pricing from 0, clear_reservations wiping the latch, O(N) pricing at fraction 0, and the brittle mutation literal. Existing test helpers: policy_tests.rs:162 completion_records, :219 complete_timed, :246 step; checkpoint_lifecycle_tests.rs:94 complete_records; lifecycle_tests.rs:28 completion_records; tests.rs:400 state_records.
#2 [high] Blocking: replace anchor_fallback_from latch with one resolved_anchor() function (~95 lines)
The PR stores the zero-budget fallback decision in CheckpointAccounting::anchor_fallback_from (checkpoints.rs:28), clears it in clear_reservations (:49), sets it in a 45-line two-branch block (:467-511), then re-derives the same decision in plan_checkpoints (:671-685), re-prices it independently in is_request_anchor_endpoint (:390-420), and again in promote_request_anchor (:758-767). scheduler.rs:1794 also calls it.
All four sites want one value: the effective anchor. A single method answers it:
fn resolved_anchor(&self, request: &LiveRequest) -> usize {
let raw = request.checkpoint_anchor();
if self.limits.snapshots == 0 || raw >= request.prompt_tokens {
return request.prompt_tokens.min(raw); // no interior anchor at all
}
if self.policy.checkpoint_extra_work_fraction == 0.0
&& !Self::anchor_split_is_zero_cost(request, /* baseline_start..prompt, raw */)
{ request.prompt_tokens } else { raw }
}
Then: the field, the clear_reservations line, the 45-line two-branch block (becomes let anchor = self.resolved_anchor(request);), is_request_anchor_endpoint (~31 lines, replaced by endpoint == self.resolved_anchor(request) as u64), the 15-line map_or_else in plan_checkpoints (becomes let anchor = accounting.cuts.iter().find(...).map_or_else(|| self.resolved_anchor(request), |c| c.endpoint); or simply self.resolved_anchor(request)), and the 10-line or_else in promote_request_anchor (becomes key_at(self.resolved_anchor(request))). The verification mutation literal in check.py:325-343 (18 lines of exact source) shrinks to a one-line needle.
Saves ~95 lines and removes the class of bug the reviewer reports as blockers #1/#2/#3/#4 (stale known_whole EWMA, baseline_start re-pricing, promotion promoting two endpoints, latch wiped by clear_reservations) because there is no second source of truth to disagree with the first. anchor_split_is_zero_cost keeps its role but must price whole/before/after from the same catalog snapshot (drop the known_whole parameter, lines 371, 373-377, 471-473, 498-500) — that alone is ~8 lines and kills the EWMA-drift duplicate-anchor blocker.
#3 [high] Should fix: delete complete_test_step, use the existing completion helpers (~77 lines)
checkpoints.rs:1942-2016 adds complete_test_step (77 lines) that builds per-lane CompletionRecords, Specialative TokenVector, and ExecutionTiming. The same logic already exists three times in the crate:
- policy_tests.rs:162
completion_records+ :219complete_timed+ :246step(identical lane-kind/consumed/generated/Speculative-vector handling), - scheduler/tests.rs:400
state_recordsand :233records, - checkpoint_lifecycle_tests.rs:94
complete_records.
Making the existing completion_records/complete_timed pub(super) (2 words, no new lines) and calling them from the new tests removes 77 lines. The bespoke version also injects dur_ns as GPU timing, which is what masked the EWMA-drift bug the reviewer reproduces; reusing the shared helper keeps tests on the same timing path as production tests.
#4 [high] Should fix: drop two tests that prove nothing this change adds (~210 lines)
Two new tests prove no behaviour the existing suite does not already prove, and both cost a lot of setup:
-
checkpoints.rs:2450-2559
balanced_c16_short_prompts_skip_interior_anchor_tails_and_reach_full_batch(110 lines): builds a 16-slot scheduler with a hand-tabulated duration table and asserts batch convergence. It asserts nothing about anchors — no capture count, no prefix-cache lookup — only that 16 short prefills finish in one launch and reach a B=16 decode batch, which is the scheduler's general balancing behaviour and unrelated to this PR's change. Boundary_tests.rs:192snapshot_capacity_does_not_disable_prompt_fallback_anchorand the existing policy batch tests (policy_tests.rs:17, 1319) already cover batch formation. Delete: −110 lines. -
checkpoints.rs:2365-2447
zero_fraction_falls_back_to_prompt_end_when_interior_anchor_splits_prefillsets up 5 prefill capacities, 4 measured costs and three prompt variants to assertcuts[0].endpoint, which the PR's own smaller testzero_snapshot_capacity...andzero_fraction_multi_chunk_fallback...already assert for the same rule. The aligned sub-case (114_688) overlaps Part A ofzero_fraction_aligned_interior_anchor_and_mixed_prefill_preserve_exact_contracts(:2726-2762), which checks the same 512-aligned zero-cost retention end-to-end. Keeping one of the two: −83 lines. -
checkpoints.rs:2726-2852 Part B (nonzero fraction keeps interior boundary) proves the pre-change behaviour that the PR says is unchanged ("Optional endpoint eviction and nonzero-budget anchor selection remain unchanged") and that checkpoints.rs:1690
zero_fraction_never_reserves_or_charges_extra_copy_workand the existing 0.05 tests already cover: −19 lines of Part B.
Total from these three tests: ~210 lines of the PR's 882 added test lines.
#7 [high] Verification: which parts are needed, which duplicate, line budget
Is the change needed at all (lens item 1)? Yes for two of its three parts:
snapshots == 0is reachable in production: ignition/cli/serve.py:503 capssnapshotstorows - 1 - execution_rows, planning.py:459cache_statesis a user flag (serve.py:431), and boundary_tests.rs:194 already loops oversnapshots in [0, 1, 2, 4, 8, 12]. Emitting an anchor cut that can never get a row is wasted work, so the early return at checkpoints.rs:460 is a legitimate small addition (~3 lines).- The zero-fraction rule is a real behaviour change (no budget ⇒ don't split unless free).
So this is not a "don't merge" — it is "same behaviour, a third of the code". The change's own size: +931/-16; test lines ≈ 646 (checkpoints.rs 610 + checkpoint_lifecycle_tests.rs 136) + 19 in check.py; production lines ≈ 110 (checkpoints.rs: anchor_split_is_zero_cost 25, is_request_anchor_endpoint 31, fallback block 45, plan_checkpoints 15, promote 10; scheduler.rs 11); docs 19.
Reachable-constant check:
checkpoint_extra_work_fractiondefault is 0.05 (policy.rs:39) and the CLI passes 0.0 for the zero-budget mode (PR body, voipmonitor's live run), so both branches are live — do not propose deleting the fraction branch. Existing helpers confirmed by grep: no priorresolved_anchor/is_request_anchor_endpointequivalent;estimated_checkpoint_cut/checkpoint_cut(checkpoints.rs:644-660) read cuts, they do not resolve the anchor.
#8 [high] Summary of confirmed subtractions with line counts
Ranked by lines saved:
- Blocking — one
resolved_anchor()helper replacesanchor_fallback_fromlatch + is_request_anchor_endpoint + plan_checkpoints closure + promote or_else + known_whole param: ~95 lines (checkpoints.rs:28,49,364-388,390-420,467-511,671-685,758-767; scheduler.rs:1794). - Should fix — delete
complete_test_step(checkpoints.rs:1942-2016), make policy_tests.rs:162/219/246 helpers pub(super): 77 lines. - Should fix — drop
balanced_c16_short_prompts...(checkpoints.rs:2450-2560, 111 lines) andzero_fraction_falls_back_to_prompt_end...(2365-2448, 84 lines) and Part B of the aligned test (2764-2781, 18 lines): ~213 lines. - Nit — check.py:325-343 mutation literal 18 → 3 lines: 15 lines.
- Nit — three docs restate the new rule (core-design.md:1438-1445, scheduling-runtime-design.md:554-559, cli-design.md:703-710): ~10 lines. Total ≈ 410 of the change's 931 added lines (~44%). Nothing proposed here removes the behaviour the PR exists for (zero-capacity early return at :460, zero-cost interior anchor retention); the reviewer's blockers #1-#4 and major #5 all disappear with finding 1. Files with no subtraction: helios/src/scheduler/checkpoint_lifecycle_tests.rs:277-415 (the TLA conformance test is genuinely new evidence and mirrors checkpoint_reservations_match_lifecycle_model at :127 — keep), and the docs' factual statements themselves.
#9 [high] Research summary
Reviewed PR #582 (helios zero-budget checkpoint anchors) strictly for subtraction: all 7 changed files read in context, plus the superseded code on main and the existing test helpers it duplicates. Findings are in the scratchpad, ranked by lines saved, ≈410 of the change's 931 added lines removable (~44%) with no behaviour lost.
Top findings: (1) Blocking — the zero-budget fallback decision is latched in CheckpointAccounting::anchor_fallback_from, then re-derived independently in plan_checkpoints, is_request_anchor_endpoint and promote_request_anchor; a single resolved_anchor() method (~20 lines) replaces ~95 lines across checkpoints.rs and scheduler.rs:1794 and removes the exact class of duplicate-anchor bugs the reviewer reports as blockers #1–#4. (2) Should fix — the new 77-line complete_test_step helper duplicates completion_records/complete_timed/step in policy_tests.rs and state_records in tests.rs; its bespoke GPU timing is what hid the EWMA-drift bug. (3) Should fix — three of the five new tests (~213 lines) prove nothing this change adds: the batching test asserts no anchor behaviour at all, and two pricing tests overlap each other and pre-existing coverage.
Also recorded: the snapshots == 0 early return and the zero-fraction rule are both reachable in production (ignition cache_states flag; serve.py:503 cap), so they are kept — the finding is "same behaviour in a third of the code", not "don't merge". The TLA conformance test in checkpoint_lifecycle_tests.rs is genuinely new evidence and should stay.
#10 [high] Report scaffolding: charter citations, what stays, limitations
Judging rules cited (read_charter):
- "Solve the right problem in the right place... Look for the smallest footprint in shared code, or a way to solve it without new code at all. Good ideas in the wrong place will be declined" (How We Work, charter line ~10).
- "Keep the runtime small and model-agnostic" (charter line 12).
- "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs" (charter line ~35) — this PR does address a measured issue, so findings are about size, not purpose.
- Code Review Standards: "PR descriptions: Expect four parts..." — the PR description satisfies this; no finding there. No CONTRIBUTING.md / design-review doc was located or read; the only project rules applied are the charter plus the three design docs the PR itself edits (docs/cli-design.md, docs/core-design.md, docs/scheduling-runtime-design.md). tests/test_design_review_hook.py (named in the PR body) was not inspected — flag as a limitation of the review if the report mentions it.
Parts to KEEP (not subtractions):
- checkpoints.rs:460-462
if self.limits.snapshots == 0 { return (accounting, false, false); }— 3 lines, required becausesnapshots == 0is reachable (ignition planning.py:459cache_statesuser flag; ignition/cli/serve.py:503 caps snapshots torows - 1 - execution_rows; boundary_tests.rs:192-210 already loopssnapshots in [0,1,2,4,8,12]). anchor_split_is_zero_costitself (~20 lines after dropping theknown_wholeparam) — the zero-fraction rule needs it.- checkpoint_lifecycle_tests.rs:277-415 — new TLA+ conformance evidence (mirrors checkpoint_reservations_match_lifecycle_model at :127); mutation-checked by check.py, keep.
- The docs' factual rule statements (one copy), and cli-design.md's flag semantics.
Existing helpers verified by grep/search (for finding 2): policy_tests.rs:162 completion_records, :219 complete_timed, :246 step; scheduler/tests.rs:233 records, :400 state_records; checkpoint_lifecycle_tests.rs:94 complete_records; lifecycle_tests.rs:28 completion_records. No existing resolved_anchor/is_request_anchor_endpoint equivalent; estimated_checkpoint_cut/checkpoint_cut (checkpoints.rs:644-660) only read cuts.
Head commit reviewed: a3c648351c9c364099c57479eba858a7fd33998a. Prior review on the PR (voipmonitor, CHANGES_REQUESTED) independently reports blockers #1-#4 on the same latch/stale-pricing mechanism my finding 1 removes; major #5 (O(N) pricing at fraction 0) is also fixed for free by resolving the anchor once, before the candidate loop at checkpoints.rs:529-639.
#5 [medium] Nit: shrink the 14-line copied-Rust mutation literal in check.py to one line (~15 lines)
verification/helios-lifecycle/check.py:325-343 adds a mutation whose needle is 14 lines of verbatim Rust copied out of checkpoints.rs:489-502. Every other mutation in the file is a 1-3 line needle (compare :293-294, :303, :319-322). The copied block is exactly the code this review says should be replaced by a single resolved_anchor helper.
Smaller version: after the simplification, the needle becomes one line (let anchor = self.resolved_anchor(request); → let anchor = request.checkpoint_anchor();), i.e. 18 lines → ~3. Also note the existing generic mutation at :318-324 already mutates checkpoints.rs, so no new call to check_mutations is needed beyond the tuple.
Saves ~15 lines and removes a maintenance trap: the needle must be byte-identical, so any reformatting of checkpoints.rs breaks check.py with "update the ... mutation".
#6 [medium] Nit: three docs restate the same new anchor rule (~10 lines)
The same new rule is written out three times, adding ~19 doc lines:
- docs/core-design.md:1438-1445 ("When snapshot storage has zero capacity... when
scheduler_checkpoint_extra_work_fractionis zero, an interior message boundary is retained as the anchor only if splitting prefill there adds zero predicted prefill work, otherwise the prompt end serves as the anchor") - docs/scheduling-runtime-design.md:554-559 — same sentence, reworded
- docs/cli-design.md:703-710 — same sentence again, in flag docs
scheduling-runtime-design.md already cross-references core-design.md in the same section (":590 complete-state checkpoint ownership"), so the second and third copies can state the flag effect in one clause and point at the rule. Smaller version, ~10 lines saved:
- cli-design.md: "
--scheduler-checkpoint-extra-work-fraction FRACTION... The default is0.05... Zero snapshot capacity disables all checkpoint cuts; at a zero fraction an interior anchor must price as zero extra prefill work (see core-design.md#exact-endpoint-capture)." - scheduling-runtime-design.md: "Zero snapshot capacity disables all checkpoint cuts; at a zero fraction the anchor rule in exact endpoint capture applies."
Also, the reviewer's minor #6 notes two follow-on sentences (core-design.md:1447-1449 area, scheduling-runtime-design.md:560-562) still say the fraction funds "additional prefill caused by splitting", which contradicts the new zero-cost rule; folding the new sentence into those existing ones removes the contradiction and the duplication at once.