Explore report · NVIDIA/hyperflare-inference #665

Raw Markdown for agents: https://autobot.eidonix.com/p/6e2f9000-cafc-4063-8876-c1f75b1dbd85.md

PR #665 — helios: add scan-resistant dual-turnover prefix cache eviction

Case file across all nine angles. Facts are separated from author claims; every citation is to the head commit a7568c2 or to a named PR/issue.

Key findings

  1. It silently changes a documented invariant certified four days ago. #568 (merged 2026-11-28) states "Victim ordering remains strictly (node.retention_rank(), node.id)" and docs/core-design.md:1565 still says captures "reclaim lower-rank victims strictly by demand-recency order". #665 makes is_protected the first sort key (helios/src/cache.rs:363-365, used at :732), so a reused lower-rank victim now outranks an unreused higher-rank one. The description never mentions #568 or that it revises that guarantee. (#568, #665 diff)
  2. It partially reverses #298/#416 without saying so. #298 (2026-11-15) introduced the completion-recency refresh precisely so a long-running request is not evicted just before its client returns; #416 extended it to the host store. #665 keeps the completion touch (helios/src/scheduler.rs:3107-3118) but routes it through plain touch, so completion no longer confers protection, only MRU order within the unprotected tier (only touch_hit promotes, cache.rs:384-389). Neither PR is referenced.
  3. The design docs that specify this exact policy are not updated. docs/core-design.md:1538-1583 describes the touch policy and victim order as unchanged; search for retention_rank in docs/ returns only core-design.md:1576. #298, #416, #567, #568, #582 and #655 all edited docs/* — the local norm. #665 touches only 4 files, all under helios/src.
  4. Three mechanics the description does not spell out (all verified in code): the aging horizon is global, not per-node — is_protected compares turnover against self.tail_pages and self.ready_checkpoints (cache.rs:353-360); only retire_leaf for ready nodes increments the turnover counters (cache.rs:604-609), so compact_ancestor (cache.rs:626-657) never ages protection; and mark_reused uses self.nodes.get_mut(&id).unwrap() (cache.rs:370), the only new unchecked unwrap on a &mut path.
  5. The one path the description admits is unmeasured is also untested. Both A/B arms run --prefix-cache-memory 0, so the host tier is off and the new touch_hit on host restore (scheduler.rs:1884-1887) has no live evidence and, as far as I could find, no direct unit test — the 4 added tests are cache-level only.
  6. Process gap against the repo's own written standard. docs/design-review.md:226-228 requires check.py --mutations/cargo-mutants "when adding or changing safety guards"; #665 adds one (is_protected demotion) and reports only check.py --jobs 4. The existing mutation target at verification/helios-lifecycle/check.py:515-519 sits on the very protected_eviction_tokens line #665's filter chain builds on. #568 and #582 both reported --mutations. Zero CI checks on the head commit, zero reviews, zero comments.
  7. Guaranteed textual conflict with open #549 in the same Checkpoint struct literal and the same key() sort in helios/src/cache/lifecycle_tests.rs.

The change

Size. 4 files, +271/−6, all under helios/src: cache.rs +64/−4, cache/tests.rs +192/−0, cache/lifecycle_tests.rs +6/−1, scheduler.rs +9/−1. Net production code ~68 lines; the rest is tests. Claimed and verified: no CLI flags, no floats, no unsafe, no model branches, no core/wire-format change (the added fields are in-memory Checkpoint fields only, cache.rs:84-86).

In plain terms. GPU prefix-checkpoint eviction used to rank victims purely by RetentionRank { use_epoch, role, consumed_tokens } plus id — essentially LRU-plus-role (cache.rs:90-96, :732). Because RequestScheduler::retire refreshes use_epoch on every completion, dead one-shot prefills land at the MRU end and reused multi-turn sessions get dropped first. The patch adds a one-bit per-checkpoint "reused" flag plus a turnover-based aging rule and puts protection ahead of rank:

Description vs. diff. Everything the description claims is present, in the stated place. Three behaviours it does not state are in Key finding 4; the fresh_admission = accounting.is_none() gate is correct for preemption (re-admissions carry Some(accounting) from runtime.rs:1518/1534/1551/3174 while first-time admissions pass None at runtime.rs:1643/3866/4061), and retries inside admit_with_host_store pass the same carried accounting, so they do not re-mark reuse.

What the description says that the change does not do: nothing found — the stated limits are honest (--prefix-cache-memory 0, SM120 TP4, no effect when capacity fits or scans exceed capacity).

The why

Recent activity

People

Community

Project fit

Lines up:

Does not line up:

Claims and evidence

Verified as claimed: the test/TLA+ command shapes are plausible and consistent with the workflows (.github/workflows/helios-lifecycle.yml (not opened) runs check.py + cargo kani --features runtime-core --lib; native-serving.yml (not opened) runs cargo test --features runtime-core,server); the LOC split matches pr_files; "no core-format changes" is true.

Author-reported only, no CI:

  1. cache:: 137, scheduler:: 408 (4 ign), flare --lib 238 (4 ign), flare-cli 239 (3 ign), rustc 1.94.1, 0 warnings. No before/after test count; no server::/runtime-core,server suite listed (where finish_inbound's callers live); no selene suite (which #298/#416 reported).
  2. TLA+ check.py --jobs 4: 10/10 models, 8/8 trace suites, 621,390 transitions, 12/12 checks. No --mutations, no Kani. verification/helios-lifecycle/ contains no RetentionRank reference, which is consistent with the models not covering victim order — so "TLA+ passes" does not evidence the changed ordering either way.
  3. The A/B table: scan-thrash 24x8K vs 8x214K — hit 19.76% → 37.31% mean (1.89x), evicted 168/215 → 132/217, saved tok/s 1,416.7 → 2,781.8 (+96.4%), TTFT p50 8,746.5/5,498.5 → 7,243.7/5,352.6 ms. Long-MT 4x127K 4-turn vs 12x8K — 28.62% → 49.71% (1.74x), evicted 17/24 → 12/24, TTFT p50 23,886.7/22,228.7 → 2,876.8/3,459.5 ms (−86.3%), saved tok/s 3,742.5 → 6,578.2 (+75.8%), Bg 727 → 752. Method: single boot, 4x RTX PRO 6000, DeepSeek-V4.1-Flash TP4, 2,606,848 KV tokens / 20,366 pages, 0 errors/preemptions, 2 cold-salted trials per arm. So n=2, single boot, no variance/CI reported, "cold-salted" undefined, no p99 or per-request distribution. The −86.3% TTFT on Long-MT is an order-of-magnitude jump that the 1.74x hit-rate change does not by itself explain.
  4. Serving sanity: HTTP 200, 37×41=1517, 204/204 finite logprobs, 0 failed requests on both boots — smoke test only.
  5. "Selene restore touch_hit is verified by unit tests and TLA+" — but both arms run --prefix-cache-memory 0, the four added tests are cache-level (scan-vs-reused victim, inheritance threshold, dual-turnover demotion, reclaimable_if_pinned parity), and I found no test driving finish_inbound's touch_hit (scheduler.rs:1886) specifically. This claim is the weakest in the description.

Reach

Process

Open, marked ready for review, opened and last updated 2026-12-01 (same day as this case file). No CI checks on head a7568c2. No reviews, no comments. Self-contained (4 files, no docs, no verification/, no workflow edits), so no new approval path beyond normal review is needed — but per docs/design-review.md:226-251 the missing mutation/Kani run is a written blocking condition, not a nicety.


Open questions / could not verify

  1. Do #568's five end-to-end policy tests in helios/src/scheduler/policy_tests.rs (not opened) still hold under the new first key? The PR reports scheduler:: 408 (4 ign) passed but does not single them out, and I did not run them.
  2. Is finish_inbound's touch_hit (scheduler.rs:1886) covered by any test? I found none; the description's claim points at unit tests that are cache-level.
  3. The A/B numbers are author-reported, n=2 trials per arm on one boot; I have no access to the hardware and did not reproduce them. The Long-MT p50 TTFT −86.3% is unexplained by the reported hit-rate delta.
  4. Does the compaction path (compact_ancestor, cache.rs:626-657, which never touches the turnover counters) leave protection effectively permanent under single-child-ancestor pressure? Verified in code, not exercised by any test I found.
  5. Older (pre-30-day) user-facing scan/thrash reports were not exhaustively searched; the no-issue finding holds for open items and items closed in the last 30 days.
  6. How #298's motivating workload (Kimi K3.1, 16 GPUs, 200k–580k-token sessions) behaves under the new ordering is not measured anywhere — #665's evidence is DeepSeek-V4.1-Flash TP4 at 128-token pages.