AMENDMENTS to the case file for PR #655 — revision f7f4d253 (2026-12-01)
Scope note: these are delta amendments only. They replace the listed sections of my previous case file (scratchpad #17) and must be read instead of it wherever they conflict. Head is now f7f4d253 ("retain measured snapshot cost after expiry and discover unmeasured cost once"), 7 files, +348/−63; PR updated 2026-12-01 16:39. Everything below is verified in the tree at that head.
Key findings (amended)
- The change I previously described no longer exists. The 30 s TTL probe is deleted:
probe_duration,record_probe,last_probe_nsandsmallest_batch_keyare gone from the tree. The replacement isActionCosts::measured_duration(helios/src/scheduler/cost.rs:783-790) — it scansself.batches(kind)ascending and returns the first declared batch withnanos != 0, with no TTL test — plus a single server-global cold-discovery slot. My findings "one probe per TTL", "zero-priced first probe every TTL", "probe slot global perEstimate", "record_probestamped at allocation so a cancel burns the slot" (scratchpad #8 and #17 findings 2–3, open question 4) are withdrawn. - Both gates are now fixed, not just the terminal one.
measured_durationreplacedfresh_durationat all three sites:checkpoint_selection_uncached(checkpoints.rs:624),checkpoint_copy_allowed(checkpoints.rs:965) andallocate_terminal_capture(checkpoints.rs:1039). My "only the terminal gate is relaxed / scenario 2 half-implemented" finding and its open question are withdrawn. Becausecheckpoint_cut/estimated_checkpoint_cut/plan_checkpointsroute throughcheckpoint_selection, this unblocks Anchor/Message cut selection and its storage quote too. - The doc-consistency finding is resolved; a new, opposite doc tension replaces it. All four docs now carry the rule (
docs/scheduling-runtime-design.md:619-631,docs/core-design.md:1451-1457,docs/cli-design.md~706-709,helios/README.md~376-382). But the new sentence "terminal capture allows at most one in-flight discovery capture (priced at zero)" (docs/scheduling-runtime-design.md:626-628;docs/core-design.md:1456-1457) is immediately followed by the unchanged "There is no fixed capture count or concurrency-based snapshot share" (scheduling-runtime-design.md:630-631) andcore-design.md:1444("There is no capture-count limit or allocation of a fixed snapshot share to each request"). The discovery slot is a server-global concurrency cap of one. One clause ("apart from the single cold-discovery capture above") fixes it; should-fix doc nit, not a code defect. - The zero-priced discovery copy still under-reports a documented counter, and that gap has moved from the PR body to
docs/api.md.cost = measured.or_else(|| discovering.then_some(0))(checkpoints.rs:1043) →request.checkpoint_copy_ns = cost(1075) →commit_checkpoint_copiesadds 0 tostats.checkpoint_extra_work_ns(1089-1094). All four design docs now disclose the zero pricing, butdocs/api.md:355-356still saysflare_checkpoint_extra_work_nanoseconds_total"sums charged predicted extra prefill and copy work" with no exception. Operators sizing off that counter get one unaccounted copy per cold-discovery event. - The work-budget check can never refuse the discovery copy. Cost 0 against a positive allowance (
checkpoints.rs:1048-1056), so a cold discovery copy is admitted even with no earned decode allowance; the only bound is "one in flight". Deliberate and documented (core-design.md:1455-1457), but it is an exception to the request-local allowance rule stated atcore-design.md:1447-1450three lines earlier. - Validation disclosure narrowed the gap but the formal layer still does not model the new guard. The new "checklist notes" paragraph is verified accurate about the simulator: no checkpoint/
extra_workmodelling exists inscripts/scheduling_sim/, solearning.py's catalog (docs/design-review.md:195-208) genuinely has nothing to compare. It is accurate but incomplete about the formal layer:.github/workflows/helios-lifecycle.yml:5-11(not opened) triggers onhelios/**, socheck.py(not opened) and Kani do run (which is why CI is green), but nothing inverification/helios-lifecycle/models the discovery slot —CheckpointReservation.tlamodels row phasesGuard/Armed/Copying/PublishedplusTerminalDestinationand has no "snapshot"/"discovery" state, whiledocs/design-review.md:226-228asks forcheck.py (not opened) --mutationswhen "adding or changing safety guards". This PR now also edits theRequestSchedulerstruct and three release paths (scheduler.rs:661, 756, 2690-2692, 2700-2702, 3067-3068), i.e. lifecycle-covered code. Either extend the TLA model as #568 did forTerminalDestination, or state in the body why the guard is outside the model's domain. - Linkage and engagement changed; the substance of my fork-vs-upstream concerns did not.
Fixes #534→Related to #534(auto-close hazard gone; #534 stays open), labels present (area:caching, area:scheduling, performance, triage:review), and one flare-autobot "Changes Requested" review at 16:04 on the old head2d9454fanswered point-by-point by the author at 16:39. My "no labels / zero engagement" finding is superseded; there is still no human maintainer review and no maintainer position on the fork question. The PR also still never cites mark-yong's 2026-11-28 fork diagnosis or flare-autobot's 2026-11-30 non-reproduction comment on #534.
Details
Mechanism (replaces "The change"). measured_duration(kind, tokens) (cost.rs:783-790) keeps PR #285's retained-cost rule for Snapshot; observe() still resets the rolling window on the next execution. allocate_terminal_capture (checkpoints.rs:1025-1081) now computes measured, then discovering = measured.is_none() && policy.checkpoint_extra_work_fraction > 0.0 && !self.snapshot_discovery_in_flight() (1040-1042), prices that one capture at 0 (1043), runs the unchanged work-budget test (1048-1056) and marginal-gain storage quote (1063-1067), and claims the slot only after a row is obtained (1069-1072) — so storage refusal does not burn it (new test asserts checkpoint_skip_storage == 1, unknown_cost == 0). Release paths: status-3 error (scheduler.rs:2690-2692), successful terminal snapshot (2700-2702), retire for cancel/finish (3067-3068); snapshot_discovery_in_flight (checkpoints.rs:1018-1023) treats a Finishing handle as free, so a missed clear self-heals. The deferred_prefill early return (1033-1035) still precedes the discovery logic.
Answers mark-yong's rebuttal mechanism (b), not (a)'s premise. The batch-agnostic rule closes mark-yong's batch > 1 objection — a snapshot that only ever ran coalesced at batch 4 now satisfies the gate (test measured_duration_uses_smallest_measured_batch_and_retains_after_ttl, cost.rs:994-1045). The warm-restart anchor <= start case is what the discovery slot covers, with a new live scenario. What remains unaddressed is the question, not the mechanism: whether the cold-boot deadlock in #534 is an upstream defect at all. Minor unverified edge: if a never-measured core cannot run Snapshot at any declared batch, a zero-priced discovery could in principle be admitted and never measure; the PR relies on "snapshot always measurable once attempted".
Evidence (replaces my claims/evidence section). New end-to-end test terminal_snapshot_discovery_end_to_end_plan_commit_complete_unblocks_subsequent_captures (checkpoints.rs:4253-4300) drives real plan()/commit()/complete() through Restore→Resume→Decode→Snapshot→Finish, asserts measured_duration == Some(25_000) and checkpoint_endpoint_captures == 1, then a follow-up request gets >1 prefill cuts — closing the automated review's "tests call measure(...) directly" warning. unmeasured_snapshot_cost_allows_one_inflight_terminal_discovery_and_recovers_on_cancel (checkpoints.rs:4183-4251) covers cancel recovery; zero-fraction behaviour is unchanged and separately tested (checkpoints.rs:1937, plus ~4235-4250). Body reports 409 + 246 tests passing with cargo check --locked --all-targets -D warnings, and 4 live SM120 scenarios (Qwen3.8-Flash-Next TP1, disk cache) including a warm restart with host_cache_hits=+1 and follow-up unknown_cost=0. Still single GPU, single model, TP1; no logs or metric dumps; #534's 4.5 s → <0.1 s and the author's own 9.36 s → 0.17 s TTFT recoveries are not reproduced here.
Down-graded nit (correction to my earlier scratchpad). Do not present measured_duration's batch scan as a hot-path concern: checkpoint_selection is memoized per (handle, quote_storage) in self.checkpoint_selections (checkpoints.rs:410-428), opened once per planning pass (policy.rs:1531), so checkpoints.rs:624 runs once per request per planning scope, and the ENTRY_LOOKUPS budgets (checkpoints.rs:1525, 2580) hold. Bounded; at most a reviewer glance.
What survives from the pre-revision report. Author ownership (yatesdr: #459, #354, #357, #415 on this same cost path), the #285 precedent (merged with live-hardware A/B only, so absent simulator/TLA runs are consistent with merged practice here), #292's un-isolated unknown_cost skips, #645 as the one-day-old base (cost.rs +742/−12, checkpoints.rs +229/−36), the expected textual rebase against open draft #301 (which cures only the unmeasured warm-restart case; #655's discovery slot overlaps it), #540's refresh credit being deliberately untouched, #568 the immediate ancestor of the storage quote, and #654 sharing files but not mechanism.
Open questions
- Is the #534 deadlock an upstream defect? Still unanswered in text; the PR now "relates to" rather than "fixes" it, which weakens the auto-close hazard but leaves the reviewer to decide. Both closest field reports (#534, #600) came from forks.
- Will a human maintainer review this at all? Only automated review exists, on a superseded head, and the author's reply asks for re-review.
- Should the new discovery guard be modelled in
CheckpointReservation.tla(as #568 did), or explicitly declared out of the model's domain? - Should
docs/api.md:355-356note the zero-priced discovery copy, and should the "no concurrency-based snapshot share" sentences be qualified?
What I could not find
No maintainer stance on #534 or #655 in either thread; no re-review by flare-autobot on the current head f7f4d253 at the time of writing; no reproduction of a cold boot (nanos == 0) on pure upstream main without PrefillTailMerge; no TP>1, multi-host, SM103/SM121 or explicit core-load compatibility run; no logs or metric dumps behind the four live scenarios; and no checkpoint/unknown_cost/discovery model in scripts/scheduling_sim/ (so the simulator layer cannot be run for this change even in principle).