#1 [high] F1: two anchor-decision sites still price different intervals
checkpoints.rs request_anchor_endpoint (PR head cf744df):
- :483-487
let baseline_start = request.checkpoints.baseline_interval.filter(|&(_, end)| end == request.prompt_tokens).map_or(request.admission_reused_tokens as usize, |(start, _)| start); - :488-518
price_startselection (baseline_start / gpu_reused / 0), four pricing-bypassing early returns (:474, :503, :510, :517) - :526-541
Self::anchor_split_ns(request, &catalog, terminal_window, price_start, request.prompt_tokens, raw_anchor)thenanchor_split_affordable(initial_prefill_ns.unwrap_or(whole), split_ns, extra_spent_ns, fraction)Selection: :562let start = Self::prefill_cursor(request);(:610-616 passesstart), :618-629 same affordability helper. prefill_cursor = scheduler.rs:854-856request.scheduled_consumed.max(request.consumed_tokens). baseline_interval is fixed at admission (CheckpointAccounting::for_epoch, :35-41; onlyget_or_insertat :583). So for a cold request mid-prefill (scheduled_consumed > consumed_tokens, set at scheduler.rs:2409-2415/2844-2848) the two sites price [0,prompt] vs [cursor,prompt] and can disagree. Consequences: role assignment at admission scheduler.rs:1795-1811self.is_request_anchor_endpoint(request, inbound.consumed_tokens)→ RetentionRole::Anchor; promote_request_anchor :883-911 usesself.request_anchor_endpoint(request)and callsself.cache.promote(id, RetentionRole::Anchor, epoch)+reoffer_publication. The reconciling latch is created only whenrequest.consumed_tokens >= prompt_tokens(:893-896), so mid-prefill steps are uncovered. New test :4685-4771 always injects initial_prefill_ns and never sets scheduled_consumed != consumed_tokens.
#3 [high] F3: test coverage at shipped default 0.05 is thin; broad fixture opt-out
PR body (read_item 660) says: "cargo test --release: helios server 1,269 / runtime-core,server 1,780"; and the Discord-relevant hosting rules: AGENTS.md:317 requires cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server.
Changed tests the PR declares defaulted (no configure_policy) plus a load-bearing fixture change:
- helios/src/scheduler/tests.rs:161-184
permissive_checkpoint_costssetscheckpoint_extra_work_fraction: 1.0. - boundary_tests.rs:74 now applies it to every
scheduler_with_concurrencyfixture → entire boundary_tests module runs at 1.0 with flattened100_000 + token_capacityprefill costs, so no boundary test exercises the shipped 0.05 anchor-split budget. - checkpoint_lifecycle_tests.rs:156-161 (the TLA+/Observed reservation model test
checkpoint_reservations_match_lifecycle_model) forced to 1.0; :319/:462/:620 keep 0.0 → no lifecycle-model coverage in (0,1). - policy_tests.rs:4833-4838 0.2; :5251-5256 1.0. vision_window_tests.rs:389-394 0.1.
- phase_tests.rs:3898-3905
exercise_text_preemptionforced to 1.0 (fixture prefill costs are flat 1000 ns, so the 0.05 default would have been a genuinely different arm). - phase_tests.rs:1542-1546
exact_system_and_prompt_checkpoints_publish_only_after_snapshot_completionre-geometried from prompt 13 / boundary 10 toprefill_chunk_size+3 with a chunk-aligned boundary, so the short-system/short-prompt integration path is now only covered at 0.05 if the aligned boundary happens to be zero-split; the previous regression scenario (interior anchor on a 1-chunk prompt) is gone. Offsetting: six new inline tests at default 0.05 / other fractions (checkpoints.rs:4203, 4361, 4428, 4508, 4623, 4685).
#5 [high] F1b: worked example of the price_start vs prefill_cursor divergence
Worked example with the PR's own test catalog (checkpoints.rs:4700-4705 measures Prefill 128=100, 256=110, 512=200; prompt 1024, interior boundary 896, fraction 0.05):
- selection after chunk 1 (
start = prefill_cursor = 512): interval[512,1024]=200+200=400; split at 896 = ([512,896]=110+100=210) + ([896,1024]=100) - 400 = -90 →saturating_subclamps to 0 (checkpoints.rs:445Some(before.saturating_add(after).saturating_sub(whole))) ⇒anchor_split_affordableshort-circuits true at :97 ⇒ anchor kept at 896. - request_anchor_endpoint (
price_start = baseline_start = 0): interval[0,1024]=200+110+100=410?? walk: 512→200 then 512 rem → 512 chunk = 200 → 400; [0,896]=200+110+100=410; [896,1024]=100 → 510-400=110 ⇒ 110 > allowance(400,0.05)=20 ⇒ falls back to 1024. So on the same request the two sites return 896 and 1024 respectively; the latch (:893-896 requiresconsumed_tokens >= prompt_tokens) does not exist yet mid-prefill, so scheduler.rs:2405promote_request_anchorpromotes the prompt-end checkpoint to Anchor (cache.promote(id, RetentionRole::Anchor, epoch):906,reoffer_publication:908) while selection keeps charging/targeting 896. The new agreement testrequest_anchor_endpoint_matches_selection_with_spent_budget_and_no_latch(checkpoints.rs:4685-4771) cannot catch this: every sub-case pinsinitial_prefill_nsand leavesconsumed_tokens == 0 && scheduled_consumed == 0, soprice_start == prefill_cursor == 0in all five arms.
#6 [high] F5: PR-description accuracy vs actual diff and A/B scope
PR body, "What" section: "Unified retention & telemetry: request_anchor_endpoint and checkpoint_selection_uncached both call anchor_split_affordable" — but the interval each prices is still different (see F1/F1b), so the unification is only of the affordability predicate, not of the decision.
PR body "Limits": "4× RTX PRO 6000 A/B ran on 22cac916834f (same cold-request math; only request_anchor_endpoint fallback helper + docs/tests added since)" — the helper is not docs/tests: it changes request_anchor_endpoint's budget base from the whole interval to request.checkpoints.initial_prefill_ns.unwrap_or(whole) and adds the extra_spent_ns term (checkpoints.rs:534-539), i.e. admission-role assignment (scheduler.rs:1797) and anchor promotion (checkpoints.rs:885-906) behave differently on the head than in the measured A/B; no A/B or attached CI exists on cf744df.
Also the "What" header claims checkpoints.rs "(+95/-60, +35 net prod LOC)" while the file diff is +751/−87; the header understates the change by ~19× and is the line a reviewer would use to judge blast radius.
Charter: AGENTS.md:194-199 "Require focused, meaningful validation ... Identify missing hardware, inputs, and unrun checks explicitly" and #210's served-workload A/B requirement.
Docs updated consistently: docs/core-design.md:1436-1457, docs/cli-design.md:696-710, docs/scheduling-runtime-design.md:614-623, helios/README.md:372-389 — I found no contradiction between them and the code for the retained-anchor case; the no-capture (checkpoint_skip_storage) case is not described (see F2).
#7 [high] Research summary
Reviewed PR #660 (head cf744df) across correctness/contracts/system-level consequences: read the full checkpoints.rs diff and the changed regions of the file (anchor decision sites, selection, commit/store-failure path, checkpoint_copy_allowed, revoke_unused_anchor_guards, promote_request_anchor), the direct callers (scheduler.rs:1795-1811 admission role, :2405 commit hook, :2858-2910 capture storage), all changed tests, the four doc files, docs/api.md, AGENTS.md, and the TLA+/mutation harness.
Main findings (all cited verbatim in the scratchpad):
- Major — the two anchor-decision sites still price different intervals, so "unified retention" is only the affordability predicate.
request_anchor_endpointprices[price_start, prompt](frombaseline_interval/admission reuse,checkpoints.rs:483-541) while selection prices[prefill_cursor, prompt](:562,:610-616), and the reconcilingbudgeted_anchorlatch is only created whenconsumed_tokens >= prompt_tokens(:893-896), so mid-prefill steps are uncovered. With the PR's own measured costs, mid-prefill selection keeps the interior anchor (split clamps to 0 viasaturating_subat:445) whilerequest_anchor_endpointfalls back to the prompt end (110 ns > 20 ns allowance) — and that site drives cacheAnchorpromotion at:906-908. The new agreement test (:4685-4771) cannot catch it: every arm pinsinitial_prefill_nsand leavesconsumed_tokens == scheduled_consumed == 0. - Major — a retained interior anchor is charged even when no checkpoint is stored.
commit_checkpoint_plansdebitssplit_nstoextra_spent_nsand the global counter before the destination is known (:923-934) and thecheckpoint_skip_storagepath refunds onlycopy_ns(:984); pre-PR the Anchor cut was hard-zero. Under snapshot pressure this permanently burns the request's allowance (also vetoing earlier optional cuts) while retaining nothing, and neitherdocs/core-design.md:1436-1457norhelios/README.md:372-389describes the no-capture case.flare_checkpoint_extra_work_nanoseconds_total's composition widened withdocs/api.md:356-357unchanged. - Major (claims) — the A/B predates one of the two decision sites. The body dismisses the post-
22cac91delta as a "fallback helper + docs/tests", butcheckpoints.rs:534-539changes that site's budget base and adds theextra_spent_nsterm, feeding admission role assignment and anchor promotion; no A/B or attached CI exists on cf744df. Thecheckpoints.rsLOC figure in the body (+95/−60, +35 net) is also ~19× smaller than the real +751/−87. - Minor/medium — coverage at the shipped 0.05 default is thin. The new
permissive_checkpoint_costshelper (tests.rs:161-184) sets fraction 1.0 and flattens prefill costs; it now governs the entireboundary_testsmodule (:74) and was added to the TLA/observed lifecycle-model reservation test (checkpoint_lifecycle_tests.rs:156-161), with policy/vision/phase fixtures opting out to 0.2/1.0/0.1.phase_tests.rs:1542-1546re-geometried the short-system/short-prompt integration case to a chunk-aligned boundary. Six new inline tests at default 0.05 partly offset this. - Minor (disclosed) — the candidate filter
end < raw_anchor(:677) plus the unconditional prompt-endEndpointpush (:680-682) lets a request whose anchor split was rejected still take optional cuts below the abandoned anchor; the tests assert it, but nothing bounds admission pricing for that shape.
Docs and the check.py mutation rename are otherwise consistent with the code; no locks, wire/ABI or re-export changes; RequestScheduler remains single-threaded with a per-plan selection cache, so I found no new contention or memory-amplification hazard beyond finding 2.
#8 [high] F-indices: severities + verbatim quotes for each finding
FINDING 1 (Major) — two anchor-decision sites, different interval basis.
Quote A (helios/src/scheduler/checkpoints.rs:483-487, request_anchor_endpoint):
let baseline_start = request
.checkpoints
.baseline_interval
.filter(|&(_, end)| end == request.prompt_tokens)
.map_or(request.admission_reused_tokens as usize, |(start, _)| start);
Quote B (checkpoints.rs:562, checkpoint_selection_uncached):
let start = Self::prefill_cursor(request);
(+ :610-616 passes start into Self::anchor_split_ns)
Quote C (checkpoints.rs:893-896, promote_request_anchor — latch only after prompt completes):
let latch = (raw_anchor < prompt_tokens
&& request.prefix_tokens != raw_anchor as u64
&& request.consumed_tokens >= prompt_tokens as u64)
.then_some((raw_anchor, prompt_tokens, anchor));
Impact: same request can return 896 at selection and 1024 at request_anchor_endpoint mid-prefill (see F1b entry); the latter drives cache promotion (self.cache.promote(id, RetentionRole::Anchor, epoch)? :906) and reoffer_publication (:908), and admission role assignment (scheduler.rs:1797 if self.is_request_anchor_endpoint(request, inbound.consumed_tokens)).
Fix: price both sites from the same interval (prefill_cursor at selection, baseline_interval.0 at admission are inherently different instants — so instead have promote_request_anchor/is_request_anchor_endpoint consume the accounting's own Anchor cut, or extend the latch to mid-prefill by latching as soon as the selection first decides), and add a test with scheduled_consumed != consumed_tokens plus no injected initial_prefill_ns.
FINDING 2 (Major) — anchor split charged with no capture.
Quote (checkpoints.rs:923-934):
accounting.cuts.retain(|candidate| candidate.endpoint != cut.endpoint);
accounting.reserved_ns = accounting.reserved_ns.saturating_sub(cut.split_ns);
accounting.extra_spent_ns = accounting.extra_spent_ns.saturating_add(cut.split_ns);
self.stats.checkpoint_extra_work_ns = self.stats.checkpoint_extra_work_ns.saturating_add(cut.split_ns);
vs storage-failure refund (checkpoints.rs:983-986):
} else {
accounting.reserved_ns = accounting.reserved_ns.saturating_sub(cut.copy_ns);
self.stats.checkpoint_skip_storage += 1;
}
Fix: on the storage-failure path, refund cut.split_ns too (and subtract it from checkpoint_extra_work_ns), i.e. only debit the split when destination is Some; document the case in docs/core-design.md:1436-1457.
FINDING 3 (Major, claims) — quote from PR body "What": "Unified retention & telemetry: request_anchor_endpoint and checkpoint_selection_uncached both call anchor_split_affordable". Quote from PR body "Limits": "4× RTX PRO 6000 A/B ran on 22cac916834f (same cold-request math; only request_anchor_endpoint fallback helper + docs/tests added since)". Counter-quote (checkpoints.rs:534-539): Some((whole, split_ns)) => anchor_split_affordable(request.checkpoints.initial_prefill_ns.unwrap_or(whole), split_ns, request.checkpoints.extra_spent_ns, fraction). Also body header says "checkpoints.rs (+95/-60, +35 net prod LOC)" vs pr_files +751/-87.
Fix: re-run/attest the A/B on cf744df (or state the two decision sites' post-A/B behaviour change explicitly) and correct the LOC figure.
FINDING 4 (Minor→Major depending on adjudication) — test coverage at 0.05.
Quote (helios/src/scheduler/tests.rs:178-183):
scheduler
.configure_policy(PolicyConfig {
checkpoint_extra_work_fraction: 1.0,
..Default::default()
})
.unwrap();
applied at boundary_tests.rs:74 super::tests::permissive_checkpoint_costs(&mut s, 4, None); (every scheduler_with_concurrency fixture) and checkpoint_lifecycle_tests.rs:156-161. Plus phase_tests.rs:1542-1546 re-geometry and :3898-3905 forced 1.0.
Fix: keep at least one boundary/lifecycle/phase test at the shipped 0.05, and restore an interior-anchor case on a single-chunk short prompt in phase_tests.
FINDING 5 (Minor) — checkpoints.rs:672-682 filter end < raw_anchor + unconditional prompt-end Endpoint push after a rejected anchor.
FINDING 6 (Minor, style) — docs/cli-design.md:699-708 and docs/core-design.md:1457 carry ~100-118-column lines inside ~85-column files (wrapping regression only; no semantic problem).
#2 [medium] F2: anchor split charged even when snapshot storage unavailable; allowance spent without capture
checkpoints.rs commit_checkpoint_plans (:914-990):
:923-934
accounting.cuts.retain(...); accounting.reserved_ns = accounting.reserved_ns.saturating_sub(cut.split_ns); accounting.extra_spent_ns = accounting.extra_spent_ns.saturating_add(cut.split_ns); self.stats.checkpoint_extra_work_ns = ...saturating_add(cut.split_ns);
then :960-986 storage-failure path refunds only the copy:
:984 accounting.reserved_ns = accounting.reserved_ns.saturating_sub(cut.copy_ns); self.stats.checkpoint_skip_storage += 1;
Before this PR the Anchor cut always had split_ns: 0, so a checkpoint_skip_storage on an interior anchor cost nothing. Now the request permanently carries the split in extra_spent_ns and the global counter even though no checkpoint was published, and the reservation was already consumed at selection (:651-659 adds anchor split to reserved_ns), so it also vetoed earlier optional Message/Endpoint candidates (:734-741 extra_spent_ns + reserved_ns + charge > available). docs/core-design.md:1440-1447 and helios/README.md:372-385 do not describe this no-capture case.
Impact: under snapshot pressure (quote_snapshots None at :948/:969, or guard revoked by revoke_unused_anchor_guards :142-167 before the anchor commits) each attempt burns allowance and inflates flare_checkpoint_extra_work_nanoseconds_total while retaining nothing — a memory-pressure feedback loop.
Also note metric composition widened (anchor splits now included) with docs/api.md:356-357 unchanged.
#9 [medium] Verified-clean areas (state plainly, do not invent issues)
Sound, verified by opening:
- Concurrency/contention:
RequestSchedulermutates through&mut self; checkpoint selection uses a per-planRefCell<Option<SelectionCache>>scope (checkpoints.rs:11-19, 138-140, 414-432) cleared byPlanningScope::drop. No new mutexes, channels, or shared-state coupling; the new helpers are pure functions over an already-built catalog. No head-of-line blocking introduced. - Allocation/hot-path cost:
split_overhead_ns(checkpoints.rs:434-446) is shared with the optional-candidate loop (:717-727), so the PR removes duplicateinterval_prefill_nswork rather than adding it;anchor_split_ns(:448-467) reuses onewholeprice. Decode-loop cost unchanged (latch still short-circuits at :477-482), confirmed by the existing STRIDE_RUNS == 0 assertion (:4108-4120). - Overflow/panic handling:
saturating_addonreserved_ns(:652),extra_spent_ns(:929), stats (:930-933);allowanceclamps (:92-94);checked_addretained insideinterval_prefill_ns. No newunwrap/indexing in production paths I touched. - Contracts: 0
unsafe, 0 new flags/ABI/proto/graph ops;PolicyConfig.checkpoint_extra_work_fractiondefault unchanged (policy.rs:40 = 0.05) — this is a default-path behaviour change but in an existing knob, and the PR supplies served-workload A/B evidence (charter "Bring real evidence" / #210) plus disclosed trade-offs, so it is a review judgement on the trade-off, not a missing-evidence blocker. - Docs consistency for the retained-anchor case: helios/README.md:372-389, docs/core-design.md:1436-1457, docs/cli-design.md:696-710, docs/scheduling-runtime-design.md:614-623 all now say budgeted interior-anchor retention, split charged / anchor copy uncharged, and the unknown-cost arms; the delegated cross-reference resolves (heading exists at docs/core-design.md:1418 region). No contradiction with the code except the no-capture case (F2).
- Observability rename: verification/helios-lifecycle/check.py:672-676 mutation target updated to
budgeted_anchor; the harness's othercheckpoints.rsmutation is unaffected. Test/ident renames are complete (grep zero_budget→ no matches repo-wide), so no stale references remain. revoke_unused_anchor_guards(:142-167) still releases exactly one guard per call and only for requests holding one; the new test at :4361-4425 shows the chargedAnchorcut survives revocation without re-pricing (which is the desired invariant, not a leak).
#4 [low] F4: candidate filter change admits message cuts below a rejected raw_anchor
Selection now filters optional message candidates with end < raw_anchor instead of end < anchor:
checkpoints.rs:672-679
let mut candidates: Vec<_> = request.message_boundaries.iter().rev().copied().filter(|&end| start < end && end < raw_anchor && request.checkpoint_endpoint_eligible(end))
if start < request.prompt_tokens && request.prompt_tokens != anchor { candidates.push((request.prompt_tokens, RetentionRole::Endpoint)); } (:680-682)
When the interior anchor was rejected for budget (anchor == prompt_tokens), every message boundary below raw_anchor stays a candidate; nothing re-charges the abandoned anchor split, so admission pricing (estimated_checkpoint_cut):781-789 used by policy.rs:357/711/778/940/1059/1256 does not reflect the extra Prefill launches. The new tests (checkpoints.rs:4280-4300 Case 2, :4330-4340 Case 3) assert this behaviour and the PR body states it explicitly ("Filters earlier Message cuts (end < raw_anchor)"). Flag as a disclosed scope limit / potential over-admission on prompts where anchor split is very expensive but many cheap aligned messages remain — the PR does not bound how many such optional cuts a rejected-anchor request may still take beyond the shared available allowance.