Case file: PR #660 — helios/scheduler: budget interior conversation-anchor splits against checkpoint_extra_work_fraction
PR: https://github.com/NVIDIA/hyperflare-inference/pull/660 · open, draft, base main, head 22cac91
Author: FujitsuPolycom (Discord "Dooner") · labels area:scheduling, bug, performance · no CI, no reviews, no comments
Size: 11 files, +740 / −127
Key findings
(Things a reader would not learn from the description.)
- The PR body circulates in two materially different versions. One (the orientation packet's copy) reports a "zero-re-export
flare runA/B on exact candidate22cac916834fvs5d53040e" withmixed-c32andBurst-8tables. The other (the body stored on the PR item, which is authority for the discussion) says the A/B ran "atop571a4471" — four merges old — and states outright: "Hardware A/B ran atop571a4471pre-#656… not re-run on22cac916834f". The two share the4× DGX Spark GB10line unchanged, but differ in every other table, in the headline workload (4×6-turn22.7K vs 22.0K), and in what trade-offs are disclosed. Only one body disclosesmixed-c32per-user p5093.9 → 71.0 tok/sand>250 msgaps215 → 434. A reader cannot tell which result table is current. (read_item(660)body vs orientation-packet body; item last updated one minute after opening, 19:03.) - Six existing test files/fixtures were changed to opt out of the new default behaviour, which the body covers only as "Updated … unit tests". This includes the widely shared fixtures
prefill_to_publication_boundary(helios/src/scheduler/tests.rs:3309,3315: durations rewritten to100_000 + capacity,checkpoint_extra_work_fraction: 1.0) andboundary_tests.rs:82(fraction: 1.0), plus the TLA+-conformance lifecycle test,policy_tests.rs,vision_window_tests.rsandhelios/src/server/runtime/phase_tests.rs. The tests had encoded the behaviour the PR calls a bug; coverage of the default0.05path now rests mainly on the new inline tests incheckpoints.rs. - Charging the anchor split spends headroom that used to fund optional captures. Previously the interior Anchor cut was pushed with
split_ns: 0and was never added toreserved_ns, so it consumed none of the allowance that gatesMessage/Endpointextras (checkpoints.rs:707-716). The PR's own rewritten assertion shows the trade:cuts == [256,512,640,768,896,1024],reserved_ns == 115becomes[256,512,768,896,1024],reserved_ns == 134— endpoint 640 is now dropped because "Anchor 896 adds 110 ns …, leaving 90 ns … 640 (split 90 + copy 1) exceeds the remaining budget". - An existing operator metric changes meaning without mention.
commit_checkpoint_plansaddscut.split_nstostats.checkpoint_extra_work_nsfor every committed cut (checkpoints.rs:903-907); before this PR the Anchor cut'ssplit_nswas hard-coded to 0, so anchor splits were invisible. Exposed ascheckpoint_extra_work_nanoseconds_total(helios/src/server/metrics.rs:852(not opened)).flare_checkpoint_skips_total{reason="work_budget"|"unknown_cost"}will also move. Neither body mentions metric movement. helios/README.md:372-380is stale after this change. It still says "Checkpoint selection prioritizes the last eligible message boundary, using the prompt end when no message boundary is eligible" with the allowance described only for "Earlier messages and a distinct prompt end" — not that the anchor itself is now gated by it. The three design docs underdocs/were updated; the README was not. By contrast, #655 (adjacent, open) did updatehelios/README.md.- There are two independent anchor-decision sites with different budget bases —
request_anchor_endpoint(checkpoints.rs:444-517:split_ns <= allowance(whole, fraction), ignoring already-spent work) andcheckpoint_selection_uncached(checkpoints.rs:578-618:allowance(initial_prefill_ns.unwrap_or(whole), fraction)plusextra_spent_ns). Thebudgeted_anchorlatch normally reconciles them, but they can diverge when the latch is absent. This is the same class of divergence that produced both blockers in #582's review (duplicateRetentionRole::Anchorcaptures). Flagged as a reviewer question, not a defect claim. - Certain rebase collision with #655. #655 (yatesdr, open, "Ready To Merge" per its autobot review) also rewrites
checkpoint_selection_uncachedand the snapshot-cost gates incheckpoints.rs(+217/−18 there). Neither PR mentions the other. #654 and #663/#661 touch scheduler-adjacent code as well.
1. The change
In plain terms. A "conversation anchor" is the checkpoint Helios keeps at the last message boundary inside a prompt so the next turn can re-prefill only from there. Prefill runs in fixed graph shapes, so cutting at an arbitrary interior boundary can cost an extra, padded prefill launch. checkpoint_extra_work_fraction (default 0.05) exists to bound such extra work to a fraction of the request's productive prefill cost. Before this PR, that bound applied to optional captures (Message, Endpoint) but not to the anchor: at fraction == 0.0 the anchor was kept only if anchor_split_is_zero_cost (per #582), while at any nonzero fraction, including the default, request_anchor_endpoint returned raw_anchor unconditionally and the planner pushed Cut { role: Anchor, split_ns: 0, copy_ns: 0 } without charging anything. The PR removes that exemption for all fractions >= 0.0.
Verified in the diff and head source:
| Element | Where |
|---|---|
anchor_split_is_zero_cost() -> bool → anchor_split_ns() -> Option<(u64,u64)>, returning (whole, before+after−whole) |
checkpoints.rs:430-442 (diff hunk @@ -427,28 +427,18) |
request_anchor_endpoint loses the checkpoint_extra_work_fraction != 0.0 || short-circuit |
checkpoints.rs:449 (diff @@ -456,13 +446,10), budget check at :500-516 |
zero_budget_anchor → budgeted_anchor (private field of pub struct CheckpointAccounting) |
checkpoints.rs:28; all uses :452,602,605,611,616,874,876 |
Planning decision runs for all fractions (if raw_anchor < request.prompt_tokens, no fraction == 0.0 gate); keeps raw_anchor iff split_ns == 0 || extra_spent_ns + split_ns <= allowance(initial_prefill_ns.unwrap_or(whole), fraction), else prompt_tokens |
checkpoints.rs:572-601 |
Unknown timings: None if fraction > 0.0 => (raw_anchor, 0); otherwise prompt end |
checkpoints.rs:599-600 |
Charging: reserved_ns += anchor_split_ns and Cut { split_ns: anchor_split_ns, copy_ns: 0 } |
checkpoints.rs:619-627 |
| New early-return guard preserving an unreached, already-charged Anchor cut | checkpoints.rs:533-546 |
Optional candidates filtered by end < raw_anchor (was end < anchor); Endpoint only offered when prompt_tokens != anchor |
checkpoints.rs:645,648 |
promote_request_anchor latches budgeted_anchor at every fraction (the fraction == 0.0 && conjunct was deleted) |
checkpoints.rs:867-877 (diff @@ -854,17 +864,16) |
Size accounting. pr_files confirms 11 files / +740/−127. checkpoints.rs is +626/−78, of which the production hunks total roughly +60/−51 and the remainder is inline mod tests (the "prod LOC" figure of "+9 net" in one body version counts the guard hunk as a net add; ~40 lines genuinely change). Docs: docs/cli-design.md, docs/core-design.md, docs/scheduling-runtime-design.md (+41/−36 total). verification/helios-lifecycle/check.py +2/−2 (mutation target string only). No flag, config key, Protobuf/ABI or unsafe appears in the diff — consistent with the body.
What the description says that the diff does not quite do. The body says the tests were "updated"; the reality is that existing fixtures were re-parameterised (finding 2), and one existing test's scenario was rewritten wholesale (exact_system_and_prompt_checkpoints_publish_only_after_snapshot_completion now uses prompt_len = prefill_chunk_size + 3 with a chunk-aligned boundary instead of prompt 13 / boundary 10, so the anchor lands where the budget accepts it).
2. The why
The complaint is old and documented in-repo:
- #69 "Absorb a short final message segment into the prefill chunk" (original-el8, opened 2026-10-24, closed 2026-11-26 for inactivity, +97/−33) measured on 4× GB10 Sparks at 8K prompts: a 3-message prompt with a short final message took 1,908 ms TTFT vs 1,725 ms for one message of equal length. Its review said the
(capacity/16).clamp(64,512)threshold "re-decides, in tokens, whatcheckpoint_extra_work_fractionalready prices in nanoseconds … fold the threshold into the existing allowance instead of adding magic constants" — which is what #660 does. #660 is the surviving general form of #69's idea. - #426 (original-el8, merged) covers "a slow padded prefill tail (for example a 2-token prompt tail after an anchor…)" — earlier interval-pricing work on the same cost.
- #582 (same author, merged 2026-11-29) fixed only the
fraction == 0.0arm and explicitly left nonzero fractions keeping the boundary unconditionally — that is the discontinuity #660 reports. - #292 (iein, closed 2026-11-18) is the opposite-direction user report on the same knob: with
0.05on 4× DGX Spark GB10 / GLM-5.3 Flash, 11work_budget+ 14unknown_costskips lost branch reuse; at0.25, reuse of ~4,010 tokens returned and TTFT fell 1.46 s → 0.22–0.32 s. Closed as "a deployment setting". Evidence that default-fraction checkpoint behaviour has been user-visible since mid-November. - #335 (yatesdr, closed) recommended
--scheduler-checkpoint-extra-work-fraction 0as a production workaround (DeepSeek V4.1 TP4) — operators are already told to change this knob. - #663 (yatesdr, open) independently names the same residual cost: "204 uncached tokens cut at 202 into a main chunk, a boundary Snapshot, and a 2-token tail … the prompt suffers a double stall", and calls #660 complementary.
The framing the docs support: docs/core-design.md and docs/scheduling-runtime-design.md:614-638 state that extra captures consume a request-local work allowance; #660 makes the anchor obey the rule it was previously exempt from.
3. Related work
Supersedes / finishes: #582 (merged, same author) — introduced anchor_split_is_zero_cost, zero_budget_anchor, and the fraction == 0.0 gate #660 removes. #660 reuses #582's latch and same-snapshot pricing, and rewrites the doc sentences that stated nonzero-fraction anchoring is "best effort and independent of duration estimates".
Builds on: #645 (merged 2026-11-30, lukealonso) prefill scheduling/cost overhaul (interval_prefill_ns, the catalog this pricing needs); #568 (merged, role-based Endpoint eviction / Anchor guard rows); #459 (merged, cached selection walk); #613 (merged, deferred_prefill checkpoints).
Parallel / competing edits to the same code:
- #655 (yatesdr, open, Ready-To-Merge): retains measured snapshot cost after expiry, discovers unmeasured cost once; rewrites
checkpoint_selection_uncached,checkpoint_copy_allowed,allocate_terminal_captureto useActionCosts::measured_durationinstead offresh_duration. In #660's head,checkpoint_selection_uncachedstill callsself.costs.fresh_duration(GraphKind::Snapshot, 1)(checkpoints.rs:634). One will need a rebase. - #654 (logprobz, open): "Add opt-in first-output age pricing and returning-agent benchmark", also touching
checkpoints.rs. - #663 / #662 (yatesdr; #663 open, #662 closed): price first-output waiting age on incumbent decode rounds; #663 explicitly cites #660 as complementary and says it avoids the opt-in knob of #654.
- #661 (same author, open draft, opened ~15 min after #660): "explore smaller prefill chunks under active age-priced streams", +1,274/−87, same
571a4471-based A/B limitation.
Full file map of checkpoints.rs authors (items_touching): #660 (open), #654 (open), #655 (open), #645, #582, #613, #550, #568, #426, #479, #459, #415, #357, #354, #285.
Checked and judged not relevant: #534 and #600 are fork-specific (AzallazA/hyperflare-inference, PrefillTailMerge), rebutted upstream; #534 concerns unmeasured snapshot cost (the #655 problem), not anchor budgeting.
4. Recent activity
checkpoints.rs is rewritten roughly every 1–3 days: #645 (11-30), #582 (11-29), #613 (11-29), #550, #568, #426, #479, #459, #415, #357, #354, #285 earlier in November. Last main commits in helios/src and docs: a3c80e19 (#657), 5d53040e (#628), e8a3a7c7 (#656), cd1daa3e (#638), a4720050 (#625), e85019b9 (#645), bf7562ae (#646), f2ca2c41 (#647).
- #660 builds on rather than reverses: #582's latch + same-snapshot pricing, #645's cost model, #568's role-based eviction, #459's cached walk.
- It deliberately supersedes one #582 behaviour (uncharged interior anchor at nonzero fraction) and rewrites the corresponding doc text.
- Between the A/B base
571a4471and the PR head, #656 (conditional speculative acceptance, acceptance-probe charging, merged 2026-12-01) and #628 (offload Copy Engine gating) landed. The body's only defence is "0checkpoints.rsedits in571a4471..5d53040e", which does not exclude effects from those merges. verification/helios-lifecyclewas last changed by #645 and #582; #660 touches only one mutation string there.
5. People
- Author: FujitsuPolycom, CONTRIBUTOR; 15 merged / 11 closed / 3 open in 180 days; merged work in
docs(10),helios/src(10),heliopause/src(4),ignition/preparation(4). Pattern: ships ambitious drafts (#585, #584, #583, #588 all self-closed after review, #585 explicitly "split into smaller single-concern PRs"), takes heavy review, then lands smaller pieces (#586, #587). #582 — the direct predecessor here — went through three review rounds before merge. - Reviewers of record for this exact code: voipmonitor and lukealonso (repo owner). On #582, voipmonitor requested changes (2 blockers: duplicate
RetentionRole::Anchorcaptures from EWMA drift atcheckpoints.rs:364-388,466-505and from Mixed-chunk realignment; lukealonso's round found a stale-latch interior split after real preemption at 1024→1124). Both rounds found genuine defects in this same prefill-anchor logic. - Others active in the scheduler right now: lukealonso (235 commits in
helios/srcin 180 days), Martin Vit (52), yatesdr (48), plus logprobz (#654) and original-el8 (#69).
6. Community
Zero engagement: no comments, no reviews, no inline comments, no reactions. related_items shows no discussion. The only signal is indirect — yatesdr's #663, opened 38 minutes after #660, cites it as complementary ("addresses when interior conversation-anchor splits should be budgeted against checkpoint_extra_work_fraction"), i.e. one peer has read and accepted the framing. No autobot review has been triggered, unlike #582 (autobot case file + review) and #655 (two autobot reviews, last "Ready To Merge").
7. Project fit
Lines up:
- Charter line 12 ("keep the runtime small and model-agnostic") — the change adds no per-model branch, no flag, no knob; it reuses an existing, already-documented allowance.
- Charter line 35 ("PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue") — it addresses a measured cost with a reproducible scenario and an explicit predecessor review request (#69).
- Charter "Bring real evidence" / "PR descriptions: expect four parts" — the body has why/what/result/evidence sections.
docs/design-review.md:209-228requiresverification/helios-lifecycle/check.pyfor changes to snapshot aliases / reservation accounting; it was run and its mutation target updated (check.py+2/−2).
Does not line up / unanswered:
docs/design-review.md:234-240, 247-251: "Never touch covered code without running and updating its simulator and formal checks… Leaving an applicable crate test, simulator sweep, TLA+ conformance run, or Kani proof unrun blocks commit and PR acceptance; noting it as a limitation does not make the omission acceptable." The body declareskaniand gated templates unrun, and says nothing at all aboutscripts/scheduling_sim(which contains no checkpoint/anchor modelling, so it is arguably N/A — the argument yatesdr makes explicitly in #655 and this PR does not make).docs/design-review.md:294-311requires aDesign-Signed-Off-By: <identity>; design-review=<4 hex>trailer on the final commit (enforced bytests/test_design_review_hook.py). Trailers for22cac916could not be read here; #582's thread shows lukealonso does check this digest in practice.- Tension with the "no new knobs" spirit is nil, but the change alters the effective default (see Reach) — which the charter's "Supported matrix & compatibility" line (line 42) would want checked across models, cache schemes and parallel layouts.
8. Claims and evidence
Verified from the diff/source: all six structural bullets of the body (see the table in §1), the file/LOC counts, the absence of flags/ABI/unsafe, the docs updates, and — for one of the two predecessors' invariants — the new guard and its two tests (anchor_only_multi_chunk_prefill_preserves_split_cost_and_budget, default_fraction_anchor_guard_revocation_preserves_charged_anchor_split).
Author-reported only (no CI on the head commit, no review):
- Every benchmark table. Whichever body is current, one A/B ran on a four-merge-old base and is self-declared "not re-run on
22cac916834f". No run-to-run variance or repeat counts are given, so deltas like "+23.7% Out" or "−58% TTFT" cannot be assessed for noise. One disclosed workload regression:mixed-c32per-user p5093.9 → 71.0 tok/sand>250 msgaps215 → 434(only in one body version). - Test/verification counts:
heliosserver 1,274;runtime-core,server1,785;flare238;flare-cli239;heliopause check;pytest832;ruff 0.12.8;check.py10/10 TLC, 8/8 Observed / 594,065 edges, 12/12 aux; "0 new--releasewarnings". - The premise measurement ("
Prefill(128) = 18 msvsPrefill(512) = 29 ms… splitting a 453-token prompt at 450 adds an 18 ms tail") is an input hard-coded into the new testdefault_fraction_budgets_interior_anchor_splits_and_preserves_prefix_and_terminal_captureatcheckpoints.rs(test section ~:4200-4218). The test reproduces the arithmetic consequence of that premise, not the premise's measurement. - The
None if fraction > 0.0 => (raw_anchor, 0)unknown-cost arm (checkpoints.rs:599) has no obvious new test in the diff; older tests cover the zero-fraction unknown-cost fallback.
Premise folded into the harness: because the shared fixtures now set checkpoint_extra_work_fraction: 1.0 (tests.rs:3315, boundary_tests.rs:82), the fixture defaults no longer exercise the changed default path.
9. Reach
- Every deployment at the default.
checkpoint_extra_work_fractiondefaults to0.05(helios/src/scheduler/policy.rs:40, asserted athelios/src/server/config.rs:732(not opened)), so this is a behaviour change for anyone who never set the flag, not an opt-in refinement. No flag, key or default is added or changed. - Configuration surface: validated as finite and in
[0,1]inpolicy.rs:210-211,flare/src/configuration.rs:81-83(not opened),helios/src/server/config.rs:321-324(not opened); CLI plumbing atflare-cli/src/cli.rs:700 (not opened), 1350-1354, 1415,flare/src/settings.rs:31 (not opened),68-71,209,flare/src/controller.rs:2880-2881(not opened). - Metrics:
checkpoint_extra_work_nanoseconds_total(helios/src/server/metrics.rs:852(not opened); sourceRequestScheduler::stats().checkpoint_extra_work_ns,helios/src/scheduler.rs:142(not opened)) now includes anchor split time for the first time (checkpoints.rs:903-907);flare_checkpoint_skips_total{reason}and prompt-checkpoint counters move as extras compete for the allowance. - Trade-off beyond the description: an anchor is now "split-priced but copy-free" — its snapshot copy stays uncharged (
copy_ns: 0, documented in all three docs). The cost of retaining the anchor is subtracted from what remains forMessage/Endpointextras (finding 3). The new testdefault_fraction_budgets…shows the 453-token case keeping the terminal capture "must remain funded under default 0.05", while another new case consumes the allowance to the exact nanosecond (22,500,000 of 22,500,000). - Docs:
docs/cli-design.md:696-710,docs/core-design.md:1434-1460,docs/scheduling-runtime-design.md:614-638updated;helios/README.md:372-380not updated (finding 5). - Compatibility: exported/signed cores serve unchanged (no export or wire change in the diff); consistent with the body, though not independently testable here.
- Deployment risk: rebase conflict with #655 is close to certain (same function, same file).
10. Process
Draft; opened and last updated 2026-12-01 19:02/19:03; same-day age. No CI checks on the head commit. No reviews, no comments, no triage label (triage:review is absent, while #582 and #655 carry it). The repo's Design-Signed-Off-By trailer could not be verified. Landing in draft with no CI and two circulating bodies means every result in this file should be treated as provisional.
Open questions for whoever decides
- Which PR body is authoritative — the
571a4471-based A/B ("not re-run on22cac916834f") or the exact-candidate22cac916834fvs5d53040etable? The two do not agree on workloads, deltas, or disclosed regressions. - Is the
mixed-c32per-user regression (93.9 → 71.0 tok/s,>250 msgaps215 → 434) an accepted trade for+96.2%batch throughput, or a control that should block? - Should the two anchor-decision sites (
request_anchor_endpointatcheckpoints.rs:509vs the planner at:588-597) share one budget basis? They differ whenever thebudgeted_anchorlatch is absent. - Is the loss of late interior
Message/Endpointextras (the diff's own[256,512,640,768,896,1024]→[256,512,768,896,1024]assertion) intended and acceptable, and should the README say so? - Sequencing against #655 (same function, Ready-To-Merge): which lands first, and does #660 need re-basing and re-A/B before review?
What could not be found or verified
- No runnable evidence: no CI on the head commit, and this case file ran no builds, tests or benchmarks. All suite counts and benchmark deltas above are author-reported.
- Commit trailers (DCO sign-off,
Design-Signed-Off-By: …; design-review=<hex>) for22cac916were not readable here, sodocs/design-review.md:294-311compliance is unknown. - No maintainer statement on record about this specific change; no review, no comments, no triage. The only third-party mention is #663's one-line framing of #660 as complementary.
scripts/scheduling_simhas no checkpoint/anchor modelling, so simulator coverage is plausibly N/A — but the PR body does not argue that, and no one has confirmed it for this change.- The 4,657-line
checkpoints.rswas not read in full: verified are the hunks this PR touches plus their immediate callers (plan_checkpoints,commit_checkpoint_plans,promote_request_anchor,revoke_unused_anchor_guards,allocate_terminal_capture's neighbour).