#1 [high] PR 582 shape and governing rules
PR #582 "helios: avoid splitting prefill on zero-budget checkpoint anchors", head a3c6483, base 167f22c. 7 files, +931/−16: helios/src/scheduler/checkpoints.rs (+746/−4), checkpoint_lifecycle_tests.rs (+136), scheduler.rs (+11/−3), docs/cli-design.md, docs/core-design.md, docs/scheduling-runtime-design.md, verification/helios-lifecycle/check.py (+19). Review state: CHANGES_REQUESTED by voipmonitor (2 blockers about duplicate RetentionRole::Anchor captures, majors about hardcoded start=0 in is_request_anchor_endpoint, clear_reservations wiping the latch, O(N) pricing at fraction 0, minor doc/test notes).
Rules for this lens:
- AGENTS.md:155-212 (contribution scope + rejection criteria): "Reject unsupported abstractions and churn... Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement"; "Every contribution must address an explicit maintainer request, a demonstrated defect, a measured performance or memory problem..."; "Require focused, meaningful validation"; "Keep each PR focused on one coherent outcome".
- AGENTS.md:485-510 / docs/design-review.md principle 12: performance claims require equivalent baselines and actual Helios service measurements; disclose unrun checks.
- docs/design-review.md:16-35 principle 1 "Keep Helios as simple as possible"; principle 16 prose/PR description four-part scheme.
- docs/design-review.md:232-240: modifying the Helios scheduler without running/updating the applicable TLA+ models, conformance fixtures and scheduling simulator is a blocking design failure.
- docs/core-design.md:1436-1457: anchor policy text (pre-PR: anchor retention best effort and independent of duration estimates; extra captures use a request-local allowance; "Preemption preserves the logical request's earned and spent allowance").
- docs/cli-design.md:700-713 documents the flag semantics changed by this PR. Charter (read_charter): "Solve the right problem in the right place... smallest footprint in shared code"; "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)"; "No per-model special cases or flags"; "Keep the runtime small and model-agnostic".
#2 [high] Should fix: anchor decision re-priced from three different start points (unstable anchor)
helios/src/scheduler/checkpoints.rs (head a3c6483):
anchor_split_is_zero_cost(request, catalog, terminal_window, start, end, anchor, known_whole)at 364-388: asks "does splitting atanchoradd predicted prefill work?" but the answer depends entirely on thestart/known_wholethe caller supplies.- Callers use three different windows for the same request:
- 474-482:
(start = consumed_tokens, end = prompt_tokens, known_whole = initial_prefill_ns only when start == baseline_start). - 491-501 (after prefill passes the interior boundary):
(baseline_start, prompt_tokens, initial_prefill_ns). - 411-419 in
is_request_anchor_endpoint:(0, prompt_tokens, None)— hardcoded 0, ignoringbaseline_start/consumed_tokens.
- 474-482:
- Because pricing window (1) moves with every chunk while (2) is anchored at admission, the same request can decide "interior anchor" on one chunk and "prompt-end anchor" on the next with unchanged costs, and
anchor_fallback_fromlatches whichever was last computed (483/486/503). That is exactly voipmonitor's blocker reproducers (upward EWMA drift with prompt=1024/boundary=512; Mixed prefill alignment shift with prefill_catalog=[128,512], mixed=[(2,1,256)], raw_anchor=768) — both are symptoms of deriving a sticky policy decision from a chunk-relative re-pricing rather than a fixed function of (prompt, boundaries, catalog). - Also note
baseline_endis alwaysprompt_tokens(CheckpointAccounting::for_epoch 35-41 sets(consumed, prompt)), so the(baseline_end == request.prompt_tokens).then_some(...)guard at 498-500 is always true and the(start, prompt_tokens) == (baseline_start, baseline_end)guard at 471 is only true before any prefill progress. That dead/always-true conditional signals the decision logic was assembled from special cases. Fix (architecture): price the anchor once per request over the fixed interval (baseline_start..prompt_tokens) and latch the chosen endpoint on the request; do not re-price per chunk. One helper should answer "which endpoint is this request's anchor" andcheckpoint_selection_uncached,plan_checkpoints,is_request_anchor_endpointandpromote_request_anchorshould all read that one answer.
#3 [high] Should fix / Blocking: special-cased zero fraction, unpreserved anchor decision, docs and evidence gaps
-
[Should fix]
checkpoint_extra_work_fraction == 0.0is a hard-coded special case on a continuous knob. helios/src/scheduler/policy.rs:208-209 validates the fraction over [0,1]; checkpoints.rs:467-468 and 395-396 then branch on exact float equality and substitute a completely different anchor rule. The general rule already covers this:allowance(prefill, fraction)(87-89, 528) yields 0 at fraction 0, so no cut can ever be funded; the anchor is the only thing still funded — and it is pushed with split_ns 0/copy 0 at 512-519 without pricing. Better: price the anchor cut through the same allowance path (split_ns = extra splits, copy_ns = snapshot copy) instead of adding a second, magic-valued policy regime. Charter: "No magic defaults"; AGENTS.md:188-193 rejects configuration switches and special cases without concrete requirement. -
[Should fix] Latch is dropped by
clear_reservations()while the accounting object survives preemption/readmission. checkpoints.rs:48-52 clearsanchor_fallback_from; scheduler.rs:1722-1726 callsclear_reservations()on the preservedCheckpointAccounting, and helios/src/server/runtime.rs:2745/2771/2789/2800/2827 deliberately carry the accounting across preemption and inbound-restore retries (admit_planned_with_checkpoint_accounting). docs/core-design.md:1456-1457 states "Preemption preserves the logical request's earned and spent allowance" — the new zero-budget anchor decision is not preserved, so a readmitted request can re-decide its anchor. Fix: make the chosen anchor an explicit field of the request (not a re-derived latch) and preserve it with initial_prefill_ns/baseline_interval. -
[Should fix] Zero-budget pricing still walks every boundary and reports skips. checkpoints.rs:529-539 puts all message boundaries plus a distinct prompt end into
candidateswhenever the anchor is the prompt end; at fraction 0availableis 0, so each candidate chargessplit_ns + copy_ns > 0against it and setsbudget = true(592-605). Result at 100% of zero-budget serving: O(N)interval_prefill_nswalks per step and a spuriousflare_checkpoint_skips_total{reason="work_budget"}increment (stats at 782-783 → helios/src/server/metrics.rs:501). voipmonitor observed exactly this live atfraction == 0.0. Fix: when the allowance is zero, return after pushing the anchor cut. -
[Should fix] Documentation asserts a policy the implementation does not yet satisfy. docs/core-design.md:1438-1445, docs/cli-design.md:703-708 and docs/scheduling-runtime-design.md:553-559 now state as specification "an interior message boundary is retained as the anchor only if splitting prefill there adds zero predicted prefill work". Given the two duplicate-Anchor blockers, the documented rule is not what the code does on upward EWMA drift or on a Mixed prefill alignment shift. AGENTS.md:52-60: designed behavior the code does not implement must be marked designed, not implemented. Also AGENTS.md:74-113 and design-review principle 16: the PR description does not mention the three documentation files at all (its "What changed" section omits them), so a reader cannot see the documented policy change.
-
[Blocking — process/evidence] No scheduling-simulator evaluation and no Helios service measurement. docs/design-review.md:195-204 and 232-240 require changes to graph selection/service pricing and to the Helios scheduler to be evaluated against scripts/scheduling_sim reference solvers and to update the TLA+/conformance fixtures; "never touch covered code without running ... its simulator". The evidence lists only pytest runs of the simulator's own unit tests (tests/test_scheduling_sim.py etc.), not an evaluation sweep of the changed policy. docs/design-review.md principle 12 and charter line "Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)": the PR itself states "Live signed-core serving and isolated GPU latency measurements remain unverified" while the claimed benefit is a prefill-launch reduction; the live 2→1 measurement in the thread was produced by the reviewer, not supplied by the author.
-
[Nit] verification/helios-lifecycle/check.py:325-343 mutates the production branch by matching a 13-line verbatim string literal of checkpoints.rs. AGENTS.md:194-196 ("source-text checks ... cannot establish runtime correctness") and the brittleness means the guard breaks on any formatting change to the code it guards. Prefer a guard whose behaviour is observable from the lifecycle projection (an Anchor capture count on a multi-chunk zero-budget prompt) rather than a text substitution.
#4 [high] Scope verdict and what the change gets right
Context for the final report's "what is right about the approach" and scope judgement:
- The change belongs in Helios: anchor/snapshot selection is shared scheduling and cache policy (AGENTS.md:408-431, docs/design-review.md:47-55), not model computation, and nothing here branches on model identity — so it does not violate the "no per-model special cases" rule.
- Zero snapshot capacity producing no cuts (checkpoints.rs:460-462; is_request_anchor_endpoint 395-397) is correct in principle: with
limits.snapshots == 0reserve_snapshotcan never succeed, so the previous code selected cuts whose captures could never be armed. The guard is placed afterinitial_prefill_nsis computed (451-459), so unmeasured-cost accounting still gets priced;allocate_terminal_capture(917-963) still prices a snapshot copy at zero capacity (it only learns there is no row at quote time, 949-961) — a nit consistent with voipmonitor's finding 6, but it only costs acheckpoint_skip_storagecounter, not behaviour. promote_request_anchor(753-776) now also considers the prompt-end key; that is a genuinely new policy surface (an Endpoint checkpoint at prompt end may be upgraded to Anchor), and it is only reachable whileis_request_anchor_endpoint(prompt_tokens)is true, which is the same triple-priced predicate as finding #2 in the scratchpad. Keeping it simple would mean promoting only the endpoint the selection actually chose.- Test additions: 3 unit tests in checkpoints.rs (zero capacity, zero-fraction fallback incl. Mixed and aligned, 16-request batching) plus one lifecycle test in checkpoint_lifecycle_tests.rs. They do cover the intended behaviour, but two of them drive
linear_costs/dur_ns = 1_000timings that push the EWMA far below the measured 512_000 ns (checkpoints.rs:1009-1019,complete_test_step), which is why the duplicate-Anchor blockers do not fail the suite.
#5 [high] Research summary
Reviewed PR #582 (helios: avoid splitting prefill on zero-budget checkpoint anchors, head a3c6483) through the architecture/scope lens: all 7 changed files read in context, callers followed (scheduler.rs admission/promotion, policy.rs planning, server/runtime.rs accounting preservation, metrics), judged against read_charter, AGENTS.md and docs/design-review.md.
Scope verdict: the change belongs in Helios — anchor/snapshot selection is shared scheduling and cache policy, with no model-identity branching — so it does not violate the "no per-model special cases" rule, and the zero-snapshot-capacity guard is correct in principle (previously cuts were selected whose captures could never be armed). The approach, however, is not right: it introduces a second anchor policy regime selected by exact float equality on a continuous knob, re-derives the anchor from three different pricing windows, and latches the result on a field that the preemption path clears.
Findings recorded in the scratchpad (6): the hard-coded checkpoint_extra_work_fraction == 0.0 branch with an unpriced anchor cut (should fix; the existing allowance path already yields zero); the anchor decision being unpreserved across preemption/readmission (should fix, contradicts docs/core-design.md:1456-1457); zero-budget selection still walking every boundary and emitting spurious checkpoint_skips_total{reason="work_budget"} (should fix, matches the reviewer's live observation); three design docs now specifying a rule the code does not satisfy plus the PR description omitting those docs entirely (should fix); no scheduling-simulator evaluation sweep and no Helios service measurement behind the performance claim, which the PR itself marks unverified (blocking per docs/design-review.md principle 12 and the simulator requirement at 195-204/232-240); and the 13-line source-text mutation guard in check.py (nit).
These overlap with, and give the architectural reasons for, the two duplicate-RetentionRole::Anchor blockers and the clear_reservations/hardcoded-start = 0 majors already raised by voipmonitor; I verified the underlying code paths (checkpoints.rs:364-388, 390-420, 459-519, 529-539, 48-52, 753-776; scheduler.rs:1722-1726, 1794). No new defect beyond that set was found, and I am not proposing kernel-level or per-model designs.
#6 [high] Citations for the final report
Verified code citations for each finding, so the report can carry file:line without re-reading:
- Magic zero-fraction branch: helios/src/scheduler/policy.rs:208-209 (fraction validated over [0,1]); checkpoints.rs:467-468 (
raw_anchor < prompt_tokens && fraction == 0.0), 395-396 (same test insideis_request_anchor_endpoint), 87-89 + 528 (allowance→ 0 at fraction 0), 512-519 (anchor cut pushed with split_ns 0 / copy_ns 0, i.e. never priced). - Unpreserved latch: checkpoints.rs:28 (field), 48-52 (
clear_reservationssetsanchor_fallback_from = None), scheduler.rs:1722-1726 (accounting preserved across admission then cleared); helios/src/server/runtime.rs:2745, 2771, 2789, 2800, 2827 (accounting carried through preemption and inbound-retry); docs/core-design.md:1456-1457 ("Preemption preserves the logical request's earned and spent allowance"). - Wasted pricing + bogus stat: checkpoints.rs:529-539 (candidates = all boundaries + prompt end when anchor == prompt end), 557-605 (each candidate priced,
budget = truewhen charge > available), 782-783 (stat), helios/src/server/metrics.rs:501 (checkpoint_skips[1]). - Docs asserting unimplemented policy: docs/core-design.md:1436-1445; docs/cli-design.md:700-713; docs/scheduling-runtime-design.md:553-559. PR description "What changed"/"After" never mentions the three doc files (orientation packet also flags docs as unmentioned).
- Evidence gaps: docs/design-review.md:180-204 (three-layer hierarchy incl.
scripts/scheduling_simreference solvers) and 232-240 ("Never touch covered code without running and updating its simulator and formal checks" is a blocking design failure); principle 12 (docs/design-review.md:106-115) requires Helios service measurements; PR self-declares "Live signed-core serving and isolated GPU latency measurements remain unverified"; the live 2→1 prefill_steps number in the thread came from the reviewer, not the author. - Brittle guard: verification/helios-lifecycle/check.py:325-343 (13-line verbatim needle replaced by
} else if false {), against AGENTS.md:194-196. - Why the new tests miss the blockers: checkpoints.rs:1009-1019 (
linear_costs= capacity*1000 ns) and the addedcomplete_test_stephelper committingdur_ns = 1_000(diff), i.e. EWMA far below the 512_000 ns measured cost, sosaturating_subclamps to 0. - Minor consistency nit:
allocate_terminal_capture(checkpoints.rs:917-963) still prices a snapshot copy whenlimits.snapshots == 0, only discovering the lack of a row at quote time and countingcheckpoint_skip_storage.