Case file: PR #582 — "helios: avoid splitting prefill on zero-budget checkpoint anchors"
https://github.com/NVIDIA/hyperflare-inference/pull/582 · perf/helios-zero-budget-anchor-split → main · head a3c64835, base 167f22c8 · open, "ready for review", CHANGES_REQUESTED standing · no CI on head · +931/−16 in 7 files.
Key findings
- One change-request review is the whole discussion, and it is substantive: 2 blockers + 3 majors + 1 minor from a priority contributor. voipmonitor (author of TerminalPrefill #479) reproduced the benefit live on 4× SM120 (prefill_steps 2→1 and 3→2) and then showed two duplicate-
RetentionRole::Anchorcapture bugs incheckpoint_selection_uncachedon ordinary multi-chunk workloads: upward GPU EWMA drift (staleknown_whole) andMixed-prefill chunk realignment. Both reproducers are concrete (checkpoints.rs:364–388, 466–505). - The description's "optional endpoint eviction … remain unchanged" does not hold. The PR also changes inbound-restore role classification (
scheduler.rs:1794, now viais_request_anchor_endpoint) andpromote_request_anchor(checkpoints.rs:753–776, new prompt-end fallback), so a checkpoint already at the prompt end can be tagged/promoted toAnchor. That changesRetentionRankordering and therefore eviction — the exact area of #568, merged the same day. - Three doc files are edited and the description does not mention them (
docs/cli-design.md +6/−3,docs/core-design.md +8/−4,docs/scheduling-runtime-design.md +5/−2). They are where the PR rewrites a previously stated invariant ("anchor retention is best effort and independent of duration estimates") to a priced rule at fraction 0 — a policy change, not a doc tidy. - The change is >80% tests (~+880 of +931) and touches no TLA+ model. The new scheduler state
anchor_fallback_fromis not modelled; only the resulting reservation transitions are asserted against existing model edges (checkpoint_lifecycle_tests.rs+136). - A new per-lane, per-commit, unmemoised O(prompt) pricing walk (
is_request_anchor_endpoint, checkpoints.rs:390–420) is introduced outsidecheckpoint_planning_scope. That is the same class of per-commit CPU cost #459 was written to remove (production symptom there: runtime thread 96–100% CPU, GPUs idle, decode a few tok/s). The reviewer flags the analogous in-selection cost as Major #5 but not this one. - No linked issue.
search_itemsfinds no bug report for zero-budget anchor splits; the motivating configuration is the--scheduler-checkpoint-extra-work-fraction 0workaround yatesdr documented in #335, and the cost of an extra split launch was measured in closed #69. - Author's own two-day-old PR #538 caused the #550 pricing regression in the same function #582 now prices from (
interval_prefill_ns); #550 (different author) repaired it hours before #582 was opened. - Process risk: based on a
mainthat has moved 5–7 commits, in the file three PRs appended tests to in a single day (#568, #550, #582); no maintainer engagement yet; the diff is a single commit.
1. The change (what it does, in plain terms, and what the description omits)
Size. 7 files, +931/−16 (pr_files): helios/src/scheduler/checkpoints.rs +746/−4, helios/src/scheduler/checkpoint_lifecycle_tests.rs +136/−0, helios/src/scheduler.rs +11/−3, verification/helios-lifecycle/check.py +19/−0, docs/cli-design.md +6/−3, docs/core-design.md +8/−4, docs/scheduling-runtime-design.md +5/−2. Roughly 80% of the added lines are tests.
Behaviour, verified in code at head:
- Zero snapshot capacity now plans nothing. A new early return
if self.limits.snapshots == 0 { return (accounting, false, false) }sits atcheckpoints.rs:460–462, before any Anchor cut is pushed, so no cut/split is planned at all. It is placed afterprefill_catalog_costs(:445) and theinitial_prefill_nslatch (:451–459), which the reviewer asks to flip (Minor #6). - Zero extra-work fraction now prices the interior anchor.
checkpoint_selection_uncachedrenamesanchor→raw_anchorand, whenraw_anchor < prompt_tokens && checkpoint_extra_work_fraction == 0.0, keeps the interior boundary only if the newanchor_split_is_zero_cost(pricesbefore(0..anchor) + after(anchor..end) − whole(0..end)throughinterval_prefill_ns, returns false when any price is unknown) says the split costs nothing; otherwise it latchesaccounting.anchor_fallback_from = Some(raw_anchor)and uses the prompt end (checkpoints.rs:467–511). - The fallback survives multi-chunk progress. The
else ifarm atcheckpoints.rs:489–507handlesraw_anchor <= start: it keeps the prompt end if the fallback was already latched, or re-prices frombaseline_startand falls back again if the split is costly. This is the arm the reviewer's two blockers both break. - New state field.
CheckpointAccounting::anchor_fallback_from: Option<usize>(checkpoints.rs:28), cleared byclear_reservations()(:48–49) — reviewer Major #4 says it must instead be preserved likebaseline_interval/initial_prefill_ns, becauseadmit_planned_with_checkpoint_accountingpreservesCheckpointAccountingacross preemption/readmission and callsclear_reservations(). - Prompt-end anchor is now recognized downstream.
is_request_anchor_endpoint(checkpoints.rs:390–420): true for the raw anchor; false when snapshots == 0 (checked after the raw-anchor test), fraction ≠ 0,raw_anchor >= prompt_tokens, or endpoint ≠ prompt end; then true if the fallback is latched, else!anchor_split_is_zero_cost(..., start=0, ...). It is priced from 0 regardless ofbaseline_start(reviewer Major #3). - Capture planning follows the decision.
plan_checkpointsrecomputesanchorfrom the Anchor cut or, absent a cut, fromanchor_fallback_from(checkpoints.rs:671–685). - Reuse promotion extended.
promote_request_anchor(checkpoints.rs:753–776) now falls back tohistory.key_at(prompt_tokens)whenis_request_anchor_endpoint(request, prompt_tokens)and promotes that checkpoint toAnchor(plusreoffer_publication). - Restore role tagging changed.
scheduler.rs:1794: inbound restore role is nowRetentionRole::Anchorwhenis_request_anchor_endpoint(request, inbound.consumed_tokens)instead of only when it equalsrequest.checkpoint_anchor(). - Mutation check.
check.py:325–343adds a Rust source mutation "dropped multi-chunk zero-budget fallback" that replaces the 13-line} else if …text with} else if false {; the harness requires an exact single occurrence, so it is coupled to the block's formatting (reviewer Minor #6; verified incheck.py:326–342). - Docs (undescribed).
docs/cli-design.md:700–713,docs/core-design.md:1436–1445,docs/scheduling-runtime-design.md:553–559are rewritten to state the zero-capacity and zero-fraction rules.
What the description does not say: the three doc files; the restore role-tagging change; the promote_request_anchor prompt-end upgrade; the O(prompt) per-commit pricing walk; the anchor_fallback_from-not-preserved gap; and the fact that ~880 of its lines are tests. The title says "zero-budget" but the change also covers zero snapshot capacity, a different switch.
What the description says that is not strictly delivered: "Optional endpoint eviction … remain unchanged" — eviction ranking changes indirectly via the two Anchor-promotion paths above; "Zero-cost aligned interior anchors remain eligible without adding a duplicate prompt-end anchor" holds only for the linear, no-drift case the unit test covers, and fails under the reviewer's EWMA-drift and Mixed-realignment scenarios.
2. The why
- No linked issue.
search_itemsfor zero-budget/anchor/prefill-split terms returns only #582 itself; the PR body links none. The justification rests on the body plus the reviewer's live measurement. - The configuration is a real, documented operator workaround. In #335 (closed issue, 2026-11-18) yatesdr measured a 32×12.7K burst at 161–188 s median TTFT on
f9aec99c, dropping to 27.9 s with--scheduler-checkpoint-extra-work-fraction=0, and noted "Anchor checkpoints are still taken." That sentence describes exactly the behaviour #582 changes: at fraction 0 the anchor still forced a prefill cut. - The split cost is measured in the repo. #69 (closed) recorded a short final-message split costing ~180 ms of fixed short-batch work on four GB10 Sparks (1,908 ms vs 1,725 ms TTFT) and noted "vLLM has no equivalent cost: chunks purely by token budget and never splits on message boundaries". #69 was closed for inactivity as a design decision — the same design tension #582 resolves differently (keep the prompt-end checkpoint, drop the interior split).
- The precondition was established by the author's own #538 (merged 2026-11-26): "Every chat request takes 1 message-boundary snapshot after the template prefix, so the natural-fit launch count is 1 + ceil(user_tokens / 16384)" — interior boundary splits are the norm for chat prompts.
- Age: at most 4 days between the #335 measurement and this PR. The code path being changed (anchor kept regardless of capacity/cost) dates from 617ef929 (2026-11-11, "Allocate checkpoint slots globally within request work budgets"). This is a fresh request, not a long-standing one.
3. Related work
- #568 (merged 2026-11-28, lukealonso) "Bound optional Endpoint checkpoint eviction by age-discounted marginal gain" — changed the same function (
protected_token_budgeton optional Endpoint quotes) hours before the review, and last touchedcheckpoint_lifecycle_tests.rs. #582's claim that eviction is unchanged is made against this change; the Anchor-promotion paths undercut it. - #550 (merged 2026-11-28, iein) "Restore prefix checkpoints on prefill catalogs without terminal prefill" — immediately preceding fix to
interval_prefill_ns(unmeasured-capacity pricing) in the same function. #582'sanchor_split_is_zero_costdepends on that rule; #550 itself exists to fix a regression #538 (same author as #582) introduced (31K repeat prompt went from full reuse/0.02 s to 29 tokens reused/15.3 s on Inkling 2 Small TP4). - #459 (merged 2026-11-22, yatesdr) "Price checkpoint candidates without walking every prefill chunk" — introduced the candidate-pricing loop #582 modifies, after a production GLM-5.3-Flash TP4 server ran its runtime thread at 96–100% CPU pricing checkpoints with GPUs idle. Makes reviewer Major #5 and the new
is_request_anchor_endpointcost a continuation of a known production pain. - #426 (merged, original-el8) rebased prefill service prices / fixed checkpoint interval pricing / guarded deferred TerminalPrefill; #354, #357 (yatesdr) established work estimation without storage quotes; #285 (dbotwinick) retains measured prefill costs after expiry; #479 (voipmonitor) added optional TerminalPrefill whose graph kind is what
terminal_prefill_window()prices. - #534 (open issue, semireg) "Checkpoint captures deadlock on an unmeasured snapshot cost" — mark-yong's reply names "a resumed prompt hitting
anchor <= startatcheckpoints.rs:416" as a transientunknown_costcase; that is precisely theelse ifarm #582 rewrites at:489–507. #534's own probe fix is gated oncheckpoint_extra_work_fraction > 0, so it is inert across #582's whole surface; mark-yong also says #534 likely belongs to the SM120 TP3 fork and "can probably be closed here". No overlap in intent, but it is the only open issue naming the touched branch. - #540 (open, same author) timing-refresh credit — different files, no semantic conflict.
- Nothing in #582 reverses #538 or #550; it does partially reverse an older documented invariant about best-effort anchor retention (see §7).
4. Recent activity
checkpoints.rs is currently the hottest file in the repo: on 2026-11-28 alone it took #568 (5deacda9), #550 (1364062c) and #582 (a3c64835), plus #569 (7cd83f32) and #426 (da578c5c) in the preceding days. The wider area saw seven main commits the same day (ba3afb13 #589, 9375d679 #502, 19c098c8 #506, 2bdc8472 #573, a54a8b8a, 70e0f4a8 #579, 1364062c #550, 7cd83f32 #569). #582 is based on 167f22c8, five to seven commits behind, and will need a rebase — the same append-tests-on-top collision #550 had to resolve.
#582 builds on #568's prefill_catalog_costs/protected-budget code and on #550's pricing rule, and reverses neither. Its doc edits rewrite sentences that predate both (see §7), so anyone reviewing the docs needs to know they change a design statement, not just wording.
5. People
- Author: FujitsuPolycom (CONTRIBUTOR; Discord "Dooner"). 7 merged / 7 closed / 11 open PRs in 180 days. Merged footprint is export/ignition/collective performance (#539, #508, #499, #498, #386) plus one Helios prefill-policy PR, #538. #538 shipped the pricing regression #550 had to repair in this same function two days earlier — directly relevant context, since #582's new pricing depends on
interval_prefill_nsbeing usable. Open PRs cluster in the same 2026-11-26..28 window (#584–#588, #580, #581, #540). - Reviewer: voipmonitor, priority contributor, author of TerminalPrefill (#479), reviews with live 4× RTX PRO 6000 SM120 runs.
- Frequent committers in the area (180 days): helios/src — lukealonso 216, Martin Vit 51, yatesdr 47; docs — lukealonso 375; verification/helios-lifecycle — lukealonso 9. None of them have engaged on #582, although lukealonso authored #568 (merged into this file 4 hours before the review) and closes competing PRs himself (e.g. #567 closed "in favor of #568").
6. Community
Exactly one item of engagement: voipmonitor's review at 2026-11-28 22:13, ~90 minutes after opening. No comments, reactions, or maintainer responses; no follow-up push (single commit is still the head).
Its verdict wording: "the motivation is solid, TLA+ conformance checks pass, and live 4× SM120 serving confirms the intended reduction in prefill splits at --scheduler-checkpoint-extra-work-fraction 0, but two bugs in checkpoints.rs cause duplicate RetentionRole::Anchor captures on normal multi-chunk workloads." Their runs: cargo test … --lib scheduler:: 390 passed / 0 failed; check.py (8 TLA+ models + mutations) PASSED; live 4× SM120 DeepSeek-V4.1-Flash TP4 at fraction 0 — 242-token 2-turn chat prefill_steps 2→1 (anchor_captures = 1), 12,212–12,232-token multi-chunk 2-turn 3→2 in all 5 runs (but flare_checkpoint_skips_total{reason="work_budget"} incremented 1..3 per request at fraction 0.0, confirming Major #5), 64K cold NIAH 71,429 tok at 59,453 tok/s.
Findings in brief: Blocker 1 duplicate Anchor on upward EWMA drift (known_whole latched at 512_000 ns vs live 512_300 ns → split reclassified as costly at the second chunk, second Anchor at the prompt end); Blocker 2 duplicate Anchor when Mixed prefill shifts alignment (fallback at start 0, zero-cost interior at start 256, fallback again at start 768); suggested fix = price whole/before/after from one catalog snapshot and latch an explicit (raw_anchor, chosen_anchor) that survives clear_reservations(); Major 3 is_request_anchor_endpoint hardcodes start 0 and checks the raw anchor before limits.snapshots == 0, so a partial prefix hit (baseline_start 88, raw_anchor 600) can promote both 600 and 1024; Major 4 clear_reservations() wipes anchor_fallback_from; Major 5 O(N) wasted pricing and spurious checkpoint_skip_work_budget at fraction 0; Minor 6 move the snapshots check, fix stale doc sentences, add regression tests for EWMA drift / Mixed / partial prefix hit / preemption, and replace the brittle string-literal mutation.
Notes on the review itself: the blocker 🅱reproducers are ready-made tests; and the reason the PR's own test missed Blocker 1 is that the new complete_test_step helper feeds dur_ns straight into gpu_ns[0] with 1_000 where a real 512-token prefill is 512_000, driving the EWMA down so saturating_sub clamps the split cost to 0 (which symmetrically makes genuinely costly splits look free).
7. Project fit
- Charter: "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." #582's own evidence is CPU suites plus TLA+ conformance; it explicitly states "Live signed-core serving and isolated GPU latency measurements remain unverified for this candidate." The served-workload evidence in the thread is the reviewer's, not the author's. - Charter merge bar: "PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs." There is no maintainer request and no linked issue; the reproducible measurement is the reviewer's live run, and no TTFT/throughput delta in ms or % is published for this PR anywhere — launch counts are the whole of the served evidence.
- Alignment: the change is in shared Helios scheduling with no per-model branching, consistent with "Keep the runtime small and model-agnostic".
- Docs vs behaviour:
docs/core-design.md:1439–1443(main) said anchor retention is "best effort and independent of duration estimates";docs/cli-design.md:703–708anddocs/scheduling-runtime-design.md:553–559said the same. #582 rewrites these to a priced rule at fraction 0 — a documented design invariant changes, which is why the undescribed doc edits matter. - Stale follow-ons remain: at head,
docs/core-design.md:1447–1453still says "Unknown prefill costs … exclude extras without excluding the anchor" and still gives 0.05 default framing, anddocs/scheduling-runtime-design.md:560–572still says "Unknown prefill costs … disable extras while preserving anchor eligibility" — inconsistent with the new "unknown cost ⇒ prompt end" rule the PR introduces (reviewer Minor #6; verified unchanged from main). - Narrow reach: the new branch is guarded by
checkpoint_extra_work_fraction == 0.0(checkpoints.rs:468,:396); default is0.05(helios/src/scheduler/policy.rs:39;helios/src/server/config.rs:333–338(not opened), default asserted atconfig.rs:728(not opened)). The zero-snapshot early return does change default-config deployments, but only those configured with 0 snapshot capacity.
8. Claims and evidence (verified vs claimed vs contradicted)
| Claim | Backing |
|---|---|
| "No checkpoint cuts when snapshot capacity is zero" | Verified in code (checkpoints.rs:460–462) and by the new test zero_snapshot_capacity_produces_no_cuts_and_never_splits_prefill. Narrower than it reads: pre-existing boundary_tests.rs:193 snapshot_capacity_does_not_disable_prompt_fallback_anchor already asserted checkpoint_anchor_captures == u64::from(snapshots > 0); the new part is that no cut/split is planned. |
| "Interior anchor only when pricing predicts zero extra work" | Verified (:467–511, anchor_split_is_zero_cost), covered by 3 new unit tests + 1 lifecycle test. Not covered: EWMA drift, Mixed realignment, partial prefix hit below the raw anchor, preemption/readmission — all four paths the reviewer reproduced. |
| "Avoids extra padded prefill launches" | Author: no served measurement (explicit limitation). Reviewer: prefill_steps 2→1 and 3→2 on 4× SM120. No ms/% delta anywhere. |
| "Preserves prefix reuse across single- and multi-chunk prompts" | Verified at unit level (new tests assert the prompt-end checkpoint is published as Anchor and hit as prefix, with Restore + Speculative and a promotion from Endpoint to Anchor). No served cache-hit number. |
| "Zero-cost aligned interior anchors remain eligible without a duplicate prompt-end anchor" | Tested for a linear aligned case (Part A of zero_fraction_aligned_interior_anchor_and_mixed_prefill_preserve_exact_contracts, 512 in 1024). Contradicted under the reviewer's non-linear/drift scenarios, which produce duplicate Anchors. |
| "Optional endpoint eviction … unchanged" | Contradicted indirectly: restore role tagging (scheduler.rs:1794) and promote_request_anchor (checkpoints.rs:753–776) can raise a checkpoint to Anchor, changing RetentionRank order and thus eviction. Undisclosed. |
Test-evidence claims (27 + 4 passed, pytest 312, check.py --mutations full) |
Consistent with the reviewer's wider scheduler:: run (390 passed, 0 failed). Two disclosed base failures (model::tests::packed_combined_budget_keeps_width_one_batches_without_a_useful_packed_shape, server::runtime::phase_tests::worker_observes_prefill_decode_and_prerequisite_timings) match pre-existing failures disclosed in #540 and #567. |
| Mutation covers the new fallback | Verified but brittle: exact 13-line string replacement requiring a single occurrence (check.py:326–342); breaks on reformatting. No TLA+ state added for anchor_fallback_from. |
9. Reach
- Who is affected: operators running
--scheduler-checkpoint-extra-work-fraction 0(a documented perf workaround, #335) and deployments withscheduler_checkpoint_snapshots/capacity set to 0; nobody at the 0.05 default through the new branch. - Config surface:
--scheduler-checkpoint-extra-work-fraction/[server] scheduler_checkpoint_extra_work_fraction(server/config.rs:333–338(not opened));limits.snapshots. - Metrics:
checkpoint_skip_work_budget(checkpoints.rs:783, visible asflare_checkpoint_skips_total{reason="work_budget"}),checkpoint_anchor_captures_total,checkpoint_endpoint_captures,checkpoint_extra_work_ns, andcheckpoint_anchor_guardsindirectly (guard only reserved for a cut below the anchor,:694–696). - Docs: three design docs edited (see §7) — user-facing description of the flag's semantics changes.
- Verification harness:
verification/helios-lifecycle/check.pygains one Rust mutation; the TLA+ model is unchanged.check.pyis also touched by open DRAFT #554, andcheckpoint_lifecycle_tests.rsby #568 — low conflict surface. - No dependency or deployment change, no re-export required (docs say so explicitly), no per-model impact.
10. Process
Opened 2026-11-28 20:45, reviewed 22:13 the same day; single commit a3c64835; branch based on 167f22c8, 5–7 commits behind main; no CI checks on the head commit; no labels (notably no triage:design-review, which #69 carried for the same design question); author has not yet responded to the change request; the PR body follows the charter's why/what/result/evidence format and names its candidate and base commits, including an explicit limitations line. The candidate link in the body points at the author's personal fork (FujitsuPolycom/flare-local-inference) at the same commit id as the PR head — redundant, not misleading. Verification was "in WSL2" only, no Linux-native or aarch64 run (unlike #550).
Open questions / not found
- No maintainer (lukealonso, yatesdr, iein, original-el8) has stated a position; #568's author owns adjacent code and has not responded.
- No served measurement from the author; the only served numbers are the reviewer's, and no latency/throughput delta is quantified for this PR.
- Whether the restore role-tagging change is intended as user-visible or an incidental consequence — the PR body does not say.
- Whether the new O(prompt)
is_request_anchor_endpointcost is acceptable at high lane counts: unmeasured, untested, and outside the planning memo scope. - #471 (open, joninco) mentions message-boundary/anchor effects on short system-line boundaries; its full text is not in the local copy and was not read — possible additional real-world corroboration.
- Nothing found: any linked issue, any roadmap entry covering this behaviour, any TLA+ model update for
anchor_fallback_from, any aarch64 or non-WSL verification, any label or CI run.