Recommendation: Ready To Merge
Head cf744df cleanly resolves both Should Fix items, all three Subtract / Simplify suggestions, and all three Nits from the prior review (22cac91), while keeping the production diff tight (+95/-60, +35 net production LOC in helios/src/scheduler/checkpoints.rs, zero unsafe, zero new flags/ABI). Anchor-split affordability is now shared between request_anchor_endpoint and checkpoint_selection_uncached, all four doc sites are aligned, and verification covers unit/contract tests, TLA+/Observed lifecycle conformance, mutation testing, and served 4× RTX PRO 6000 A/B workloads. No blockers or should-fix defects remain; only minor optional test/doc cleanups are noted below.
Merge Risk
Level: Medium
- Default-path behavior shift (
0.05): Changes interior conversation-anchor retention under the shipped defaultcheckpoint_extra_work_fraction = 0.05, falling back to the zero-split prompt end when splitting at an interior message boundary exceeds the request's extra-work allowance and charging retained interior anchor splits against the shared allowance (while leaving the anchor snapshot copy uncharged). Trade-offs (mixed-c32per-user p5093.9 -> 71.0 tok/sat higher concurrency,>250 msgap count215 -> 434, and<think>-stripping clients on single-chunk 4.5K–13.7K prompts) are explicitly measured and disclosed. - Clean concurrency and hot-path footprint:
RequestSchedulermutates through&mut selfwith a per-planRefCell<Option<SelectionCache>>(helios/src/scheduler/checkpoints.rs:11-19,138-141,414-432);promote_request_anchorlatchesbudgeted_anchorforO(1)decode-step fast paths (STRIDE_RUNS == 0); no new locks, wire/ABI changes, or model core re-exports are introduced. - Expected rebase with open #655: Open Ready-To-Merge PR #655 modifies
checkpoint_selection_uncached(fresh_duration->measured_durationatcheckpoints.rs:666,1000,1067) and the same four documentation files; the changes are orthogonal and straightforward to rebase depending on merge order.
Walkthrough
helios/src/scheduler/checkpoints.rs(:28,96-98,434-467,469-547,554-728,883-912): Renamedzero_budget_anchor->budgeted_anchor; extractedanchor_split_affordable,split_overhead_ns, andanchor_split_ns; wired bothrequest_anchor_endpoint(:534-539) andcheckpoint_selection_uncached(:618-629) to checksplit_ns == 0 || extra_spent_ns + split_ns <= allowance(initial_prefill_ns.unwrap_or(whole), fraction); charged retained interior anchorsplit_nstoreserved_ns/extra_spent_ns/checkpoint_extra_work_ns(copy_ns: 0); preserved charged unreachedAnchorcuts across multi-chunk steps andrevoke_unused_anchor_guards()(:563-576); filtered earlierMessagecuts byend < raw_anchor(:677); generalizedbudgeted_anchorlatching inpromote_request_anchor(:893-903).helios/src/scheduler/checkpoints.rs(:1556-4771): Updated anchor-split budget assertions and added six isolated end-to-end tests covering default0.05SM120-like catalogs, guard revocation, C=16 single-launch prefill batching, multi-chunk charged-anchor preservation,split_ns == 0retention whenextra_spent_ns > available, and unlatchedrequest_anchor_endpointvs.checkpoint_selectionagreement (:4203-4771).helios/src/scheduler/{tests.rs,boundary_tests.rs,checkpoint_lifecycle_tests.rs,policy_tests.rs,vision_window_tests.rs}&helios/src/server/runtime/phase_tests.rs: AddedSTANDARD_PREFILL_CAPACITIESandpermissive_checkpoint_costs(tests.rs:161-184) for synthetic flat-cost mechanical fixtures; alignedphase_tests.rs:1542-1546toprefill_chunk_sizeto stay on default0.05; renamed stalezero_budgetlifecycle test names/messages.docs/{core,cli,scheduling-runtime}-design.md(not opened),helios/README.md,verification/helios-lifecycle/check.py: Synchronized normative and summary docs for budgeted interior-anchor retention, split charging, uncharged anchor copy, and unknown-cost behavior; updated thebudgeted_anchormutation target incheck.py:673-676.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure scheduler cost-accounting arithmetic, tests, and docs; no I/O, parsing, FFI,
unsafe, or untrusted-input surface added. - [PASS] Charter & value fit: Model- and core-agnostic, zero new flags/config/ABI, removes a special-case discontinuity in the right runtime layer, backed by served
flare runA/B evidence and synchronized docs. - [WARN] Related / duplicate / conflict check: Cleanly finishes #582 and complements merged #663, but overlaps directly with open Ready-To-Merge #655 in
checkpoints.rsanddocs/; coordinate merge order / rebase cleanly. - [WARN] Tests & verification evidence: Isolated CPU tests exercise real
admit/plan/commit/completepaths,check.py(TLC + Observed +checkpoints.rsmutations) passed oncf744df,scripts/scheduling_sim/kaniare accurately noted N/A, and4× RTX PRO 6000A/B ran on22cac916834f(identical cold-request math, transparently disclosed inLimits). Confirm green GitHub Actions CI oncf744dfbefore merge.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Remove unreachable
configure_policy(0.5)block in new test (helios/src/scheduler/checkpoints.rs:4363-4368):default_fraction_anchor_guard_revocation_preserves_charged_anchor_splitconfigurescheckpoint_extra_work_fraction: 0.5and immediately overwrites it with0.279at:4375-4380after onlymeasure(...)calls, with no admission or selection in between. Deleting:4363-4368removes 6 dead lines without affecting behavior. - Optional — extract a shared
stepped_coststest helper (helios/src/scheduler/checkpoints.rs:4369-4372,4510-4513,4625-4628,4688-4691): Four of the new tests repeat the identical[(128, 100), (256, 110), (512, 200)]prefill measurement loop with only theSnapshotduration varying; a smallfn stepped_costs(scheduler: &mut RequestScheduler, snapshot_ns: u64)besidelinear_costs(:1151) would deduplicate them cleanly. - Optional — trim
helios/README.md:374-386to delegate normative detail:docs/scheduling-runtime-design.md:614-621concisely summarizes the rule and delegates todocs/core-design.md#exact-endpoint-capture, whereashelios/README.md:374-386restates the full normative clauses right before its existing link to../docs/core-design.md#exact-endpoint-capture(:390). Keeping a 2–3 sentence summary in the README would reduce future doc-drift surface.
Nits
- Doc line wrap:
docs/cli-design.md:699,708anddocs/core-design.md:1457run ~93–130 columns inside ~85-column wrapped paragraphs. - Latch readability: If
budgeted_anchor: Option<(usize, usize, usize)>(helios/src/scheduler/checkpoints.rs:28) is touched again in a follow-up, a tiny helper method or named struct (BudgetedAnchor) would avoid open-coding the 3-tuple match at:477-482and:637-640.
Dropped on verification
- Upstream claim that
request_anchor_endpointandcheckpoint_selection_uncacheddiverge mid-prefill (checkpoints.rs:483-541vs:562,610-635): Disproved on both arithmetic and lifecycle grounds. The cited counterexample miscomputed[512, 1024]as 400 ns (two 512-token chunks) instead of 200 ns (one 512-token chunk), yielding a bogus-90 -> 0split when the actual split is210 + 100 - 200 = 110ns (identical to[0, 1024]). Moreover,budgeted_anchoris latched during the first prefill chunk's selection (:634) and persisted on the very firstcommit_checkpoint_plans(:921,987), so mid-prefill calls torequest_anchor_endpointhit the latch at:477-482rather than re-pricing; during aMixedalignment shift (checkpoint_lifecycle_tests.rs:585-678),promote_request_anchorreturns early at:889-891beforecommit_checkpoint_plansupdates the latch. - Upstream claim that debiting
cut.split_nswhendestinationisNone(checkpoints.rs:925-934,983-986) is an over-charging defect: Disproved.commit_checkpoint_plansruns on a prefill step whose lane has already been split atcut.endpointand will execute on the GPU, incurringcut.split_nsof extra prefill work whether or not a snapshot row is available;cut.copy_nsis properly refunded at:984because the snapshot copy is skipped. Refundingcut.split_nswould under-report actual extra GPU prefill work and allow subsequent cuts to exceedcheckpoint_extra_work_fraction. This matches pre-existingMessagecut accounting. - Upstream claim that PR body LOC (
+95/-60, +35 net prod LOC) is wrong by 19× and that theLimitsA/B disclosure is misleading: Disproved. Counting production hunks inhelios/src/scheduler/checkpoints.rs:1-1123yields exactly+95/-60(+35net prod LOC), and the PR body separately states the total diff (12 files, +887/-151). On cold/warm requests withextra_spent_ns == 0andinitial_prefill_ns == None, the post-22cac91anchor_split_affordablewiring at:534-539is mathematically identical to22cac91, making theLimitsdisclosure accurate. - Upstream subtraction claim to remove
prefill_capacities: Option<&[usize]>frompermissive_checkpoint_costsand split its policy call (tests.rs:163-184): Disproved.prefill_capacities(512)(helios/src/scheduler.rs:83-92) yields[128, 256, 512](no64), so forcingSTANDARD_PREFILL_CAPACITIES(&[64, 128, 256, 512]) insidescheduler_with_concurrency(boundary_tests.rs:74) would silently alter the catalog for 30+ unrelated boundary tests, while stripping the100_000 + capacitycost rewrite fromprefill_to_publication_boundary(tests.rs:3328) would leave zero remaining budget forEndpointcapture atfraction = 1.0under flat1000 nsprefill costs. - Upstream claim that
permissive_checkpoint_costs/phase_tests.rs:1542leave default-0.05coverage too thin: Dropped as over-flagged. Opted-out fixtures use synthetic flat prefill costs (1000 nsper bucket, making any interior split+100%overhead) to test page-sharing/publication mechanics,phase_tests.rs:1542stayed on default0.05, and six new end-to-end tests incheckpoints.rs:4203-4771directly cover default0.05and intermediate fractions. - Upstream minor claim about
end < raw_anchorkeeping earlierMessagecuts below a rejected anchor (checkpoints.rs:677): Dropped. Intentional, strictly bounded byavailable = allowance(prefill, fraction), tested in Case 2 (checkpoints.rs:4318-4332), and already documented indocs/core-design.md:1446-1447. - Upstream open questions on
checkpoint_copy_allowed(checkpoints.rs:992-1011) anddocs/api.md:356-357: Verified sound. Telescoping conservation keepsextra_spent_ns + reserved_ns <= allowanceinvariant acrosscommit_checkpoint_plansfor all selected cuts, anddocs/api.md:356-357("sums charged predicted extra prefill and copy work") remains accurate.