Pre-test report — PR #582 helios: avoid splitting prefill on zero-budget checkpoint anchors
Author: FujitsuPolycom · Head: a3c6483 · Base: main · Diff: 7 files, +931/−16
Recommendation: DO NOT REFER TO HARDWARE TESTING YET. Send it back to the author. Re-review the restructured version first; a small, sharply-scoped hardware test should follow only after the anchor decision is made one stable, priced field — because the hardware-observable behaviour this PR owns (how many Anchor captures a request makes, and whether a prefill gets split) is the exact behaviour the current code is known to get wrong.
Expected value of hardware testing now: near zero. It would burn a 4-GPU box to characterise numbers that the required fix will invalidate, and the metrics a tester would use as evidence are themselves currently wrong.
1. What the change does, and whether it is testable at all
Scope is right: anchor/snapshot selection is shared Helios scheduling and cache policy, nothing branches on model identity, and the underlying concern is real — with snapshots == 0 no snapshot row can ever be reserved, so the old code selected cuts whose captures could never be armed; and at scheduler_checkpoint_extra_work_fraction == 0 the work allowance is 0, so a padded prefill split is unfundable. That part (checkpoints.rs:460-462, placed after initial_prefill_ns is priced so unmeasured-cost accounting still works) is correct and should be kept in any rewrite.
Two caveats that bound any test plan:
- The change is inert at defaults.
scheduler_checkpoint_extra_work_fractiondefaults to0.05(ignition/cli/config.py:39(not opened),docs/cli-design.md:1366,helios/src/server/config.rs:728), so an operator only reaches the new code by explicitly setting0, or by havingsnapshots == 0. A test must set the fraction to0explicitly or it measures nothing. - The changed path requires chat-template multi-turn prompts.
message_boundariesis derived from the rendered frontend prompt (helios/src/server/request.rs:300(not opened)); the boundary must lie strictly interior and inside a chunk. A plain-text prompt yields no interior anchor and the new code never runs.
2. The defects are not gatekeeping symptoms — they are actual defects in the reviewed code
I read the head source directly; the review findings reproduced. These are behavioural, on the normal path, not nits:
- Duplicate
RetentionRole::Anchorcaptures under ordinary timing drift —checkpoints.rs:364-388with:471-473/:498-500.anchor_split_is_zero_costcompares freshly pricedbefore/afteragainst the cached EWMAaccounting.initial_prefill_nspassed asknown_whole. Under upward driftbefore + after − whole != 0, so the anchor flips to the prompt end after the interior anchor was already published — a second anchor capture for one request. - Duplicate
AnchorwhenMixedprefill shifts chunk alignment —checkpoints.rs:489-507. One policy question is priced from three different origins:start=consumed_tokens(:474-482),baseline_start(:491-501), and a hardcoded0inis_request_anchor_endpoint(:411-419). Once prefill passes the boundary, branch A is no longer reachable and branch B re-prices a longer interval, so an unchanged cost can yield a changed verdict. - The latched decision is destroyed on readmission —
clear_reservations()setsanchor_fallback_from = None(checkpoints.rs:48-52) and is called on the accounting that admission deliberately carries across preemption/readmission (scheduler.rs:1722-1726). Preemption therefore re-derives the anchor from a freshconsumed_tokens; same request, same prompt, possibly a different anchor, orphaning the previously captured prompt-end anchor. - A third, unmemoised price model on the commit hot path —
is_request_anchor_endpoint(:390-420) rebuildsprefill_catalog_costsand walks the full0..promptinterval, bypassingcheckpoint_selection_cached/SelectionCache. It is called per lane on every commit (scheduler.rs:2411→checkpoints.rs:763) and on every inbound admit (scheduler.rs:1794). This is a CPU-side cost regression on the model-serving critical path, and it would be easy to mis-blame on the GPU during testing. - The evidence metric is self-contradictory today — at fraction
0,anchorfalls back toprompt_tokens, so every message boundary still enterscandidates(:529-539) and is priced withavailable == 0(:528), settingbudget = true(:603) →stats.checkpoint_skip_work_budget(:782-783) →flare_checkpoint_skips_total{reason="work_budget"}(metrics.rs:501,:847). The reviewer saw this fire live atfraction == 0.0. A tester checking that counter would read a correctly behaving policy as a failure.
Additionally, plan_checkpoints (:671-685) reconstructs the anchor a fourth way, and the anchor Cut is pushed with split_ns: 0, copy_ns: 0 (:512-519), i.e. never charged through allowance() — so the zero-fraction regime is a magic == 0.0 branch (:467-468) rather than a natural limit of one policy. The architecture and simplicity lenses both conclude the fix is smaller than the current diff (the subtractive lens estimates ~410 of 931 lines removable, including ~95 production lines that collapse into one resolved_anchor()), so this is not a case of the reviewer demanding more work than the author already did.
Why "the tests pass" carries no weight here: the author's own suite drives complete_test_step with dur_ns of 1_000–1_000_000 against 512,000-ns-class costs (checkpoints.rs:2355, 2746, 2826, 2841), so saturating_sub clamps and the EWMA-drift defect is structurally invisible. The green run is not evidence about the riskiest property.
3. Also not yet fit to test
- Docs now specify a rule the code does not satisfy.
docs/core-design.md:1436-1445,docs/cli-design.md:703-708anddocs/scheduling-runtime-design.md:553-559all state the zero-fraction rule as fact; the code violates it on exactly the two reproducers above.helios/README.md:372-379is a fourth copy of the same spec and was not updated — it still says "prioritizes the last eligible message boundary" unconditionally. Two further sentences (docs/core-design.md:1452-1453,docs/scheduling-runtime-design.md:570-572) still claim unknown prefill costs never exclude the anchor, which is false at fraction zero sinceanchor_split_is_zero_costreturnsfalseon an unknown price. - Zero-regression evidence for the trade-off the PR makes. At a zero budget the anchor moves from the last message boundary to the prompt end, so reuse now depends on the exact continuation: regenerate/branch/tool-retry turns may stop hitting the checkpoint they used to. Nothing in the PR measures or even mentions this, though reuse loss is a plausible real regression.
- Evidence bar.
docs/design-review.md:106-115(principle 12) requires actual Helios service measurements for a performance claim, and the PR itself says "Live signed-core serving and isolated GPU latency measurements remain unverified." The only served evidence is the reviewer's. One nuance the architecture lens overstates: I checkedscripts/scheduling_sim/and it contains no checkpoint/anchor modelling at all (grep forcheckpoint|anchor|snapshotfinds only EWMAsnapshot()accessors intiming.py(not opened)/learning_policy.py(not opened)), so the demanded simulator sweep cannot evaluate this policy as written; the actionable evidence gap is the served-workload measurement. CI never ran on the head; the author reports two pre-existing base failures rather than a clean run.
4. Minimal hardware test plan — conditional, to be run only after the restructure
Do not run this now. Run it against the fixed head. It is deliberately small: one box (cn5), one model, two configurations, one probe. cn7 adds nothing — this is pure scheduler/cache policy with no CUDA, kernel or architecture-specific code, and cn5's RTX PRO 6000 Blackwell is the same SM120 class as the reviewer's 4× rig where the benefit was already demonstrated, so an architecture-extension test is not needed.
Gate 0 — probe (≈15 min, do not proceed if it fails). On main, at the default fraction 0.05, serve one multi-turn chat request with a message boundary strictly interior to the prompt (≥2 turns, prompt comfortably larger than prefill_chunk_size; SM120 record/replay core as usual) and confirm flare_checkpoint_captures_total{role="anchor"} increments. If it stays 0 on that model/core, the anchor path is not exercised by serving at all and the whole A/B is void — stop and report, do not fall back to guessing.
Test 1 — the PR's own claim, A/B on the same box (the only test that should get GPU time).
Same prompt set, A = main, B = PR head, both with --scheduler-checkpoint-extra-work-fraction 0.
- Prompt set (small, ~4 cases × 5 repetitions, single-stream): (i) short multi-turn chat whose interior boundary is not chunk-aligned; (ii) multi-turn prompt spanning ≥2 prefill chunks with an interior boundary; (iii) a prompt whose boundary is chunk-aligned (the "zero-cost aligned anchor stays eligible" case); (iv) a plain no-boundary prompt as a control that must be unchanged.
- Assert on B vs A, per request:
flare_sampling_graph_launches_total{kind="prefill"}drops by exactly 1 on (i) and (ii) and is unchanged on (iii) and (iv);flare_checkpoint_captures_total{role="anchor"}is exactly 1 per request (this is what catches both duplicate-anchor blockers);flare_checkpoint_skips_total{reason="work_budget"}is 0 at fraction 0. - Report TTFT and prefill tok/s from the same runs. Use
scripts/benchmark_prefill.py(--url,--tokens) for the token-rate leg; it drives the served endpoint.
Test 2 — prefix reuse, same runs, no extra cost. Over the same A/B, compare flare_cache_hits_total and flare_cache_reused_tokens_total (metrics.rs:1115/:1120) plus flare_snapshot_publications_total. Send each conversation twice (identical prefix) so reuse is measurable. This is the regression the PR most plausibly introduces; it is free because it rides on Test 1's runs.
Test 3 — preemption/readmission, only if it can be triggered deterministically. The latch is cleared by clear_reservations() on readmission, so a request preempted after its anchor commits may re-derive a different anchor. Drive it by admitting more concurrent long-prompt requests than request_slots allows (forcing park/admit) and assert one Anchor capture per request. If it cannot be triggered reliably in ~30 minutes, skip it — a unit test with realistic timing values is the better guard, and that test is part of what the author must add anyway.
Explicitly out of scope — do not spend hardware time on: nonzero-fraction behaviour (unchanged by this PR); snapshot eviction ranking (#568 territory, though note the inbound role-tagging change at scheduler.rs:1794 does touch it — cover it with a unit test, not a GPU run); the 16-request batching test's 2-second synthetic wall-clock bound (meaningless on hardware); anything on cn7; any multi-hour soak or throughput sweep — the effect is one prefill launch per request, which shows up immediately or not at all.
Baseline hygiene: measure main and the PR on the same box in the same session, and record the exact base commit. Because no CI ran on the head and the branch is behind main, an unexpected launch count or capture count must be attributable — the A/B form above is what makes that possible.
5. Bottom line
The problem is real, the layer is right, and the author's zero-capacity guard plus the core idea are worth keeping. But the current head gets the anchor decision wrong in three places for the same request, puts a new unmemoised pricing walk on the per-commit path, and leaves the very metric a tester would use reporting a false failure. Testing this build would produce numbers that the required restructure discards. Refer to the author with the consolidation prescription (one latched, priced anchor decision per request; check snapshots == 0 first; stop clearing the decision in clear_reservations; reuse the existing split-price expression; early-return at fraction 0), then re-review, then run the single conditional A/B above on cn5. When it comes back fixed, the hardware cost of validating it is genuinely small — one box, two configurations, about four prompt shapes, with reuse measurement riding along for free.