Skip to content

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

Merged
lukealonso merged 1 commit into
NVIDIA:mainfrom
FujitsuPolycom:perf/helios-scan-resistant-prefix-cache
Dec 2, 2026
Merged

lukealonso merged 1 commit into
NVIDIA:mainfrom
FujitsuPolycom:perf/helios-scan-resistant-prefix-cache

Conversation

@FujitsuPolycom

@FujitsuPolycom FujitsuPolycom commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

eviction_candidate_within_budget ranked victims solely by (RetentionRank { use_epoch, role, consumed_tokens }, id) (#568). Because retire refreshes use_epoch via cache.touch (#298, #416), cold one-shot prefills land at MRU ahead of idle multi-turn sessions, evicting reused sessions before dead scans. Naive 1-bit caches fail on linear multi-turn frontiers (0 hits until turn k+1) and livelock on phase shifts or compaction.

What

Zero-knob policy (135 net prod LOC: cache.rs +138/-22, scheduler.rs +32/-13; 0 flags, floats, unsafe, model branches, or core changes):

  • Reuse & restore gating (cache.rs, scheduler.rs): Track reused, reused_at_evicted_*, ready_tail_pages, evicted_pages, evicted_checkpoints (retire_leaf+compact_ancestor), and per-waiter (RequestHandle, bool) freshness on Ticket (recomputed on cancel). Promote via touch_hit only on fresh GPU hits (accounting.is_none()), duplicate captures, and finish_inbound (Created/Existing via publish_with_retention_with_hit) with a live fresh waiter; completion touch, preemptions, and waiterless restores refresh recency only.
  • Inheritance & sticky aging (cache.rs): Children inherit iff parent is protected and parent_len * 2 >= tail_tokens (>=33% reused prefix). demote_expired_reused permanently clears reused after dual turnover (ready_tail_pages.max(1) & ready_checkpoints.max(1)) or 2x ready_checkpoints.max(1) under compaction.
  • Ordering, docs & tests: Order victims by (is_protected, retention_rank, id) after filters; sync core-design.md, scheduling-runtime-design.md, prefix-cache-offload.md, helios/README.md; add unit/policy tests & Fixture::key() reuse/turnover state.

Result

Single-boot A/B vs 5d53040e, 4x RTX PRO 6000 (DeepSeek-V4.1-Flash TP4, gb202-tp4-202612010626, 2,606,848 KV tok / 20,366 pages, 0 err, n=2/arm; a7568c2c pre-hardening):

Workload Arm Hit % (T1/T2/Mean) Evict TTFT p50 ms Saved tok/s (T1/T2/Mean) Bg
Scan 24x8K/8x214K Base 33.95/8.91/19.76% 168/215 8,746.5/5,498.5 2,083.8/749.6/1,416.7 40
Scan Cand 51.82/25.99/37.31% (1.89x) 132/217 7,243.7/5,352.6 3,335.5/2,228.1/2,781.8 (+96.4%) 40
Long-MT 4x127K/12x8K Base 24.61/32.58/28.62% 17/24 23,886.7/22,228.7 3,057.9/4,427.0/3,742.5 727
Long-MT Cand 49.38/50.04/49.71% (1.74x) 12/24 2,876.8/3,459.5 (-86.3%) 6,168.8/6,987.5/6,578.2 (+75.8%) 752

Long-MT TTFT drops -86.3% by avoiding 127K queueing stalls. Trade-offs/limits: default-ON (no opt-out); on cold shifts, stale reused entries survive until dual or 2x checkpoint turnover, evicting new probationary entries first. No effect without eviction/overload; A/B ran on a7568c2c (--prefix-cache-memory 0); restore gating is unit-tested, not live offload.

Evidence

  • Repro: flare run <model> --gpus 0,1,2,3 --max-concurrency 32 --mtp-draft-tokens 7 --mtp-adaptive-verification --mtp-max-verification-token-budget 128 --mtp-adaptive-verification-alpha 1.0 --scheduler-policy balanced --embedding-table-storage disk --embedding-table-cache-size 84GiB --embedding-table-workers 1 --embedding-table-resident-scales --kv-cache-limit memory --memory-limit 83GiB --prefix-cache-memory 0; 2-workload client suite (seed=42, T=0.0, n=2 cold-salted): Scan 24x8K MT vs 8x214K cold; Long-MT 4x127K MT vs 12x8K cold.
  • Archive (ce649b30, tree 402aa479 == pushed c5b39236 on 1fbcc3c9, rustc 1.94.1): -D warnings 0 warn (4 crates); helios server 1,284 & runtime-core,server 1,796 (excl. 8 gated; cache:: 49/139, policy_* 6, finish_inbound_* 5), flare 246, flare-cli 245, pytest 834, ruff==0.12.8 0 PR issues; check.py --mutations: 10/10 TLC, 8/8 obs (621,390), 12/12 aux, 26/26 Rust + 13/13 TLA+ + 1/1 bad-edge KILLED.

Discord: Dooner

@flare-autobot flare-autobot added area:caching Prefix/KV reuse, cache retention, and model or payload cache behavior. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. labels Dec 1, 2026
@FujitsuPolycom
FujitsuPolycom marked this pull request as ready for review December 1, 2026 20:43
@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 665.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added the triage:review Proposed change needs code review; this does not imply merge readiness. label Dec 1, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

PR #665 lands a clean, zero-knob, model-agnostic scan-resistant eviction policy (~68 net production LOC, no flags/floats/unsafe/core-format changes) in the right Helios cache/scheduler layer. Two blockers prevent merge on head a7568c2: is_protected compares monotonic turnover against live growing cache counts so demoted checkpoints silently regain protection, and the mandatory check.py --mutations gate is unrun while the description claims unit tests and TLA+ verify host-restore touch_hit.

  • Blockers: 2 · Should fix: 4 · Subtract/Simplify: 2 · Nits: 2
Walkthrough
  • helios/src/cache.rs (+64/−4): Adds reused, reused_at_evicted_pages, reused_at_evicted_nodes to Checkpoint (:84-86) and cumulative evicted_pages/evicted_checkpoints to PrefixCheckpointCache (:221-222), incremented only for ready leaves in retire_leaf (:604-609). Adds is_protected, eviction_key, mark_reused, touch_hit (:349-389); promotes duplicate publications (PublishResult::Existing) via touch_hit (:471); inherits reused when the parent is protected and parent_len * 2 >= tail_tokens (:478-481, :503-505); orders eviction_candidate_within_budget by (is_protected, retention_rank, id) (:732).
  • helios/src/scheduler.rs (+9/−1): Gates admission reuse promotion on fresh_admission = accounting.is_none() (:1727-1740) so first-time GPU hits call touch_hit while preemption re-admissions call plain touch; adds self.cache.touch_hit(id, ticket.demand_epoch)? on PublishResult::Created in finish_inbound (:1884-1887). Completion recency refresh in retire (:3107-3118) stays on plain touch.
  • helios/src/cache/lifecycle_tests.rs (+6/−1): Copies new fields in Fixture::fork (:79-81, :96-97); switches Fixture::key()'s relative-order sort to self.cache.eviction_key(node) (:502).
  • helios/src/cache/tests.rs (+192/−0): Four isolated cache-level tests: scan-vs-reused eviction (:1315-1345), inheritance ratio (:1347-1394), dual-turnover demotion (:1396-1470), reclaimable_if_pinned parity (:1472-1504).
Merge Risk: Medium · up to a7568c2
  • Blast radius on both GPU eviction paths: eviction_key (helios/src/cache.rs:363-365, used at :732) alters victim selection for mandatory reclamation (evict, from ensure_resources at helios/src/scheduler.rs:1272 and refill_reservations at :1356) and budgeted optional captures (eviction_candidate_within_budget, from simulate_snapshot_quote at helios/src/scheduler/cache_memory.rs:365). Mandatory eviction cannot livelock (protection orders victims, does not filter them), and PrefixCheckpointCache::clone preserves quote re-simulation determinism (cache_memory.rs:337, 412-424).
  • Eviction-stability regressions under workload shifts and snapshot pressure: Non-monotonic aging (cache.rs:349-361) can re-protect stale entries when the cache refills or shifts toward smaller checkpoints; omitting compact_ancestor (cache.rs:626-657) from turnover leaves stale protected entries unaged under snapshot-only compaction pressure.
  • Hot-path, concurrency, compatibility safety: PrefixCheckpointCache remains single-owner &mut state with O(1), allocation-free eviction_key evaluation and saturating integer arithmetic; no locks, buffers, core-format fields, or exported-core compatibility changes.
Pre-merge checks: ✅ 2 passed · ⚠️ 2 warnings
Blockers (2)
  1. Non-monotonic is_protected aging re-protects stale demoted checkpoints without a new hit (helios/src/cache.rs:346-361, :257-274, :604-609).
    • is_protected tests !(page_turnover >= self.tail_pages.max(1) as u64 && node_turnover >= self.ready_checkpoints.max(1) as u64) against live counts that grow on every publication (count() at :257-264). Once a stale checkpoint demotes, any later publication raising tail_pages/ready_checkpoints above its turnover flips it back to protected with no second reuse hit.
    • Concrete proof in the PR's own geometry (helios/src/cache/tests.rs:1447-1467): after the 3rd leaf eviction (evicted_pages = 6, evicted_checkpoints = 3, tail_pages = 2, ready_checkpoints = 2) stale is demoted; if two fresh 1-page checkpoints publish before the next eviction (tail_pages = 4, ready_checkpoints = 4), node_turnover = 3 < 4 silently re-promotes stale so evict drops fresh work. Same dynamic inflates the aging horizon on a shift from a few large sessions to many small checkpoints. (Secondary: self.tail_pages counts ready and unready checkpoints at :263, while evicted_pages counts only node.ready leaves at :604-609.)
    • Fix: Make demotion sticky — e.g., clear node.reused = false on expired nodes when turnover advances in retire_leaf (or evaluate against a monotonic bound that cannot re-enable demoted nodes, without freezing a near-empty warmup count at mark_reused). Add a regression test in helios/src/cache/tests.rs publishing multiple fresh checkpoints after demotion and asserting the entry stays probationary.
  2. Missing blocking check.py --mutations run and inaccurate host-restore verification claim (docs/design-review.md:226-228, 247-251, helios/src/scheduler.rs:1884-1887, verification/helios-lifecycle/check.py:515-520).
    • docs/design-review.md:226-228, 247-251 require python3 verification/helios-lifecycle/check.py --mutations (or cargo-mutants) whenever safety/eviction guards change, and state that an unrun applicable CPU check blocks acceptance. check.py:515-520 directly guards eviction_candidate_within_budget, whose victim ordering this PR modifies, yet only check.py --jobs 4 is reported.
    • The description's "Selene restore touch_hit is verified by unit tests and TLA+, not live offload" is unsupported: none of the four added tests (helios/src/cache/tests.rs:1315-1504) invokes finish_inbound; no existing finish_inbound test (helios/src/scheduler/tests.rs:2914-3208) asserts reuse protection or eviction ordering after restore; CacheOwnership.tla (verification/helios-lifecycle/README.md:240-241) models neither host restore nor retention/eviction ranking.
    • Fix: Run and report check.py --mutations; add a finish_inbound unit test in helios/src/scheduler/tests.rs asserting protection/eviction order against an un-reused scan; correct the description's evidence claims.
Should Fix (4)
  1. compact_ancestor never advances turnover counters, preventing aging under snapshot-only compaction pressure (helios/src/cache.rs:626-657 vs :601-609, :749-753).
    • Under snapshot-row pressure (KV pages not exhausted), evict_checkpoint retires single-child interior ancestors via compact_ancestor (frees 1 snapshot, 0 pages) without incrementing evicted_checkpoints or evicted_pages. Stale protected entries therefore never age out when ancestor compaction absorbs the pressure; alongside leaf evictions, compacted checkpoints still never advance node_turnover.
    • Fix: Count compacted ready snapshots in turnover (and ensure snapshot-pressure turnover can age out stale protected entries instead of stalling on page_turnover == 0); add a compaction-aging test in helios/src/cache/tests.rs plus a regime-shift check with reused Phase-1 documents in helios/src/scheduler/policy_tests.rs.
  2. Preemption and cancelled-waiter asymmetry on host restore (helios/src/scheduler.rs:1884-1887 vs :1727-1739).
    • GPU hits gate touch_hit on fresh_admission = accounting.is_none() (scheduler.rs:1727, 1735) so preempted re-admissions only refresh recency; finish_inbound (scheduler.rs:1884-1887) calls self.cache.touch_hit(id, ticket.demand_epoch)? unconditionally on PublishResult::Created, even when the ticket's only waiter was a preempted re-admission (helios/src/server/runtime.rs:3158 passes accounting.clone()) or all waiters were cancelled (ticket.waiters.is_empty(), as in scheduler/tests.rs:2976, 3152).
    • Fix: Record fresh_admission: bool on Ticket (set/ORed at scheduler.rs:1686-1709) and call touch_hit in finish_inbound only when ticket.fresh_admission && !ticket.waiters.is_empty() (otherwise plain touch), with a test in helios/src/scheduler/tests.rs.
  3. Design docs contradict the new victim ordering (docs/core-design.md:1536-1567, docs/scheduling-runtime-design.md:643-645, docs/prefix-cache-offload.md:298, AGENTS.md:52-60).
  4. BFS dedup key collides distinct reused states (helios/src/cache/lifecycle_tests.rs:498-505).
    • Fixture::key() appends eviction_key-sorted IDs to self.projection(), which intentionally omits reused and turnover counters to stay aligned with CacheOwnership.tla's 29-integer tuple (verification/helios-lifecycle/README.md:230-234). Since Action 8 (duplicate publication, lifecycle_tests.rs:293-296) now sets node.reused = true via touch_hit, states differing only in reused (e.g. [false, false, false] vs [false, false, true]) both sort to [1, 2, 3] and produce identical keys, so visited.insert(next.key()) (:617) prunes branches where later duplicate publications yield distinct eviction orders.
    • Fix: Append each live node's protection/reuse state (plus relevant turnover state) to Fixture::key(), leaving projection() unchanged so CacheOwnership.tla stays valid; re-run check.py.
Subtract / Simplify (2)
  1. Delete dead duplicate write of existing.accessed (helios/src/cache.rs:468). In publish_with_retention's Existing branch (:466-471), line 468 writes existing.accessed = existing.accessed.max(use_epoch); and line 471 calls self.touch_hit(id, use_epoch)?, whose self.touch(...) (:377-382) performs the identical assignment. Delete line 468 (−1 LOC).
  2. Delete inert 33-line duplicate test (helios/src/cache/tests.rs:1472-1504). reclaimable_if_pinned_matches_evict_with_mixed_protected_and_probationary_nodes uses evicted_after_pin (tests.rs:1026-1038), which evicts with pages: usize::MAX, snapshots: usize::MAX and compares sorted(...) sets — victim order cannot change the drained fixpoint, and reclaimable() (cache.rs:785-843) reads none of the new fields. The same invariant is covered on richer topologies by projection_matches_eviction_for_chains_branches_and_compaction (tests.rs:1041-1080) and reclaimable_projection_matches_eviction_with_pins (lifecycle_tests.rs:641-703). Delete :1472-1504 (−33 LOC).
Nits (2)
  • A/B benchmark clarity: Served A/B numbers are n = 2 cold-salted trials/arm on a single boot with no variance, and the −86.3% Long-MT p50 TTFT drop (against a 1.74× hit-rate increase) is unexplained (plausibly queueing/prefill-stall avoidance with 127K turns resident). Add variance or a brief causal note, and confirm Bound optional Endpoint checkpoint eviction by age-discounted marginal gain #568's policy_* tests in helios/src/scheduler/policy_tests.rs:6301-6485 passed.
  • Formatting: Remove the doubled blank line at helios/src/cache/tests.rs:1313-1314.
Dropped on verification (8)
  • Upstream F3 ("finish_inbound treats a cold scan as a reuse hit"): Dropped — misread execution phase. A prefix exists in the host/Selene store only if a prior request published and offloaded it (docs/prefix-cache-offload.md:286-290); recreating it on GPU is a host-tier hit (scheduler.rs:1901 increments stats.host_hits). Replaced by the verified narrow defect in Should Fix flare run fails at "Prepare execution": cuGraphAddKernelNode_v2 CUDA_ERROR_INVALID_VALUE (qwen3.8-flash TP2, RTX PRO 5000 Blackwell 48 GB) #2.
  • Upstream F4 ("PublishResult::Existing lets a single request self-promote"): Dropped — false. publish_with_retention rejects tail_tokens == 0 before checking self.prefixes (helios/src/cache.rs:435-443) and publish_boundary advances request.prefix_tokens = capture.consumed_tokens on Created (helios/src/scheduler.rs:2949-2965, 3078-3104); Existing only arises from genuine cross-request reuse.
  • Discovery Dossier ("missing Kani sequential proofs"): Dropped — N/A. Per docs/design-review.md:221-225, Kani covers completion-vector validation, prepared completion contracts, and state-view extent arithmetic, none of which this PR touches (consistent with Bound optional Endpoint checkpoint eviction by age-discounted marginal gain #568).
  • Upstream F5 overclaim ("violates AGENTS.md:204-206 maintainer-decision rule"): Dropped as overstated; retained the concrete AGENTS.md:52-60 doc contradiction in Should Fix Message prefix checkpoint skipped at a conditioned window boundary #3.
  • Upstream F6 fix ("add reused and turnover counters to Fixture::projection()"): Dropped — would break CacheOwnership.tla's 29-integer AllowedEdge tuple (verification/helios-lifecycle/README.md:230-234); narrowed to Fixture::key().
  • Upstream F8 ("add protected/reused fields to CacheStats"): Dropped — unrequested scope creep, widens the diff and conflicts with Report KV pages held by active requests #549.
  • Upstream F9 ("33% inheritance leaks protection onto scan endpoints"): Dropped — low-signal design preference; ratio inheritance (cache.rs:478-481, tested at cache/tests.rs:1347-1394) is the PR's stated zero-knob heuristic, not a correctness bug.
  • Discovery Dossier ("unchecked self.nodes.get_mut(&id).unwrap() in mark_reused"): Dropped — provably unreachable; mark_reused (cache.rs:367-374) is called only from touch_hit (:385-389) right after self.touch(id, use_epoch)? validates id via self.checkpoint(id)? (:378).

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

@FujitsuPolycom
FujitsuPolycom force-pushed the perf/helios-scan-resistant-prefix-cache branch from a7568c2 to c919742 Compare December 1, 2026 22:40
@FujitsuPolycom

Copy link
Copy Markdown
Contributor Author

Addressed all review items in squashed commit c9197427 (tree 597c23c5 atop 5d53040e, 0 conflicts vs main):

  • Blocker Congratulations! #1 (sticky demotion + symmetry): is_protected reads sticky node.reused (cache.rs:353); added ready_tail_pages + demote_expired_reused (:360, via retire_leaf/compact_ancestor) so expired nodes never re-protect (sticky_demotion_does_not_reprotect_*).
  • Blocker flare run fails at "Prepare execution": cuGraphAddKernelNode_v2 CUDA_ERROR_INVALID_VALUE (qwen3.8-flash TP2, RTX PRO 5000 Blackwell 48 GB) #2 (check.py --mutations + finish_inbound): Ran full check.py --mutations (26/26 Rust + 13/13 TLA+ + DispatchRing SlotReuseSafe KILLED), added finish_inbound tests (scheduler/tests.rs:3233, :3258), and updated PR evidence scope.
  • Should Fix Congratulations! #1 (compact_ancestor): Counted compacted ready ancestors in evicted_checkpoints (:643) with a 2x ready_checkpoints ceiling + compaction_pressure_* and policy_regime_shift_* tests.
  • Should Fix flare run fails at "Prepare execution": cuGraphAddKernelNode_v2 CUDA_ERROR_INVALID_VALUE (qwen3.8-flash TP2, RTX PRO 5000 Blackwell 48 GB) #2 (Ticket.fresh_admission): Recorded fresh_admission on Ticket (scheduler.rs:629, :1678, :1698, :1709) and gated finish_inbound touch_hit on ticket.fresh_admission && !ticket.waiters.is_empty() (:1886).
  • Should Fix Message prefix checkpoint skipped at a conditioned window boundary #3–4: Synced docs/core-design.md, docs/scheduling-runtime-design.md, docs/prefix-cache-offload.md (citing #568, #298, #416); added reused + turnover state to Fixture::key() (lifecycle_tests.rs:499).
  • Subtractions & Nits: Dropped dead existing.accessed write and redundant reclaimable_if_pinned_* test, fixed blank line, and added per-trial spread, queueing-stall note, a7568c2c scope, and 6/6 policy_* citation in the PR body.
  • Archive checks (tree 597c23c5): 0 release warnings across 4 crates; cache:: 49/138, scheduler:: 411, flare --lib 238, flare-cli 239, test_core_boundary.py 4; check.py 10/10 TLC, 8/8 observed (621,390 transitions), 12/12 aux, 39/39 mutations KILLED.

Why

`PrefixCheckpointCache::eviction_candidate_within_budget` previously ordered
removable checkpoints solely by `(RetentionRank { use_epoch, role,
consumed_tokens }, id)` (NVIDIA#568). Because `RequestScheduler::retire` refreshes
`use_epoch` via `cache.touch` on every normal completion (NVIDIA#298, NVIDIA#416), one-shot
cold prefills with zero prefix reuse finished at the most-recently-used end of
the cache ahead of idle multi-turn sessions waiting between turns. Under KV page
pressure, `evict` discarded actively reused multi-turn checkpoints before dead
one-shot leaves.

What

- `helios/src/cache.rs` (`+138/-22`, `116` net LOC incl. test-only stats
  invariant): Track cross-request reuse state (`reused`,
  `reused_at_evicted_pages`, `reused_at_evicted_nodes`) on `Checkpoint`, plus
  `ready_tail_pages`, `evicted_pages`, and `evicted_checkpoints` on
  `PrefixCheckpointCache` (counting both retired ready leaves in `retire_leaf`
  and compacted ready ancestors in `compact_ancestor`).
- Add `PrefixCheckpointCache::touch_hit` for genuine cross-request prefix reuse
  without promoting creator-completion `touch` refreshes, and
  `publish_with_retention_with_hit` so duplicate capture publications promote
  while waiterless or preempted-only host-store `Existing` restores refresh
  demand recency only.
- Inherit reuse protection on a newly published child only when its parent is
  protected and `parent_len * 2 >= tail_tokens` (`>= 33%` reused prefix),
  protecting linear multi-turn continuations while keeping low-reuse scans that
  share a short boilerplate prefix probationary.
- Make demotion sticky: `demote_expired_reused` permanently clears `node.reused`
  when retirements since the last reuse hit turn over either both
  `ready_tail_pages.max(1)` and `ready_checkpoints.max(1)`, or `2x`
  `ready_checkpoints.max(1)` under snapshot-bound or compaction pressure.
- Order `eviction_candidate_within_budget` by `(self.is_protected(node),
  node.retention_rank(), node.id)` while keeping `eviction_candidates()`,
  `reclaimable_if_pinned`, `RetentionRank`, and optional-capture budget filters
  unchanged.
- `helios/src/scheduler.rs` (`+32/-13`, `19` net LOC): Gate GPU-hit `touch_hit`
  on `accounting.is_none()`, track per-waiter `(RequestHandle, bool)` freshness
  on `Ticket` so cancelling a fresh waiter recomputes freshness from remaining
  live waiters, and gate both `Created` and `Existing` `finish_inbound` reuse
  promotion on `ticket.waiters.iter().any(|&(_, fresh)| fresh)`.
- `docs/core-design.md`, `docs/scheduling-runtime-design.md`,
  `docs/prefix-cache-offload.md`, `helios/README.md`: Reconcile two-tier
  protection ordering, child inheritance, sticky turnover aging, and
  host-restore admission gating across all cache/offload specifications.
- `helios/src/cache/tests.rs`, `helios/src/cache/lifecycle_tests.rs`,
  `helios/src/scheduler/tests.rs`, `helios/src/scheduler/policy_tests.rs`: Add
  unit and policy tests for scan resistance, inheritance, sticky demotion,
  compaction aging, reused-document regime shifts, per-waiter cancellation, and
  `Existing` restore gating, and include reuse/turnover state in
  `Fixture::key()`.

Result

Single-boot A/B vs `5d53040e` on 4x NVIDIA RTX PRO 6000 (`DeepSeek-V4.1-Flash`
TP4, core `gb202-tp4-202612010626`, `--kv-cache-limit memory --memory-limit
83GiB --prefix-cache-memory 0`, `2,606,848` KV tokens / `20,366` pages, `n = 2`
cold-salted trials/arm, measured on `a7568c2c` prior to sticky-demotion,
compaction-turnover, and restore-gating hardening):

- Scan-thrash (`24 x 8K` agents vs `8 x 214K` scans, `100s`): hit rate
  `33.95% / 8.91%` (mean `19.76%`) -> `51.82% / 25.99%` (mean `37.31%`, `1.89x`),
  saved prefill `2,083.8 / 749.6` -> `3,335.5 / 2,228.1 tok/s` (`+96.4%`).
- Long-context multi-turn (`4 x 127K` 4-turn vs `12 x 8K` noise): hit rate
  `24.61% / 32.58%` (mean `28.62%`) -> `49.38% / 50.04%` (mean `49.71%`,
  `1.74x`), median TTFT `23,886.7 / 22,228.7` -> `2,876.8 / 3,459.5 ms`
  (`-86.3%` from avoiding 127K re-prefill queueing stalls), saved prefill `+75.8%`.

Limits: Default-ON with no opt-out flag; under a sudden workload shift, stale
reused entries survive until full dual turnover or `2x` ready-checkpoint
turnover, evicting newly admitted probationary entries first during the
transition window. No effect when KV capacity fits idle sessions without
eviction or active scans exceed total KV capacity. Live GPU A/B ran on
`a7568c2c` with `--prefix-cache-memory 0`; host-restore gating is verified by
scheduler unit tests rather than live offload serving.

Evidence

- Clean-archive Rust release checks & tests atop `1fbcc3c9` (`rustc 1.94.1`,
  tree `402aa4794d46`, `RUSTFLAGS="-D warnings"` `0` warnings across `helios
  --features runtime-core,server --lib/--tests`, `flare --lib`, `flare-cli
  --bins`, `heliopause --features extension-module --lib`):
  - `helios --features server --lib`: `1,284 passed; 0 failed; 14 ignored` (`8`
    `FLARE_TEST_TEMPLATE_DIR`-gated template tests skipped)
  - `helios --features runtime-core,server --lib`: `1,796 passed; 0 failed; 46
    ignored` (`8` `FLARE_TEST_TEMPLATE_DIR`-gated template tests skipped)
  - Targeted: `cache::` `49` (`server`) / `139` (`runtime-core,server`),
    `scheduler::policy_tests::policy_` `6/6`, `scheduler::tests::finish_inbound_`
    `5/5`
  - `flare --lib`: `246 passed; 0 failed; 4 ignored`
  - `flare-cli`: `245 passed; 0 failed; 3 ignored` (`219+9+6+4+7`)
- TLA+ lifecycle & mutation gate (`verification/helios-lifecycle/check.py`,
  Temurin JRE `21.0.13+9`, TLA+ `1.7.4`, `--jobs 4`):
  - `10/10` TLA+ model configs (`0` errors), `8/8` observed Rust trace suites
    (`621,390` transitions total, incl. `222,817` `CacheOwnership.tla`), `12/12`
    aux checks passed.
  - `check.py --mutations`: `26/26` Rust mutations KILLED, `13/13` TLA+ model
    mutations KILLED, and `1/1` `DispatchRing SlotReuseSafe` bad-edge KILLED.
- Python checks: `pytest tests/preparation/test_core_boundary.py
  tests/test_scheduling*.py` (`834 passed; 0 failed`); `ruff==0.12.8` reports
  `0` issues on PR-touched files (no Python files modified).

Discord: Dooner

Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
@FujitsuPolycom
FujitsuPolycom force-pushed the perf/helios-scan-resistant-prefix-cache branch from c919742 to c5b3923 Compare December 2, 2026 00:22
@FujitsuPolycom

Copy link
Copy Markdown
Contributor Author

Rebased onto main (1fbcc3c9) and addressed all review and rubric items in squashed commit c5b39236 (tree 402aa4794d46, 0 conflicts):

  • Per-waiter restore freshness (scheduler.rs): Replaced sticky Ticket::fresh_admission with waiters: Vec<(RequestHandle, bool)> so cancelling a fresh waiter recomputes freshness from live waiters (finish_inbound_cancelling_fresh_waiter_leaves_preempted_waiter_probationary).
  • Gated Existing restore promotion (cache.rs, scheduler.rs): Added publish_with_retention_with_hit so waiterless and preempted-only finish_inbound Existing matches refresh recency only (finish_inbound_existing_checkpoint_requires_live_fresh_waiter_for_promotion).
  • Sticky aging & compaction (cache.rs): is_protected reads sticky node.reused; demote_expired_reused permanently demotes on dual turnover (ready_tail_pages + ready_checkpoints) or 2x ready_checkpoints via retire_leaf/compact_ancestor (Fixture::key() updated).
  • Normative docs & commit hygiene: Reconciled docs/prefix-cache-offload.md (Sections 2.2 & 2.3), helios/README.md, docs/core-design.md, and deduplicated docs/scheduling-runtime-design.md; fixed commit footer Discord: Dooner and added cold-shift lag + exact flare run / 2-workload repro in PR body.
  • Full clean-archive checks (ce649b30 == tree 402aa4794d46): 0 -D warnings across 4 crates; full helios server 1,284 & runtime-core,server 1,796 (cache:: 49/139, policy_* 6/6, finish_inbound_* 5/5), flare 246, flare-cli 245, pytest 834; check.py --mutations: 10/10 TLC, 8/8 obs (621,390), 12/12 aux, 26/26 Rust + 13/13 TLA+ + 1/1 DispatchRing bad-edge KILLED.

@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Ready To Merge

Rebased onto main (1fbcc3c9) at head c5b39236, PR #665 resolves every blocker, should-fix, subtraction, and nit from the prior review and closes the residual Existing-restore and documentation issues found on intermediate head c919742. The policy stays lean, zero-knob, and model-agnostic (135 net production LOC; no flags, floats, unsafe, or core-format changes), with synced design docs and full check.py --mutations plus unit/policy coverage on the pushed tree.

  • Blockers: 0 · Should fix: 0 · Subtract/Simplify: 4 · Nits: 2
Walkthrough
  • helios/src/cache.rs (+138/−22): New Checkpoint fields (reused, reused_at_evicted_pages, reused_at_evicted_nodes, :84-86) and cache counters (ready_tail_pages, evicted_pages, evicted_checkpoints, :219-224), maintained across count/uncount (:263, :274), compact_ancestor (:684-686), advance_completed (:905) with a #[cfg(test)] full-scan assertion (:928-947). Adds sticky demotion via demote_expired_reused (:360-376, from retire_leaf :631-641 and compact_ancestor :659-690), eviction_key (:378-380, used :777), touch_hit (:400-404), gated Existing promotion in publish_with_retention_with_hit (:423-550), and >= 33% continuation inheritance (:507-510).
  • helios/src/scheduler.rs (+32/−13): Ticket.waiters becomes Vec<(RequestHandle, bool)> (:631, :1699, :1714, :3105) tracking per-waiter fresh_admission = accounting.is_none() (:1682). Gates GPU hit promotion (:1739-1745) and host-restore promotion in finish_inbound on has_fresh_waiter (:1863) for both Existing (:1864-1870) and Created (:1896-1903); completion refresh in retire (:3138-3155) stays on plain touch.
  • helios/src/cache/lifecycle_tests.rs (+29/−3): Copies new fields in Fixture::fork (:79-81, :96-98) and appends eviction_key-ordered IDs, reused flags, and turnovers to Fixture::key() (:499-526), keeping projection() aligned with CacheOwnership.tla.
  • Tests (cache/tests.rs +319, scheduler/tests.rs +264, scheduler/policy_tests.rs +53): 5 isolated cache tests (scan resistance, >= 33% inheritance, dual-turnover aging, sticky demotion, snapshot-only compaction aging), 4 real-scheduler finish_inbound_* tests (fresh/cancelled/preempted/mixed waiters on both Created and Existing), and a reused-document regime-shift workload test.
  • Docs (core-design.md, prefix-cache-offload.md, scheduling-runtime-design.md, helios/README.md): All four specs reconciled to the two-tier (is_protected, RetentionRank, id) ordering, >= 33% inheritance, sticky dual-turnover / 2x compaction demotion, and live-fresh-waiter host-restore promotion (incl. prefix-cache-offload.md:298-306, :377-381).
Merge Risk: Medium · up to c919742
  • Eviction-path blast radius: eviction_key (cache.rs:378-380, applied :777) changes victim ordering for both mandatory reclamation and optional budgeted captures (re-simulated in scheduler/cache_memory.rs:337-371). Protection only orders victims, so mandatory eviction cannot livelock, #568's retention-rank and marginal-gain filters still run before tier ordering, and clone preserves quote re-simulation determinism.
  • Default-on workload trade-off: Always on with no opt-out; on an abrupt cold workload shift, stale reuse-protected entries survive until full dual turnover (ready_tail_pages.max(1) pages + ready_checkpoints.max(1) checkpoints) or 2x ready_checkpoints.max(1) retirements under snapshot-bound pressure (cache.rs:360-376), evicting newly created probationary entries first during the transition window.
  • Concurrency, compatibility, and rebase surface: All new state lives inside single-owner &mut structures with saturating integer arithmetic and no locks, external inputs, or core-format changes. Expected textual conflict with open PR Report KV pages held by active requests #549 on Checkpoint/PrefixCheckpointCache fields (cache.rs:84-86, :219-224) and Fixture::fork/Fixture::key (lifecycle_tests.rs:79-98, :499-526), with no semantic overlap.
Pre-merge checks: ✅ 2 passed · ⚠️ 2 warnings
  • ✅ Security / malicious screen: Pure in-memory cache/scheduler integer bookkeeping; no external input parsing, unsafe, or new attack surface.
  • ✅ Charter & value fit: Right Helios runtime layer, zero flags/knobs/model branches/core changes, four-part PR description citing #568/#298/#416 with served A/B benchmarks and synced docs.
  • ⚠️ Related / duplicate / conflict check: Genuinely additive and cleanly rebased on 1fbcc3c9, but guaranteed textual conflict with open PR Report KV pages held by active requests #549 in helio/src/cache.rs and helios/src/cache/lifecycle_tests.rs (no semantic conflict).
  • ⚠️ Tests & verification evidence: Full clean-archive CPU suites and check.py --mutations (10/10 TLC, 8/8 observed, 12/12 aux, 39/39 + 1/1 bad-edge KILLED) reported for pushed tree 402aa479 (c5b39236), though CI results are not visible in this environment and the served GPU A/B (n = 2 trials/arm, --prefix-cache-memory 0) was measured on pre-hardening head a7568c2c (disclosed in the PR body).
Should Fix / Subtract — 4 items, all optional
  1. Factor duplicate retirement turnover accounting (cache.rs:630-641, :658-690): retire_leaf and compact_ancestor repeat the same pre-uncount horizon capture (ready_tail_pages.max(1), ready_checkpoints.max(1)), if node.ready guard, counter updates, and demote_expired_reused call. Folding them into one note_ready_retirement(&mut self, node: &Checkpoint, pages: u64) helper called right after self.nodes.remove(&id) and before self.uncount(&node) (passing node.tail_pages.len() as u64 vs 0) removes ~14 lines and enforces the pre-uncount ordering in one place.
  2. Collapse one-line is_protected wrapper and narrow eviction_key visibility (cache.rs:353-355, :378-380): is_protected(&self, node: &Checkpoint) reads only node.reused without touching self, and eviction_key is only called from cache.rs:777 and the child test module (lifecycle_tests.rs:504). Replacing both with a private associated function fn eviction_key(node: &Checkpoint) -> (bool, RetentionRank, CheckpointId) deletes 6 lines and removes the receiver indirection.
  3. Inline single-caller mark_reused and align field naming (cache.rs:86, :382-404): mark_reused has one caller (touch_hit at :402) and performs a second self.nodes.get_mut(&id) lookup right after self.touch already probed the map. Inlining the three field assignments avoids the duplicate hash lookup per hit; renaming reused_at_evicted_nodes (:86) to reused_at_evicted_checkpoints matches evicted_checkpoints (:224).
  4. Deduplicate shared setup in new cache and policy tests (cache/tests.rs:1396-1567, scheduler/policy_tests.rs:6380-6480): sticky_demotion_does_not_reprotect_after_fresh_publications repeats the first 56 lines of dual_turnover_aging_demotes_stale_reused_entry_after_page_and_node_turnover, and policy_regime_shift_ages_out_reused_old_large_documents_for_newer_chat_workload duplicates policy_regime_shift_ages_out_old_large_documents_for_newer_chat_workload except for the second turn in Phase 1. Two small test helpers remove ~80 lines while keeping all test names unchanged.
Nits — 2 items
  • Unready guard symmetry (cache.rs:364-375): demote_expired_reused iterates all nodes without if !node.ready { continue; }. Every production publication creates ready checkpoints (scheduler.rs:1861, :2981-2983, :3072), so this is unreachable today, but the guard would align demotion with eviction_candidates() (cache.rs:716) if a future caller publishes ahead of completed.
  • A/B head freshness: The PR body discloses that the GPU A/B ran on a7568c2c with --prefix-cache-memory 0; since the hardened policy only demotes earlier (2x compaction turnover, sticky demotion) and restricts restore promotion, re-running on c5b39236 (ideally with host offload enabled) would tighten the performance record if GPU capacity is free.

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

FujitsuPolycom added a commit to FujitsuPolycom/flare-local-inference that referenced this pull request Dec 2, 2026
…l swap

Why

Under concurrent mixed prefill and decode load (multiple long cold prompts
competing alongside active decoders), prefill valuation in
helios/src/scheduler/policy.rs and scripts/scheduling_sim/utility.py has two
structural defects:

1. Scalar min_i(rem_i) collapse: clamping the decode-batch coalescing horizon
   and expected speculative output across active decoders to min_i(rem_i)
   collapses coalescing credit whenever one active decoder nears completion.
2. Multi-chunk prefill lockstep: ServicePrice::observe credits each
   intermediate prefill chunk, dropping the executing prompt's normalized
   price below untouched peers so long prompts advance in lockstep instead of
   completing sequentially and freeing KV pages.

Averaging bounded per-decoder remaining budgets across active decoders prevents
single-stream collapse without inflating credit past the cohort's remaining
output. Recording planned normalized-entitlement swaps among competing
multi-chunk prefills at submission, projecting queued swaps across depth-2
pipelines, and applying the exchange only at validated completion conserves
aggregate prefill entitlement relative to active decoders while preserving
completion-only accounting and rejection safety.

What

- Helios scheduler (helios/src/scheduler.rs, helios/src/scheduler/policy.rs,
  helios/src/scheduler/service.rs, helios/src/scheduler/utility.rs; +263/-39,
  +224 net non-test Rust production LOC; zero CLI, config, decode, ABI, unsafe,
  or lock changes):
  - Replaced scalar min_i(rem_i) in coalescing_prefill_log_bonus with the
    cohort mean across all active decoders for both speculative expected output
    and the coalescing horizon (bounded by coalescing_horizon_tokens and each
    prefiller's post-prefill output budget).
  - Added ServicePrice::{log_normalized_share, swap_normalized_share},
    best_prefill_chunk, stack-allocated heavy_prefill_donors (zero heap Vec
    allocations), projected_services, and Submission::prefill_share_swap.
  - Multi-chunk pairing activates only when active non-terminal decoders exist
    (excluding retiring Snapshot requests), token_fairness > 0,
    decode_age_price > 0 (inactive under --scheduler-policy throughput), and at
    least two non-terminal, non-prompt_logprobs prefills exceed
    prefill_chunk_size (including deferred TerminalPrefill chunks). Single-chunk
    prefills (remaining <= prefill_chunk_size) are excluded even when the
    highest-throughput chunk c_max is smaller than prefill_chunk_size.
  - Submission records any non-self (recipient, donor) handle pair computed
    from projected prices without mutating stored prices. Depth-2 projection
    (projected_services) applies pending swaps before projecting queued frames.
    observe_service executes swap_normalized_share only after
    observed_duration_ns returns Some, verifying non-error status, positive
    useful_tokens on the recipient, and matching live request handles.
- Python scheduling simulator (scripts/scheduling_sim/utility.py; +105/-7):
  mirrored cohort-mean coalescing and weighted-conserving multi-chunk share
  exchange (ranking and swapping log_price to conserve aggregate sum q_i across
  unequal weights, gated on reference is not None, age_price > 0,
  rate_history == "service", and remaining_prefill > max_prefill_cap, using
  log-space urgency to avoid overflow on tiny durations, and validating
  duration_ms and committed rows before mutating prices or clearing donors).
- Documentation and tests (+127/-35 docs; +784/-0 Rust tests; +245/-0 Python
  tests): placed canonical specification and linear-aging preemption limits in
  docs/scheduling-utility.md, reconciled docs/scheduling-runtime-design.md,
  docs/scheduling-theory.md, and helios/README.md, and added unit tests
  covering packed/unpacked speculative cohort-mean, zero-fairness/throughput
  opt-out, prompt_logprobs exclusion, single-chunk exclusion below
  prefill_chunk_size, arrival-wait aging and tie-breakers, completion-only
  depth-2 pipelining, error/zero-timing invariance, Mixed prefill swaps, and
  weighted Python conservation.

Result

Measured incrementally atop post-NVIDIA#663 main (1fbcc3c):
- All 21 standard simulator workloads in scripts/scheduling_sim/workloads.py
  under both standard and mixed catalogs and both balanced and throughput
  policies show zero regressions (0/21 changed).
- --scheduler-policy throughput (decode_age_price == 0) is byte-for-byte
  unchanged by share swaps across all tested workloads.
- Under balanced policy on concurrent multi-chunk workloads alongside active
  decoders (standard catalog): 2 decoders + 2x16k shifts heavy TTFTs from
  [593.1, 678.4] ms to [383.9, 857.2] ms (first -35.3%, mean 320.1 -> 312.5 ms,
  max_output_gap_ms unchanged at 217.3 ms, output_tok_s -1.9%, decode_age_area
  +6.2%); 4 decoders + 4x16k shifts heavy TTFTs from [1436.0..1637.3] ms to
  [788.0, 970.6, 1968.6, 2200.6] ms (first -45.1%, mean 773.5 -> 744.7 ms,
  max_output_gap_ms 213.0 -> 226.6 ms, output_tok_s -2.4%, decode_age_area
  +7.9%). On mixed catalog: 2 decoders + 2x16k shifts mean TTFT -17.2% (first
  -36.9%, gap unchanged 145.0 ms, out -1.8%); 4 decoders + 4x16k shifts mean
  TTFT -21.1% (first -57.4%, gap unchanged 114.7 ms, out -1.5%). Live
  SM120/SM121 flare run GPU A/B is pending before upstream review.

Evidence

Verified on clean git archive (tree d0c622a) atop 1fbcc3c:
- Merge-tree: 0 conflicts vs upstream/main (1fbcc3c), NVIDIA#660 (9709d49),
  NVIDIA#661 (c588d61), NVIDIA#665 (c5b3923), and composed main + NVIDIA#660 + NVIDIA#665.
- Rust builds & tests: RUSTFLAGS="-D warnings" cargo check --locked --release
  across helios, flare, flare-cli, and heliopause passed with 0 warnings;
  helios --features server --lib 1,284 passed; helios --features
  runtime-core,server --lib 1,796 passed (excl. 6 FLARE_TEST_TEMPLATE_DIR
  tests); flare --lib 246 passed; flare-cli 245 passed (0 failed).
- Python & simulator: pytest (test_core_boundary.py + test_scheduling*.py) 838
  passed; ruff==0.12.8 0 issues; full 21-workload sweep under balanced and
  throughput (standard + mixed catalogs).
- Formal & mutations: 10/10 standalone Java TLC configs, 8/8 observed Rust
  TLA+ traces (594,065 transitions, 0 errors), 12/12 aux tests, 26/26 check.py
  Rust lifecycle mutations + 13/13 TLA+ model mutations + 1/1 DispatchRing
  SlotReuseSafe observed-edge check KILLED (0 survivors), plus 13/13 reachable
  custom Rust PR mutations and 12/12 custom Python PR mutations KILLED.
- Limits: live SM120/SM121 flare run GPU A/B is pending; learning.py --preset
  validate and cargo-kani were not run because their covered code is unchanged.

Discord: Dooner

Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
FujitsuPolycom added a commit to FujitsuPolycom/flare-local-inference that referenced this pull request Dec 2, 2026
Why

In Helios's prepared-graph scheduler (`helios/src/scheduler/policy.rs`),
the per-prefill-token decode-batch coalescing bonus
(`coalescing_prefill_log_bonus`) prices the steady-state throughput gain
unlocked when queued prefills join an under-batched active decode cohort
over a bounded output-token horizon (`coalescing_horizon_tokens`, default
64.0). Previously, `coalescing_prefill_log_bonus` reduced all active
decoders' remaining output budgets to a single scalar minimum
(`peer_budget = peer_budget.min(rem)`), and the Python reference scheduler
(`scripts/scheduling_sim/utility.py`) used the same scalar minimum for the
coalescing horizon. Under heterogeneous mixed serving, any single active
decoder within one token of its output limit (`rem = 1`) collapsed both the
speculative per-round expected output (`mean_out`) and the coalescing
horizon to 1 token for the entire cohort, eliminating over 98% of the
coalescing incentive even when all other active decoders had large remaining
budgets.

Averaging per-decoder clamped budgets across the active cohort preserves
accurate continuation value when individual requests approach completion
while still shrinking smoothly as the cohort as a whole approaches its
output limit.

What

- In `helios/src/scheduler/policy.rs::coalescing_prefill_log_bonus` (+11/-10
  lines, +1 net Rust production LOC; function visibility unchanged):
  - Replace the scalar minimum `peer_budget` with a bounded per-decoder
    remaining-budget array (`decoder_rems`), where each `rem` is an active
    decoder's remaining output tokens.
  - Compute speculative per-round expected output (`mean_out`) by clamping
    `expected_at(width)` (speculative expected accepted tokens per round,
    evaluated at `eff_width` in the packed branch and `width` in the
    unpacked branch) to each active decoder's `rem` and averaging across
    `decoder_rems[..decoder_count]`.
  - Compute each prefiller's coalescing `horizon` by clamping each active
    decoder's `rem` to `min(coalescing_horizon_tokens, post_prefill)`
    (where `post_prefill` is the prefiller's remaining output budget after
    its first generated token) and averaging across
    `decoder_rems[..decoder_count]`.
- In `scripts/scheduling_sim/utility.py` (+2/-6, -4 net Python LOC): replace
  `peer_budget = min(v.output_budget for v in decoders)` in the coalescing
  horizon calculation with the cohort mean across active decoders, matching
  Helios and the existing cohort-mean `mean_out` in `best_decode_rate`.
- In `docs/scheduling-runtime-design.md`: update the coalescing horizon
  specification to reflect cohort-averaged per-decoder clamping.
- In `helios/src/scheduler/policy_tests.rs` and
  `tests/test_scheduling_utility.py`: add unit tests covering pure Decode,
  packed and full-width Speculative cohorts with a near-EOS (`rem = 1`)
  decoder alongside a long decoder, single-decoder equivalence, and
  zero-decoder / single-token-prefill no-op invariants.

Result

- Single-decoder cohorts and homogeneous-budget cohorts produce identical
  values to the prior minimum formula.
- Mixed cohorts with one near-EOS decoder (`rem = 1`) and one long decoder
  (`rem = 100`) retain a 32.5-token coalescing horizon instead of collapsing
  to 1 token.
- Measured on `DeepSeek-V4.1-Flash` (`tokbench v0.3.0`, seed 42, temp 0,
  base `1fbcc3c990b5`) on 4x NVIDIA RTX PRO 6000 Blackwell (SM120, TP4):
  - Solo `long-context-mixed` (1-rep): +1.8% output (655.4 -> 667.3 tok/s),
    stalled >250ms 28.1% -> 26.3%, -4.0% TTFT p50 (1,510 -> 1,449 ms),
    +2.8 pp SLO (89.8% -> 92.6%).
  - Solo `mixed-c32` (2-rep medians): -0.4% output (1,281.7 -> 1,276.8
    tok/s), TTFT p50 1,425.3 -> 1,390.2 ms (-2.5%), stalled >250ms 11.29%
    -> 11.49%, SLO 93.0% -> 91.1%.
  - Solo `cold-heavy-mix` (1-rep): -3.7% output (541.8 -> 521.8 tok/s),
    -9.0 pp SLO (88.1% -> 79.1%). Default-ON trade-off: keeping coalescing
    active near EOS pulls competing 150K-250K cold prefills ahead of
    decoders without chunk shrinking, raising `agentic_multiturn` TTFT p99
    from 3,323 to 5,144 ms.
  - Combined stack atop open PRs NVIDIA#660, NVIDIA#661, and NVIDIA#665 (attributed to that
    composed stack):
    - `mixed-c32` (2-rep medians): +1.4% output (1,374.6 -> 1,394.2 tok/s),
      overall TTFT p50 1,001.0 -> 921.8 ms (-7.9%), stalled >250ms 4.82% ->
      4.34% (-10.0% rel; spread [3.45%, 5.23%] vs [4.77%, 4.88%]), SLO
      96.5% -> 97.1% (+0.6 pp). Trial-2 (1-trial rep): 233 -> 120 stalls,
      Gap p99 230.2 -> 183.0 ms, `agentic_multiturn` TTFT p50 845 -> 681 ms
      vs `heavy_prefill` 3,239 -> 7,551 ms.
    - `long-context-mixed` (1-rep): output 707.8 -> 692.1 tok/s (-2.2%),
      stalled >250ms 6.0% -> 4.0% (141 -> 94 stalls), SLO 94.1% -> 92.9%.
    - `cold-heavy-mix` (1-rep): output 579.1 -> 574.0 tok/s (-0.9%), stalls
      567 -> 672, cache hit 48.1% -> 52.8% (+4.7 pp).
- Measured on 4x NVIDIA DGX Spark GB10 (SM121, TP4, RoCEv2, signed core
  `gb10-tp4-202612010547`, combined stack atop NVIDIA#660+NVIDIA#661+NVIDIA#665):
  - `mixed-c8` (2-rep medians): output 128.4 -> 129.4 tok/s (+0.8%), TTFT
    p50 1,181 -> 1,118 ms (-5.3%), stalled >250ms 41.8% -> 38.0%, SLO 79.0%
    -> 81.7% (+2.7 pp).
  - `agentic-coding` C=8 (1-rep): output 137.1 -> 135.0 tok/s (-1.5%), TTFT
    p50 1,024 -> 877 ms (-14.4%), Gap p99 1,354 -> 725 ms (-46.5%), >1s
    stalls 35 -> 12 (-65.7%), stalled >250ms 45.4% -> 34.5%, SLO 81.8% ->
    85.7% (+3.9 pp), cache hit 74.6% -> 76.4%.

Evidence

Verified on clean `git archive` of tree `40596880cc64`:
- Rust (`RUSTFLAGS="-D warnings"`): `cargo check --locked --release` across
  `eos`, `selene`, `selene-manager`, `helios` (`runtime-core,server`),
  `flare`, `flare-cli` and `helios` tests -> 0 warnings.
- `cargo test --locked --release`: `helios --features server --lib` (1,283
  passed, 15 ignored), `helios --features runtime-core,server --lib` (1,795
  passed, 47 ignored), `flare --lib` (246 passed, 4 ignored), `flare-cli`
  (245 passed, 3 ignored).
- Python (`pytest`): 853 passed across `tests/preparation/test_core_boundary.py`,
  `tests/test_scheduling*.py`, and `tests/test_design_review_hook.py`.
- Scheduling simulator (`scripts/scheduling_sim`, 21 workloads x {std, mixed}
  x {balanced, throughput}): 84/84 identical traces vs `1fbcc3c9`, 0
  regressions.
- Cohort-mean mutation checks: reverting packed `mean_out`, Rust `horizon`,
  and Python `utility.py` `horizon` back to `.min()` fails tests (3/3
  reachable sites killed; the `!saw_packed` fallback branch in `policy.rs`
  is structurally unreachable because `ActionCosts::duration(Speculative, b, w)`
  queries `packed = b * w != 0` which `packed_round_shapes()` always yields).
- Formal lifecycle verification (`verification/helios-lifecycle/check.py`):
  10/10 TLA+ configs, 8/8 observed Rust traces (594,065 edges) + negative
  `DispatchRing SlotReuseSafe` check, 12/12 aux tests, 13/13 TLA+ model
  mutations, and 26/26 Rust lifecycle mutations killed.
- `git merge-tree --write-tree`: clean against `1fbcc3c9`, NVIDIA#660 (`9709d496`),
  NVIDIA#661 (`c588d610`), and NVIDIA#665 (`c5b39236`).
- Hardware binaries were built from unpushed local build trees `df9a8ebd`
  (solo) and `dbbf65df` (stack) whose `helios/src/scheduler/policy.rs` is
  byte-identical to this commit. SM120 `flare run` flags:
  `--scheduler-policy balanced --max-concurrency 32 --mtp-draft-tokens 7
  --mtp-adaptive-verification --mtp-max-verification-token-budget 128
  --mtp-adaptive-verification-alpha 1.0 --embedding-table-cache-size 84GiB
  --kv-cache-limit memory --prefix-cache-memory 0`. External client harness
  (`tokbench`): `python3 -m tokbench run --url http://127.0.0.1:8002
  --scenario <mixed-c32|long-context-mixed|cold-heavy-mix> -c <32|20|32>
  --warmup <15|15|20> --duration <75|90|120> --drain <20|30|45>
  --repeats <2|1|1> --seed 42 --temperature 0`. Standalone GB10, other GPUs,
  and other model recipes were not benchmarked.

Discord: Dooner

Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
FujitsuPolycom added a commit to FujitsuPolycom/flare-local-inference that referenced this pull request Dec 2, 2026
Why

In Helios's prepared-graph scheduler (`helios/src/scheduler/policy.rs`),
the per-prefill-token decode-batch coalescing bonus
(`coalescing_prefill_log_bonus`) prices the steady-state throughput gain
unlocked when queued prefills join an under-batched active decode cohort
over a bounded cohort-mean output horizon (`coalescing_horizon_tokens`,
default 64.0). Previously, `coalescing_prefill_log_bonus` reduced all
active decoders' remaining output budgets to a single scalar minimum
(`peer_budget = peer_budget.min(rem)`), and the Python reference scheduler
(`scripts/scheduling_sim/utility.py`) used the same scalar minimum for the
coalescing horizon (while already averaging per-decoder expected output
`mean_out` across active decoders in `best_decode_rate`). Under
heterogeneous mixed serving, any single active decoder within one token of
its output limit (`rem = 1`) collapsed both Rust's speculative per-round
expected output (`mean_out`) and both implementations' coalescing `horizon`
to 1 token for the entire cohort, eliminating over 98% of the coalescing
incentive even when all other active decoders had large remaining budgets.

Averaging per-decoder clamped budgets across the active cohort repairs the
Rust-to-simulator `mean_out` parity gap and extends cohort averaging to the
coalescing `horizon`, preserving continuation value when individual requests
approach completion while still shrinking smoothly as the cohort approaches
its output limit.

What

- In `helios/src/scheduler/policy.rs::coalescing_prefill_log_bonus`
  (+16/-18 lines, -2 net Rust production LOC; visibility unchanged):
  - Replace the scalar minimum `peer_budget` with a bounded per-decoder
    remaining-budget array (`decoder_rems`), where each `rem` is an active
    decoder's remaining output tokens clamped by KV sequence headroom
    (`max_sequence_tokens - scheduled_consumed`).
  - Extract local helper `mean_capped(rems: &[usize], cap: f64) -> f64`,
    hoist `expected_at(eff_width)` and `expected_at(width as f64)` out of
    the per-decoder loop, and delete provably dead `.max(1.0)` clamps and
    the unreachable `if horizon > 0.0` branch while keeping the
    `per_token.is_finite() && per_token > 0.0` guard.
  - Compute speculative per-round expected output (`mean_out`, parity with
    `utility.py`) and each prefiller's coalescing `horizon` (clamped to
    `min(coalescing_horizon_tokens, post_prefill)`, where `post_prefill` is
    the prefiller's remaining output budget after its first generated token)
    via `mean_capped`.
- In `scripts/scheduling_sim/utility.py` (+2/-6, -4 net Python production
  LOC): replace `peer_budget = min(v.output_budget for v in decoders)` in
  the coalescing horizon calculation with the cohort mean across active
  decoders, matching Helios and `best_decode_rate`'s existing cohort-mean
  `mean_out`.
- In `docs/scheduling-runtime-design.md`: update the coalescing horizon
  specification to describe the bounded cohort-mean decode horizon and
  per-decoder clamped cohort averaging.
- In `helios/src/scheduler/policy_tests.rs` and
  `tests/test_scheduling_utility.py`: add unit tests covering `[1, 100]`
  and `n=3` `[1, 20, 100]` heterogeneous cohorts, Rust-specific KV-headroom
  clamping, packed and unpacked speculative cohorts (reusing
  `super::rounds::forecast_tokens`), single-decoder equivalence, zero-bonus
  invariants, and an end-to-end `scripts/scheduling_sim` heterogeneous-budget
  test (`max_new_tokens < 64`) under `balanced` (`age_price = 0.1`).

Result

- Single-decoder and homogeneous-budget cohorts produce identical values to
  the prior minimum formula; a `[1, 100]` cohort retains a 32.5-token
  horizon instead of collapsing to 1 token.
- End-to-end `scripts/scheduling_sim` (`catalog()`, `balanced`,
  `age_price = 0.1`, cohort-mean vs prior `min(rem, ph)` horizon):
  - Non-speculative (`short0` `max_new_tokens=8` + 3 long decoders + 4
    queued 4K prefills): makespan 7,779.0 -> 7,734.0 ms (-45.0 ms), mean
    prefill TTFT 266.8 -> 201.0 ms (-24.6%), max prefill TTFT 373.0 ->
    327.0 ms (-12.3%), max output gap 226.0 -> 182.0 ms (-19.5%).
  - Speculative (`short0` `max_new_tokens=32` + 3 long decoders + 5 queued
    4K prefills): makespan 1,912.0 -> 1,878.0 ms (-34.0 ms), mean prefill
    TTFT 293.6 -> 266.4 ms (-9.3%), max prefill TTFT 468.0 -> 432.0 ms
    (-7.7%), max output gap 278.0 -> 212.0 ms (-23.7%).
- Measured on `DeepSeek-V4.1-Flash` (`FujitsuPolycom/tokbench`, seed 42,
  temp 0, base `1fbcc3c990b5`) on 4x RTX PRO 6000 Blackwell (SM120, TP4)
  and 4x DGX Spark GB10 (SM121, TP4, `gb10-tp4-202612010547`):
  - Solo on `1fbcc3c9`: `long-context-mixed` (1-rep) +1.8% output (655.4 ->
    667.3 tok/s), stalls 28.1% -> 26.3%, SLO 89.8% -> 92.6%; `mixed-c32`
    (2-rep) output 1,281.7 -> 1,276.8 tok/s, TTFT p50 1,425 -> 1,390 ms,
    stalls 11.29% -> 11.49%, SLO 93.0% -> 91.1%; `cold-heavy-mix` (1-rep)
    regresses output 541.8 -> 521.8 tok/s (-3.7%) and SLO 88.1% -> 79.1%
    (-9.0 pp, `agentic_multiturn` TTFT p99 3,323 -> 5,144 ms) because
    keeping coalescing active near EOS pulls 150K-250K cold prefills ahead
    of decoders without `NVIDIA#661` chunk shrinking.
  - Atop `NVIDIA#661` (`3d868f84`, primary stall reduction from `NVIDIA#661`):
    `mixed-c32` (2-rep med) output 1,254 -> 1,261 tok/s, stalls 6.65% ->
    5.95%, TTFT p50 1,479 -> 1,439 ms, SLO 89.4% -> 90.5%;
    `long-context-mixed` (1-rep) stalls 16.4% -> 9.8% while SLO dropped
    89.3% -> 82.1% (-7.2 pp); `cold-heavy-mix` (1-rep) output 545.6 ->
    547.8 tok/s, stalls 56.3% -> 55.7%, SLO 81.6% -> 79.8%.
  - Composed 4-PR stack (`NVIDIA#660 + NVIDIA#661 + NVIDIA#665`, where prefix-cache hit-rate
    gains come from `NVIDIA#665` and primary stall cuts from `NVIDIA#661`): SM120
    `mixed-c32` (2-rep) output 1,374.6 -> 1,394.2 tok/s (+1.4%), stalls
    4.82% -> 4.34%, TTFT p50 1,001 -> 922 ms (-7.9%), SLO 96.5% -> 97.1%;
    GB10 `mixed-c8` (2-rep) stalls 41.8% -> 38.0%, TTFT p50 1,181 -> 1,118
    ms, SLO 79.0% -> 81.7%; GB10 `agentic-coding` C=8 (1-rep) stalls 45.4%
    -> 34.5%, TTFT p50 1,024 -> 877 ms, SLO 81.8% -> 85.7%.

Evidence

Verified on clean `git archive` of tree `fe2b8739991e`:
- Rust (`RUSTFLAGS="-D warnings"`): `cargo check --locked --release` across
  `eos`, `selene`, `selene-manager`, `helios` (`runtime-core,server --tests`),
  `flare`, `flare-cli` -> 0 warnings.
- `cargo test --locked --release`: `eos` (12 passed), `selene --features
  test-support` (553 passed), `selene-manager --features test-support`
  (426 passed, 1 ignored), `helios --features server --lib` (1,283 passed,
  15 ignored), `helios --features runtime-core,server --lib` (1,795 passed,
  47 ignored), `flare --lib` (246 passed, 4 ignored), `flare-cli` (245
  passed, 3 ignored).
- Python: `ruff==0.12.8` passed on modified Python files; `pytest` passed
  (854 passed across `tests/preparation/test_core_boundary.py`,
  `tests/test_scheduling*.py`, and `tests/test_design_review_hook.py`,
  including `test_coalescing_heterogeneous_budget_end_to_end_balanced`).
- Fault mutation checks (scratch copies): reverting `scripts/scheduling_sim/
  utility.py` `horizon` to `min(ph, min(output_budget))` failed both
  `test_coalescing_heterogeneous_budget_end_to_end_balanced` and
  `test_coalescing_horizon_averages_active_decoder_budgets`; reverting
  `helios/src/scheduler/policy.rs::mean_capped` to `.min()` failed both
  Rust coalescing unit tests (`2/2` killed).
- `git merge-tree --write-tree`: clean (`rc=0`) against `main` (`4cc6f2fd`),
  `2acc3f3a`, `NVIDIA#660` (`9709d496`), `NVIDIA#661` (`3d868f84`), and `NVIDIA#665`
  (`c5b39236`).
- Hardware binaries were built from earlier equivalent trees `df9a8ebd`
  (solo), `38130855` (on `NVIDIA#661`), and `dbbf65df` (stack) before the
  semantics-preserving `mean_capped` / hoist refactor; final rebase onto
  `main` after `NVIDIA#661` lands and CI/A/B confirmation on the rebased head
  remain pending. Standalone GB10, other GPUs, and other recipes were not
  benchmarked.

Discord: Dooner

Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
@lukealonso
lukealonso merged commit 07e666e into NVIDIA:main Dec 2, 2026
1 check passed
lukealonso pushed a commit that referenced this pull request Dec 2, 2026
Why

In Helios's prepared-graph scheduler (`helios/src/scheduler/policy.rs`),
the per-prefill-token decode-batch coalescing bonus
(`coalescing_prefill_log_bonus`) prices the steady-state throughput gain
unlocked when queued prefills join an under-batched active decode cohort
over a bounded cohort-mean output horizon (`coalescing_horizon_tokens`,
default 64.0). Previously, `coalescing_prefill_log_bonus` reduced all
active decoders' remaining output budgets to a single scalar minimum
(`peer_budget = peer_budget.min(rem)`), and the Python reference scheduler
(`scripts/scheduling_sim/utility.py`) used the same scalar minimum for the
coalescing horizon (while already averaging per-decoder expected output
`mean_out` across active decoders in `best_decode_rate`). Under
heterogeneous mixed serving, any single active decoder within one token of
its output limit (`rem = 1`) collapsed both Rust's speculative per-round
expected output (`mean_out`) and both implementations' coalescing `horizon`
to 1 token for the entire cohort, eliminating over 98% of the coalescing
incentive even when all other active decoders had large remaining budgets.

Averaging per-decoder clamped budgets across the active cohort repairs the
Rust-to-simulator `mean_out` parity gap and extends cohort averaging to the
coalescing `horizon`, preserving continuation value when individual requests
approach completion while still shrinking smoothly as the cohort approaches
its output limit.

What

- In `helios/src/scheduler/policy.rs::coalescing_prefill_log_bonus`
  (+16/-18 lines, -2 net Rust production LOC; visibility unchanged):
  - Replace the scalar minimum `peer_budget` with a bounded per-decoder
    remaining-budget array (`decoder_rems`), where each `rem` is an active
    decoder's remaining output tokens clamped by KV sequence headroom
    (`max_sequence_tokens - scheduled_consumed`).
  - Extract local helper `mean_capped(rems: &[usize], cap: f64) -> f64`,
    hoist `expected_at(eff_width)` and `expected_at(width as f64)` out of
    the per-decoder loop, and delete provably dead `.max(1.0)` clamps and
    the unreachable `if horizon > 0.0` branch while keeping the
    `per_token.is_finite() && per_token > 0.0` guard.
  - Compute speculative per-round expected output (`mean_out`, parity with
    `utility.py`) and each prefiller's coalescing `horizon` (clamped to
    `min(coalescing_horizon_tokens, post_prefill)`, where `post_prefill` is
    the prefiller's remaining output budget after its first generated token)
    via `mean_capped`.
- In `scripts/scheduling_sim/utility.py` (+2/-6, -4 net Python production
  LOC): replace `peer_budget = min(v.output_budget for v in decoders)` in
  the coalescing horizon calculation with the cohort mean across active
  decoders, matching Helios and `best_decode_rate`'s existing cohort-mean
  `mean_out`.
- In `docs/scheduling-runtime-design.md`: update the coalescing horizon
  specification to describe the bounded cohort-mean decode horizon and
  per-decoder clamped cohort averaging.
- In `helios/src/scheduler/policy_tests.rs` and
  `tests/test_scheduling_utility.py`: add unit tests covering `[1, 100]`
  and `n=3` `[1, 20, 100]` heterogeneous cohorts, Rust-specific KV-headroom
  clamping, packed and unpacked speculative cohorts (reusing
  `super::rounds::forecast_tokens`), single-decoder equivalence, zero-bonus
  invariants, and an end-to-end `scripts/scheduling_sim` heterogeneous-budget
  test (`max_new_tokens < 64`) under `balanced` (`age_price = 0.1`).

Result

- Single-decoder and homogeneous-budget cohorts produce identical values to
  the prior minimum formula; a `[1, 100]` cohort retains a 32.5-token
  horizon instead of collapsing to 1 token.
- End-to-end `scripts/scheduling_sim` (`catalog()`, `balanced`,
  `age_price = 0.1`, cohort-mean vs prior `min(rem, ph)` horizon):
  - Non-speculative (`short0` `max_new_tokens=8` + 3 long decoders + 4
    queued 4K prefills): makespan 7,779.0 -> 7,734.0 ms (-45.0 ms), mean
    prefill TTFT 266.8 -> 201.0 ms (-24.6%), max prefill TTFT 373.0 ->
    327.0 ms (-12.3%), max output gap 226.0 -> 182.0 ms (-19.5%).
  - Speculative (`short0` `max_new_tokens=32` + 3 long decoders + 5 queued
    4K prefills): makespan 1,912.0 -> 1,878.0 ms (-34.0 ms), mean prefill
    TTFT 293.6 -> 266.4 ms (-9.3%), max prefill TTFT 468.0 -> 432.0 ms
    (-7.7%), max output gap 278.0 -> 212.0 ms (-23.7%).
- Measured on `DeepSeek-V4.1-Flash` (`FujitsuPolycom/tokbench`, seed 42,
  temp 0, base `1fbcc3c990b5`) on 4x RTX PRO 6000 Blackwell (SM120, TP4)
  and 4x DGX Spark GB10 (SM121, TP4, `gb10-tp4-202612010547`):
  - Solo on `1fbcc3c9`: `long-context-mixed` (1-rep) +1.8% output (655.4 ->
    667.3 tok/s), stalls 28.1% -> 26.3%, SLO 89.8% -> 92.6%; `mixed-c32`
    (2-rep) output 1,281.7 -> 1,276.8 tok/s, TTFT p50 1,425 -> 1,390 ms,
    stalls 11.29% -> 11.49%, SLO 93.0% -> 91.1%; `cold-heavy-mix` (1-rep)
    regresses output 541.8 -> 521.8 tok/s (-3.7%) and SLO 88.1% -> 79.1%
    (-9.0 pp, `agentic_multiturn` TTFT p99 3,323 -> 5,144 ms) because
    keeping coalescing active near EOS pulls 150K-250K cold prefills ahead
    of decoders without `#661` chunk shrinking.
  - Atop `#661` (`3d868f84`, primary stall reduction from `#661`):
    `mixed-c32` (2-rep med) output 1,254 -> 1,261 tok/s, stalls 6.65% ->
    5.95%, TTFT p50 1,479 -> 1,439 ms, SLO 89.4% -> 90.5%;
    `long-context-mixed` (1-rep) stalls 16.4% -> 9.8% while SLO dropped
    89.3% -> 82.1% (-7.2 pp); `cold-heavy-mix` (1-rep) output 545.6 ->
    547.8 tok/s, stalls 56.3% -> 55.7%, SLO 81.6% -> 79.8%.
  - Composed 4-PR stack (`#660 + #661 + #665`, where prefix-cache hit-rate
    gains come from `#665` and primary stall cuts from `#661`): SM120
    `mixed-c32` (2-rep) output 1,374.6 -> 1,394.2 tok/s (+1.4%), stalls
    4.82% -> 4.34%, TTFT p50 1,001 -> 922 ms (-7.9%), SLO 96.5% -> 97.1%;
    GB10 `mixed-c8` (2-rep) stalls 41.8% -> 38.0%, TTFT p50 1,181 -> 1,118
    ms, SLO 79.0% -> 81.7%; GB10 `agentic-coding` C=8 (1-rep) stalls 45.4%
    -> 34.5%, TTFT p50 1,024 -> 877 ms, SLO 81.8% -> 85.7%.

Evidence

Verified on clean `git archive` of tree `fe2b8739991e`:
- Rust (`RUSTFLAGS="-D warnings"`): `cargo check --locked --release` across
  `eos`, `selene`, `selene-manager`, `helios` (`runtime-core,server --tests`),
  `flare`, `flare-cli` -> 0 warnings.
- `cargo test --locked --release`: `eos` (12 passed), `selene --features
  test-support` (553 passed), `selene-manager --features test-support`
  (426 passed, 1 ignored), `helios --features server --lib` (1,283 passed,
  15 ignored), `helios --features runtime-core,server --lib` (1,795 passed,
  47 ignored), `flare --lib` (246 passed, 4 ignored), `flare-cli` (245
  passed, 3 ignored).
- Python: `ruff==0.12.8` passed on modified Python files; `pytest` passed
  (854 passed across `tests/preparation/test_core_boundary.py`,
  `tests/test_scheduling*.py`, and `tests/test_design_review_hook.py`,
  including `test_coalescing_heterogeneous_budget_end_to_end_balanced`).
- Fault mutation checks (scratch copies): reverting `scripts/scheduling_sim/
  utility.py` `horizon` to `min(ph, min(output_budget))` failed both
  `test_coalescing_heterogeneous_budget_end_to_end_balanced` and
  `test_coalescing_horizon_averages_active_decoder_budgets`; reverting
  `helios/src/scheduler/policy.rs::mean_capped` to `.min()` failed both
  Rust coalescing unit tests (`2/2` killed).
- `git merge-tree --write-tree`: clean (`rc=0`) against `main` (`4cc6f2fd`),
  `2acc3f3a`, `#660` (`9709d496`), `#661` (`3d868f84`), and `#665`
  (`c5b39236`).
- Hardware binaries were built from earlier equivalent trees `df9a8ebd`
  (solo), `38130855` (on `#661`), and `dbbf65df` (stack) before the
  semantics-preserving `mean_capped` / hoist refactor; final rebase onto
  `main` after `#661` lands and CI/A/B confirmation on the rebased head
  remain pending. Standalone GB10, other GPUs, and other recipes were not
  benchmarked.

Discord: Dooner

Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b

Signed-off-by: FujitsuPolycom <87842395+FujitsuPolycom@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:caching Prefix/KV reuse, cache retention, and model or payload cache behavior. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants