#1 [high] F1 (Major): two anchor-budget sites now disagree — price_start/whole vs initial_prefill_ns+extra_spent_ns
PR #660 head 22cac91, helios/src/scheduler/checkpoints.rs.
Site A: request_anchor_endpoint (checkpoints.rs:500-516):
let fraction = self.policy.checkpoint_extra_work_fraction;
let keep_raw = match Self::anchor_split_ns(request,&catalog,terminal_window,
price_start, request.prompt_tokens, raw_anchor) {
Some((whole, split_ns)) => split_ns <= allowance(whole, fraction),
None => fraction > 0.0,
};
price_start can be 0 (checkpoints.rs:487 0), gpu_reused (:469), or baseline_start (:463-465). whole is priced from price_start; extra_spent_ns is NOT considered.
Site B: checkpoint_selection_uncached (checkpoints.rs:588-597):
Some((whole, split_ns)) => {
let budget_base = accounting.initial_prefill_ns.unwrap_or(whole);
let available = allowance(budget_base, fraction);
if split_ns == 0 || accounting.extra_spent_ns.saturating_add(split_ns) <= available
initial_prefill_ns is priced from baseline_interval = (admission_reused_tokens, prompt_tokens) (checkpoints.rs:553-571) — a different start than price_start, and extra_spent_ns is subtracted from the allowance here.
Impact: same request can be "within budget" at A and "over budget" at B. A is what is_request_anchor_endpoint (checkpoints.rs:519-522) reports, which scheduler.rs:1797 uses to stamp RetentionRole::Anchor on a restored/inbound checkpoint:
let role = if self.is_request_anchor_endpoint(request, inbound.consumed_tokens) {
RetentionRole::Anchor
So an interior checkpoint the planner declined can still be promoted to Anchor rank and, via checkpoint_copy_allowed returning Ok(true) unconditionally for Anchor (checkpoints.rs:971-973), copied uncharged. On main both sites used the raw_anchor unconditionally at nonzero fraction (main checkpoints.rs:459-464 and 577-579), so they agreed; #660 introduces the disagreement.
Fix: one anchor_decision(&LiveRequest) -> (usize, u64) helper used by both, based on accounting.initial_prefill_ns + extra_spent_ns, so is_request_anchor_endpoint/promote_request_anchor and the planner cannot diverge.
#2 [high] F2 (Major): operator metric checkpoint_extra_work_nanoseconds_total changes meaning, undocumented
helios/src/scheduler/checkpoints.rs:899-908 (commit_checkpoint_plans) charges every committed cut:
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);
On main the Anchor cut was pushed with split_ns: 0 unconditionally (main checkpoints.rs:611-616 Cut { endpoint: anchor, role: RetentionRole::Anchor, split_ns: 0, copy_ns: 0 }), so anchor splits were invisible. This PR pushes the real split (head checkpoints.rs:619-627) and therefore, for the first time, every request that keeps an interior anchor adds its split to:
flare_checkpoint_extra_work_nanoseconds_total(helios/src/server/metrics.rs:852, sourced from scheduler.rs:142pub checkpoint_extra_work_ns: u64), documented in docs/api.md:356-357 as "sums charged predicted extra prefill and copy work".accounting.extra_spent_ns, which also gates the terminal capture (checkpoints.rs:1049-1057) and post-capture copies (checkpoints.rs:981-984), soflare_checkpoint_skips_total{reason="work_budget"}(metrics.rs:844) moves too.
Neither the PR body nor docs/api.md nor the three updated design docs mention the shift; docs/api.md:349-359 was not touched. Fix: state the new scope in docs/api.md and the PR body (anchor split work is now included), and note that dashboards/thresholds on this counter see a step change.
#3 [high] F3 (Major): shared fixtures re-parameterised to fraction 1.0 — default-0.05 path loses pre-existing coverage
The PR body says only "Updated ... unit tests"; the diff actually disables the changed default in existing fixtures instead of covering it.
- helios/src/scheduler/tests.rs:3302-3315 (
prefill_to_publication_boundary, a widely shared fixture): rewrites every Prefillestimated_duration_ns = 100_000 + token_capacity, then
scheduler.configure_policy(PolicyConfig {
checkpoint_extra_work_fraction: 1.0,
..Default::default()
})
- helios/src/scheduler/boundary_tests.rs:71-90 (
scheduler_with_concurrency): same100_000 + g.token_capacityrewrite pluscheckpoint_extra_work_fraction: 1.0. - helios/src/scheduler/checkpoint_lifecycle_tests.rs:155-161 (TLA+/lifecycle conformance test
checkpoint_reservations_match_lifecycle_model):1.0. - helios/src/scheduler/policy_tests.rs:4833-4837:
0.2; policy_tests.rs:5251-5255:1.0. - helios/src/scheduler/vision_window_tests.rs:388-394:
0.1. - helios/src/server/runtime/phase_tests.rs:3898-3906 (
exercise_text_preemption):1.0. - helios/src/server/runtime/phase_tests.rs:1539-1600:
exact_system_and_prompt_checkpoints_publish_only_after_snapshot_completionrewritten from prompt 13 / boundary 10 toboundary = prefill_chunk_size/prompt_len = boundary + 3so the anchor lands where the budget accepts it.
These tests encoded the behaviour the PR classifies as a bug, so re-baselining is legitimate — but it leaves the default (0.05, helios/src/scheduler/policy.rs:40; validated policy.rs:210-212) covered only by the new inline tests in checkpoints.rs (default_fraction_budgets_interior_anchor_splits_and_preserves_prefix_and_terminal_capture at :4176+, default_fraction_anchor_guard_revocation_preserves_charged_anchor_split at :4334+, anchor_only_multi_chunk_prefill_preserves_split_cost_and_budget, zero_split_interior_anchor_retained_when_extra_spent_exceeds_available). The lifecycle/TLA+ conformance model now runs at 1.0 only, so no conformance edge is emitted for the charged-anchor path at the shipped default. Fix: keep one lifecycle-model run at the default fraction (or add a second edge-emitting run) and say in the body that fixtures were re-baselined rather than merely "updated".
#7 [high] Research summary
Reviewed PR #660 (head 22cac91) for correctness/contracts/system-level consequences. Six findings saved to scratchpad, all with file:line citations and verbatim quotes.
Majors:
- Two anchor-budget decision sites now disagree (checkpoints.rs:500-516 vs :588-597).
request_anchor_endpointprices fromprice_start(which can be0) againstwholeand ignoresextra_spent_ns;checkpoint_selection_uncachedprices frominitial_prefill_ns(baseline start) and subtractsextra_spent_ns. Onmainboth used the raw anchor unconditionally at nonzero fraction, so they agreed; this PR introduces the divergence. Becauseis_request_anchor_endpoint(checkpoints.rs:519-522) is what scheduler.rs:1797 uses to stampRetentionRole::Anchoron restored/inbound checkpoints, andcheckpoint_copy_allowedreturnsOk(true)unconditionally for Anchor (:971-973), an interior checkpoint the planner declined can still be promoted to Anchor rank and copied uncharged — the same duplicate/over-ranked-Anchor class that blocked #582. - Operator metric changes meaning, undocumented (checkpoints.rs:899-908). On
mainthe Anchor cut'ssplit_nswas hard-coded 0, so anchor splits never reachedcheckpoint_extra_work_nanoseconds_total(metrics.rs:852 (not opened)) orextra_spent_ns; now they do, which also movesflare_checkpoint_skips_total{reason="work_budget"}and the terminal-capture gate. Neither the body, docs/api.md:349-359, nor the three updated design docs say so. - Shared fixtures re-parameterised instead of covering the default — tests.rs:3302-3315, boundary_tests.rs:71-90, checkpoint_lifecycle_tests.rs:155-161, policy_tests.rs:4833/5251, vision_window_tests.rs:388, phase_tests.rs:3898 all set fraction 1.0/0.2/0.1, and phase_tests.rs:1539-1600 was rewritten around a chunk-aligned boundary. Coverage of the shipped 0.05 default now rests only on the new inline tests, and the TLA+/lifecycle conformance model runs at 1.0 only.
Minors: helios/README.md:372-380 still states the pre-PR anchor contract; check.py's single mutation was only renamed, so no mutation kills the new budget comparison or the new guard; the None if fraction > 0.0 unknown-cost arm retains an uncharged interior anchor and has no new test.
Sound: the end < anchor → end < raw_anchor filter change genuinely closes a duplicate-capture path from #582; anchor_split_ns reuses one whole price and stays inside the per-select_plan selection scope; no new flag/ABI/unsafe; benchmark claims are author-reported and the "0 checkpoints.rs edits" defence does not isolate #656/#628 in the A/B range.
#4 [medium] F4 (Minor): helios/README.md anchor contract now contradicts the changed code and updated docs
helios/README.md:372-380 (unchanged by this PR):
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. Extra captures charge snapshot-copy cost and additional prefill
caused by splitting chunks.
After this PR the anchor itself is gated by that allowance and charges its split; docs/cli-design.md:696-711, docs/core-design.md:1434-1460, docs/scheduling-runtime-design.md:613-630 were all rewritten to say so. The README sentence now states the pre-PR contract and omits the two facts that matter operationally: (1) the anchor can fall back to the prompt end on a nonzero fraction, (2) the anchor split eats the same allowance as Message/Endpoint extras.
Impact: the crate README is the in-repo contract operators read for checkpoints; it now describes behaviour the code no longer has, and it is the only place that does. Fix: add the interior-anchor budget sentence to helios/README.md:372-380 as part of this PR.
#5 [medium] F5 (Minor): lifecycle check.py mutation covers only the latch, not the new split-budget decision
verification/helios-lifecycle/check.py:671-678 (only hunk in the PR):
check_mutations(cargo, ROOT / "helios/src/scheduler/checkpoints.rs", CHECKS[7][1], [
("dropped multi-chunk zero-budget fallback",
"accounting.budgeted_anchor = Some((raw_anchor, request.prompt_tokens, chosen));",
"accounting.budgeted_anchor = None;",
"multi-chunk prefill must retain zero-budget prompt-end anchor fallback"),
])
The rename keeps this mutation valid (target line still exists at checkpoints.rs:602), but nothing in check.py kills a mutant of the behaviour this PR actually adds, e.g. checkpoints.rs:591-597:
if split_ns == 0
|| accounting.extra_spent_ns.saturating_add(split_ns) <= available
{ (raw_anchor, split_ns) } else { (request.prompt_tokens, 0) }
and the new guard at checkpoints.rs:537-543. The body's evidence section reports check.py 10/10 TLC / 8/8 Observed / 12/12 aux, which reads as coverage of the change but is coverage of the old invariant. Fix: add a mutation that makes the interior anchor always retained (drop the budget comparison), and one that drops the cut.split_ns > 0 conjunct of the new guard.
#6 [medium] F6 (Minor/notes): honest positives and remaining verified observations
Positives verified directly:
- The candidate filter change
end < anchor(main checkpoints.rs:635) →end < raw_anchor(head checkpoints.rs:645) removes a duplicate-capture path: on main, with zero fraction and the anchor fallen back toprompt_tokens, a boundary equal toraw_anchorsatisfiedend < anchorand could be pushed as an extraMessagealongsideAnchor(prompt_tokens). That is theRetentionRole::Anchor-duplication class of the #582 blockers; #660 closes it. anchor_split_ns(checkpoints.rs:430-442) folds the threeinterval_prefill_nscalls into oneOption<(whole, split)>, sowholeis priced once and reused — no extra catalog work on the hot path, andcheckpoint_selection_cached(checkpoints.rs:410-428) is still scoped perselect_planbycheckpoint_planning_scope(checkpoints.rs:134-137, policy.rs:1531, 1784), so the new pricing does not leak across planning calls.- No new flag/ABI/unsafe appears in the diff;
configure_policystill rejects out-of-range fractions (policy.rs:206-213).
Unknown-cost arm (checkpoints.rs:599): None if fraction > 0.0 => (raw_anchor, 0) retains the interior anchor uncharged when prefill cost is unknown — the same "free inner anchor" the PR removes, relocated to the unknown-cost case. It is documented (docs/cli-design.md:702-705, docs/core-design.md:1455-1459) and mirrored at checkpoints.rs:510, so it is a deliberate choice, not a defect; but I found no new test for it (the only tests that touch unknown costs are the older zero-fraction ones), so it is untested at the shipped default.
Dropped extras (intended but worth stating): checkpoints.rs:1809-1820 shows the cost — anchor 896 charges 110 ns, leaving 90 of 200, so endpoint 640 is dropped: [256, 512, 768, 896, 1024], reserved_ns == 134. Main had [256,512,640,768,896,1024], reserved_ns == 115.
Claim accuracy: the PR text supplied for review reports "zero-re-export flare run A/B ... on exact candidate 22cac916834f vs 5d53040e" and, separately, "4× DGX Spark GB10 ran on pre-#656 571a4471", with the caveat "0 checkpoints.rs edits in 571a4471..5d53040e". That caveat does not isolate the merged changes in that range (#656 conditional speculative acceptance + acceptance-probe charging, #628 Copy-Engine gating), both of which move prefill/decode timing; and the disclosed regressions (mixed-c32 per-user p50 93.9 -> 71.0 tok/s, >250 ms gaps 215 -> 434) sit in the same table as the headline +23.7% Out. No repeat counts or variance are given, so the deltas are not assessable as noise-free.
#8 [medium] F7: verbatim contract text for the metric/README findings (docs/api.md, docs hunks)
Verbatim quotes supporting F2 (metric) and F4 (README) findings.
docs/api.md:349-359 (NOT touched by #660):
GPU checkpoint retention exports `flare_checkpoint_captures_total{role}` with
`anchor`, `message`, and `endpoint` roles, and
`flare_checkpoint_skips_total{reason}` with `unknown_cost`, `work_budget`, and
`storage` reasons. Skip counters count selection or capture rejections, not failed
requests. ... `flare_checkpoint_extra_work_nanoseconds_total` sums charged predicted
extra prefill and copy work; it is not a GPU timing measurement.
`flare_checkpoint_anchor_reservations` reports unused anchor guards, excluding
armed destinations and in-flight copies.
After #660 the counter also includes anchor split_ns, which on main was hard-coded 0 (main checkpoints.rs:611-616). The doc sentence "sums charged predicted extra prefill and copy work" remains literally true but its scope widened by an unbounded amount per anchored request; no doc states that anchor splits are now included.
Docs that WERE updated (all three say the anchor split is now charged):
- docs/cli-design.md:696-711 — new text: "An interior message endpoint before the prompt end serves as the conversation anchor only when splitting prefill there adds predicted prefill work within the request's extra-work allowance (reducing to zero added prefill work when the fraction is zero), and otherwise the zero-split prompt end acts as the anchor. ... Any retained interior anchor split, earlier messages, and a distinct prompt end share the fraction of estimated uncached prefill work".
- docs/core-design.md:1434-1460 — "When an interior anchor is retained, its predicted split overhead is charged against that same extra-work allowance while its single anchor snapshot copy remains uncharged."
- docs/scheduling-runtime-design.md:613-630 — "A retained interior anchor charges its predicted split work against that allowance while keeping its anchor snapshot copy uncharged."
Not updated: helios/README.md:372-380 (see F4) and docs/api.md.
#9 [medium] F8: scope of this review — what was read in full, what was not
Verification actually performed for the correctness/contracts lens on PR #660 (head 22cac91). No builds, tests or benchmarks were run — every statement below is from reading the head source, main source, the diff, and the in-repo docs.
Read in full or in the relevant region:
- helios/src/scheduler/checkpoints.rs at head: :1-130 (CheckpointAccounting, allowance(), checkpoint_anchor/endpoint_eligible), :130-260 (revoke_unused_anchor_guards, prefill_catalog_costs, interval_prefill_ns head), :260-442 (rest of interval_prefill_ns, anchor_split_ns), :444-753 (request_anchor_endpoint, is_request_anchor_endpoint, checkpoint_selection_uncached), :755-1096 (estimated_checkpoint_cut, checkpoint_cut, plan_checkpoints, checkpoint_anchor_waiting, promote_request_anchor, commit_checkpoint_plans, checkpoint_copy_allowed, credit_checkpoint_decode, allocate_terminal_capture, commit_checkpoint_copies), plus test regions :1330-1620, :1680-1855, :3440-3620, :4171-4657.
- helios/src/scheduler/checkpoints.rs at main: :420-700 and :840-890, to isolate what changed behaviourally.
- Callers: helios/src/scheduler.rs :838-960 (prefill_cursor, resolve_prefill_kind, prefill_requires_terminal_completion), :1240-1400 (ensure_resources / refill_reservations guard revocation), :1690-1830 (admit: clear_reservations, is_request_anchor_endpoint → ticket role), :2160-2270 (conditioned windows / retain_window_ends / resume_conditioned_window), :2350-2430 (commit: promote_request_anchor → commit_checkpoint_plans → commit_checkpoint_copies ordering), :2740-2920 (complete: capture arming, checkpoint_copy_allowed, allocate_terminal_capture).
- helios/src/scheduler/policy.rs :150-240 (configure_policy validation), :1500-1545 and :1740-1800 (checkpoint_planning_scope in select_plan / phase_plan).
- Docs: docs/api.md:330-380, helios/README.md:355-400, and the three design-doc hunks via the diff.
- Tests: the diff for boundary_tests.rs, checkpoint_lifecycle_tests.rs, policy_tests.rs, tests.rs, vision_window_tests.rs, phase_tests.rs, check.py; checkpoint_lifecycle_tests.rs:1-200 in full.
Not inspected: the remaining ~3,000 lines of checkpoints.rs test module; helios/src/cache/* (RetentionRole ranking internals); server/metrics.rs bodies beyond :844-856 and the counter wiring; scripts/scheduling_sim (arguably N/A — it has no checkpoint/anchor model, and the PR does not argue so, per the dossier); commit trailers (Design-Signed-Off-By) were not readable here, so docs/design-review.md:294-311 compliance is unknown.
Concurrency/blocking note: none of the changed paths introduce locks — the scheduler is single-threaded &mut self plus a thread-local RefCell selection cache scoped to select_plan (checkpoints.rs:134-137, :410-428; policy.rs:1531, :1784), so the new pricing adds no contention or blocking surface. revoke_unused_anchor_guards (checkpoints.rs:138-163) and refill_reservations (scheduler.rs:1333-1399) are unchanged by the PR apart from the new guard's interaction, which the new tests default_fraction_anchor_guard_revocation_preserves_charged_anchor_split and anchor_only_multi_chunk_prefill_preserves_split_cost_and_budget do cover.