Explore report · NVIDIA/hyperflare-inference #655

Raw Markdown for agents: https://autobot.eidonix.com/p/7549f1ee-d9f2-4b3a-8398-0cc88efcc2bf.md

Case file — PR #655: helios: probe unmeasured or stale snapshot cost once per TTL on terminal capture

Author: yatesdr (COLLABORATOR; Discord "D-Rock") · State: open, ready for review, opened and last updated 2026-12-01 · Base: main · Head: 2d9454f · Size: 3 files, +253/−9 · CI on head: passed · Labels: none · Reviews: none · Linked: "Fixes #534"

Key findings

  1. The issue this PR claims to fix is disputed in its own thread, and the PR does not mention it. Issue #534 reports a cold-boot deadlock where Snapshot is never measured. On 2026-11-28 mark-yong traced that deadlock to a third-party SM120 TP3 fork (AzallazA/hyperflare-inference, ba6a4c11) carrying PrefillTailMerge/prefill_merge_min_rows (ported from closed PR #69, symbols absent upstream), showed that on upstream main (353551e9) checkpoint_anchor falls back to prompt_tokens so anchor > start holds and the first request measures Snapshot, and concluded "unless this reproduces on pure main without PrefillTailMerge, this belongs on the fork and can probably be closed here." On 2026-11-30 a flare-autobot comment on #534 said it "does not reproduce in NVIDIA/hyperflare-inference on origin/main at c146d7be", that "no upstream code change is proposed", and warned that "adding an unconditional terminal-capture probe … would alter the documented freshness contract in docs/scheduling-runtime-design.md … without a demonstrated defect" — recommending closure as fork-specific. PR #655, opened the next day, does exactly that probe and cites neither rebuttal. It reframes the problem onto three other serving scenarios (>30 s decodes, >30 s inter-request idle on an already-cached anchor, warm restart with --prefix-cache-disk/--prefix-cache-pool) and supplies a live before/after for those. Both of the closest field reports of the symptom (#534 itself, and #600) came from forks, which makes "is this an upstream defect at all" the central open question for the decider.
  2. The probe slot is one per Estimate entry (global across requests), not per request (cost.rs:806-813, checkpoints.rs:1032-1045). Whichever request first needs a terminal capture takes the slot; every other request's terminal capture within the same 30 s TTL still skips unknown_cost. The new test asserts exactly this (h2 skips, unknown_cost == 1, checkpoints.rs:4163-4174). The description's "once per TTL" is literally accurate but reads as more relief than it delivers.
  3. The first probe of a never-measured entry returns Some(0) (probe_duration, cost.rs:794-804), so that capture can never fail the work-budget check (checkpoints.rs:1050-1054) and is recorded at zero in request.checkpoint_copy_ns → stats.checkpoint_extra_work_ns (checkpoints.rs:1091-1096). flare_checkpoint_extra_work_nanoseconds_total (documented as summing charged predicted work, docs/api.md:355) therefore under-reports one copy per TTL. The new test asserts the zero (assert_eq!(scheduler.request(h1).unwrap().checkpoint_copy_ns, 0), checkpoints.rs:4159-4161). Not stated in the description.
  4. Only the terminal-capture gate is relaxed; the prefill-extras gates are not. checkpoint_selection_uncached (checkpoints.rs:624-626) and checkpoint_copy_allowed (checkpoints.rs:965-967) still return unknown/false on unmeasured or stale Snapshot. The description's scenario 2 says "both prefill extras and terminal Endpoint capture skip with unknown_cost"; the PR fixes half of that, and the doc edit now says so ("disable prefill extras", docs/scheduling-runtime-design.md:620-626). docs/core-design.md:1452-1455, helios/README.md:378-379 and docs/cli-design.md:696-709 still describe the old rule and were not updated — a doc-consistency gap that merged precedents #285 and #568 both avoided by updating documents in lockstep.
  5. Two of the three validation layers that docs/design-review.md calls mandatory for timing-estimation changes are absent, and are not disclosed as skipped. design-review.md:195-208 requires evaluation against the Python simulator and the scripts/scheduling_sim/learning.py (not opened) screening + 64-seed catalog for "timing estimation, refresh or exploration budgets"; design-review.md:209-230 and 247-251 require verification/helios-lifecycle/check.py (not opened) (and --mutations when safety guards change) for changes to snapshot aliases/allocation. #655 reports only cargo check (4 crates) and unit tests — no simulator run or model (the simulator has no checkpoint/unknown_cost/probe model at all), no lifecycle run or TLA extension. Contrast: #568, which changed this very allocate_terminal_capture function, extended verification/helios-lifecycle/CheckpointReservation.tla with a TerminalDestination action and ran check.py (not opened) --mutations twice; #540 and #645 ran the simulator catalog. Counterpoint: #285, the analogous earlier fix, also supplied only live-hardware A/B.
  6. Stacking and overlap. #655 sits directly on #645's one-day-old rewrite of the same two files (cost.rs +742/−12, checkpoints.rs +229/−36, merged 2026-11-30) and reproduces #285's retained-cost pattern for the Snapshot half. It edits the Estimate struct that open draft #301 ("persist learned graph costs across serving restarts") also edits (verified: on pr/301, Estimate at cost.rs:54 has no last_probe_ns and there is no probe_duration), so a textual rebase is expected; conceptually #301 removes #655's unmeasured warm-restart case but not its stale case, which is #655's stale branch. Neither PR cites the other. #654 shares the checkpoint/doc files but is an unrelated mechanism (first-output age pricing).

The change

In plain terms. allocate_terminal_capture used to refuse to allocate a terminal Endpoint checkpoint unless ActionCosts::fresh_duration(GraphKind::Snapshot, 1) returned a measured duration no older than estimate_ttl_ns (30 s default). Because a Snapshot step only runs when some request has an armed capture, that estimate cannot refresh itself: if it is zero or expired, every terminal capture increments flare_checkpoint_skips_total{reason="unknown_cost"} forever, and the skipped checkpoint is neither retained in the GPU prefix tree nor offered to host/disk offload. The PR adds a bounded escape hatch: when the cost is not fresh and checkpoint_extra_work_fraction > 0.0, price the capture with probe_duration and proceed through the normal work-budget and storage-quote checks; if a snapshot is actually obtained, stamp record_probe so the next probe cannot happen for another TTL.

Files and size (+253/−9, 3 files):

What it does that the description does not say (all verified in code):

What the description says that the change does not do: scenario 2's prefill-extras half (finding 4). Everything else in the description matches the diff: no Protobuf/core-package/CLI/metric-schema change; gated entirely by the existing scheduler_checkpoint_extra_work_fraction (default 0.05, policy.rs:40); nothing happens at fraction 0 (new test, checkpoints.rs:4243-4261).

Differences from the fix sketched in #534: the issue's snippet hard-coded batch: 1 keys and reused last_attempt_ns (self.now_ns.max(1)); the PR shares smallest_batch_key with fresh_duration, so it honours a core whose smallest declared Snapshot batch is not 1, and uses a separate last_probe_ns so probing does not perturb refresh_order/last_attempt_ns used by the funded timing-refresh path (cost.rs:820-829; policy.rs:1530-1606; scheduler.rs:2427-2430). The shared-key helper is what answers mark-yong's batch>1 concern for the probe path — though not for measurement (next section).

The why

Reported problem. #534 ("Checkpoint captures deadlock on an unmeasured snapshot cost: host prefix cache never receives anything", semireg, opened 2026-11-26, still open, labels area:caching/area:selene/bug/performance/priority:P2/triage:investigate) reports flare_checkpoint_captures_total flat at 0, flare_graph_launches_total{kind="snapshot"} flat, unknown_cost skips ~1/request, nothing published to Selene, host DRAM/NVMe prefix cache never hitting, for the whole boot on DeepSeek-V4.1-Flash FP8 TP3 SM120. It claims to be at least one cause of #327 ("Prefill ram cache fills but is never reused") and cites #285 and #292 as precedent.

The self-locking mechanism, verified. fresh_duration(kind, tokens) reads exactly one entry: the smallest declared batch with tokens = 1 (cost.rs:788-792, 783-786). Estimate::fresh requires nanos != 0 and now - observed_at_ns < ttl_ns (cost.rs:515-517), and stale_keys() filters nanos != 0 (cost.rs:815-818), so an unmeasured entry is invisible to the funded refresh path. Only an observed ScheduledStep whose full key is exactly that shape can fill it (observe, cost.rs:857-891, matches the step's actual batch_capacity). A Snapshot step that runs at batch 2 does not measure the batch-1 entry — mark-yong's concern (b) in #534 — and mark-yong's concern (a), anchor <= start so no Anchor cut runs, is exactly #655's scenario 2. The probe targets the same key fresh_duration reads, so it cannot drift to another batch; but it also does not make a batch-2 measurement satisfy fresh_duration. plan_requires_feedback (scheduler.rs:1109-1150, !is_fresh at 1141-1142) forces an unmeasured/zero-priced Snapshot phase to report completion feedback, which is how the probe actually closes the loop through observe.

How long wanted. #285 (dbotwinick, merged 2026-11-13) fixed the prefill half of this class and explicitly left the snapshot half ("the fresh snapshot-copy requirement still governs optional captures"); #292 (iein, closed 2026-11-18) observed 14 unknown_cost skips on a fresh server and closed without isolating them; #534 (2026-11-26) escalated to a deadlock report; #655 (2026-12-01) is the fix. Five weeks from first written acknowledgement.

Item State Relationship
#285 fix(cache): retain measured prefill costs after expiry merged 2026-11-13 Direct precedent: same self-locking pattern, prefill half; its evidence was live GB10 A/B (TTFT 5.72–5.78 s → 0.43–0.44 s after a 31 s idle gap); it did not report simulator/TLA runs, so #655's omission is consistent with merged precedent here. It authored the doc paragraph #655 edits.
#292 branch reuse lost at 0.05 fraction closed 2026-11-18 Early observation of unmeasured-snapshot unknown_cost skips (11 work_budget, 14 unknown_cost), never isolated; #655 changes the gate, not the budget rule, so #292's other half stands.
#534 checkpoint captures deadlock open, 2026-11-26 The "Fixes" target; premise rebutted twice in-thread (see Key finding 1). Refers to #600.
#301 persist learned graph costs across restarts open draft, 2026-11-15 Competing edit to Estimate/prepared in the same file; would cure the unmeasured warm-restart case only, leaving #655's stale case load-bearing. Neither cites the other; expect a rebase.
#540 retain bounded timing-refresh credit across idle merged 2026-11-29 Adjacent: keeps funded timing refresh alive across idle. #655 deliberately keeps last_probe_ns out of refresh_order/last_attempt_ns so the two do not double-count refresh budget. #655's description does not mention it.
#645 prefill scheduling/cost modeling overhaul merged 2026-11-30 The base #655 is stacked on: rewrote cost.rs and checkpoints.rs and touched the same doc section one day before #655 branched. Not reversed, extended. Load-bearing: #655's stale test's 51_200 ns allowance depends on #645's prefill predictor.
#568 bound optional Endpoint checkpoint eviction merged 2026-11-28 Immediate ancestor of the storage-quote check the probe now reaches (quote_snapshots_with_budget, checkpoints.rs:1059-1070) and the TLA precedent for this function.
#582 / #613 / #550 merged 2026-11-29 Established the fraction == 0.0 conventions and the deferred_prefill early return #655 preserves.
#654 first-output age pricing open Shares checkpoints.rs + the same doc section; unrelated mechanism.
#600 same unknown_cost symptom on a different fork image open With #534, the pattern that upstream-defect claims of this kind originate in forks.

Recent activity

No default-branch commit since #655's branch point (571a447) touched its three files. The immediate context is e85019b9 (#645, Luke Alonso, merged 2026-11-30) rewriting the same two files plus this doc section, 5deacda9 (#568, Luke Alonso, 2026-11-28) adding the marginal-gain storage quote, c3489b23 (#582, FujitsuPolycom, 2026-11-29) setting the zero-budget conventions, and 97cfeb00 (#285, dbotwinick, 2026-11-13) writing the doc paragraph. Same-day default-branch commits (cd1daa3e #638, a4720050 #625, flare-autobot) touch unrelated subsystems. Nothing in 60 days reverses the freshness contract #655 relaxes: #655 is a forward extension, not a reversal of anyone's work — the only reversal is rhetorical, against the flare-autobot recommendation on #534.

Area ownership over 180 days: helios/src commits — Luke Alonso 233, Martin Vit 52, yatesdr 47. docs — Luke Alonso 387, Martin Vit 55, yatesdr 47.

People

Community

No PR-level discussion at all (pr_comments → "No comments"). The only community signal around the change is on the linked issue, and it is sceptical: both #534 comments recommend closing it as fork-specific (2026-11-28, 2026-11-30). Downstream interest exists in #327 (7 comments, several independent reporters, "0% hit rate on RAM prefix cache", "GPU KV 79.7%") and #600 (same unknown_cost pattern on a different fork image). Discord contact "D-Rock" matches the author's other PRs, so internal interest is plausible but not recorded in the PR.

Project fit

Charter statements that line up:

Charter / design-review statements that do not line up:

Claims and evidence

  1. "Fixes #534" via three serving scenarios — evidence: live A/B, Qwen3.8-Flash-Next TP1, 1× RTX PRO 6000 (SM120), --prefix-cache-memory 4G --prefix-cache-disk … --prefix-cache-disk-limit 16G --lossless-kv-compression off, main 3801ff1d vs PR 2d9454fe. 33 s idle pause on a fully cached prompt (2922/2922): endpoint captures +0/unknown_cost +1 → +1/+0, and the follow-up's prefill unknown_cost +1 → +0. Warm disk restart (flare_host_cache_hits_total = 1, 2917 reused tokens): +0/+2 → +1/+1 (prefill only). 6000 completion tokens in 31.833 s: both endpoint checkpoints captured at EOS. Well-formed before/after with named SHAs, but no logs, metric dumps or checked-in harness are attached; single GPU, single model, no TP/multi-host; no throughput or TTFT effect of the recovered captures is measured (the 4.5 s → <0.1 s TTFT in #534, or 9.36 s → 0.17 s in the author's #327 comment, are not reproduced here).
  2. Test counts — helios 1,758 (plus core::cache::selection_tests::failed_default_clear_keeps_the_selected_entry as non-root), flare 242, flare-cli 211 + two individually re-run flakes, 6 FLARE_TEST_TEMPLATE_DIR tests left to CI. CI on head is green; the new tests are visible in the diff and drive real entry points (allocate_terminal_capture, probe_duration/record_probe), which design-review.md:187-189 asks for.
  3. "No Protobuf, core-package, CLI, or metric schema changes. Existing cores load and serve without re-export" — verified structurally from the 3-file diff (no wire/CLI/metric code touched); "load and serve" was not exercised.
  4. "Behavior is shared across all cache schemes and models that declare GraphKind::Snapshot" — verified by inspection: the only new conditions are checkpoint_extra_work_fraction > 0.0 and the core's declared smallest Snapshot batch; no model or cache-scheme branch.
  5. Absent against a documented gate — no learning.py (not opened) screen/validate run or simulator model for the new rule; no check.py (not opened) / --mutations run or TLA extension (finding 5).
  6. Description gap — the description's scenario 2 asserts both prefill extras and terminal capture skip; only the terminal half is fixed (finding 4).

Reach

Process

Ready for review (not draft), hours old at the time of the packet, CI green on 2d9454f, no labels, no reviewers assigned, no reviews, no comments, not stale against main. Nothing has been escalated or requested; the linked issue carries an explicit recommendation to close, and the PR carries no rebuttal to it.

Open questions / what could not be found

  1. Does the unknown_cost self-lock reproduce on unmodified upstream main, as #655 asserts, or only on forks carrying PrefillTailMerge as mark-yong and the flare-autobot comment claim? #655 gives no cold-boot upstream reproduction and does not address either rebuttal; its live A/B covers the three other scenarios only.
  2. Was the scripts/scheduling_sim catalog ever run for this rule, and is there a simulator counterpart that should have been updated? Nothing in the repo models the checkpoint/unknown_cost gate, so the qualified-policy comparison design-review.md:195-208 asks for cannot be done today without adding simulator support first.
  3. Is the zero-priced first probe (and the resulting checkpoint_extra_work_nanoseconds_total under-count) acceptable to operators who size off that counter? No rationale is given either way, in the PR or the doc.
  4. Should the probe be stamped on copy completion rather than allocation, so a refused or cancelled dispatch does not burn the TTL slot? Not discussed or tested.
  5. Why is the prefill-extras gate (checkpoint_selection_uncached at checkpoints.rs:624-626, checkpoint_copy_allowed at 965-967) left on the strict rule when the terminal path is relaxed? The doc now states the asymmetry but does not justify it; the description's scenario 2 implies the user would expect both.
  6. Interaction with #301 if it lands: two competing edits to Estimate/prepared, and #301's restored-but-stale estimates land straight in #655's stale branch. No cross-reference exists in either direction.
  7. No maintainer position has been recorded anywhere on the PR, the issue, or in the linked #327 thread about whether this class of fix is wanted upstream.