Case file: PR #736 — fix(helios): zero reclaimed VMM-aliased snapshot KV pages before reuse (SM103 FP8 V-cache tail NaNs)
Open, ready-for-review, head 500b7746 (single commit, 2026-12-04), base main, 11 files, +601 / −25, no CI checks, no reviews, no comments, no labels. Author ebfio (FIRST_TIME_CONTRIBUTOR; Discord ebfio).
Key findings (what a reader cannot learn from the description)
- #736 is a 4-minute close/reopen of #735. #735 was opened 2026-12-05 01:33 and closed 2026-12-05 01:37 by the author, with 0 comments and 0 reviews; #736 reopens the identical title, body, branch name (
fix/zero-reclaimed-snapshot-kv-pages), file list and +601/−25, with head movedf45ab4d→500b7746. Neither record says why. Anything learned about #735 (e.g. triage labels) would apply to #736, and #735 has none. - The PR never links issue #116, the open P1 report of exactly this root cause (
triage:partial, 8 comments, reproductions on SM121/GB10 and SM120). #116's "what fixes it" A/B — "Released alias pages zeroed before reuse | no failures in 143 of 143 prompts" — is this change's premise, measured with a single-GPU implementation that #116's author explicitly says "doesn't cover the multi-process tensor-parallel executor". The abandoned sibling PR #181 carried "Fixes #116"; #736 does not. - The project already chose the opposite remedy once. #202's recorded decision was kernel-side: "Flare does not need to enforce finite bytes in unused slots for this path", and #181's triage treated page clearing as a workaround superseded by FlashInfer masking (flashinfer#43/#73, 1f8ed8a3). #736 works around the same class again at the Helios cache layer because SM103 has not received the masking fix — the SM103 matrix in the PR shows
B_v_nanat 100% NaN across every backend/mode/window/seq_len. Nothing in-repo reports an SM103 kernel fix in flight. - #736 reverses #181's explicit design decision. #181 cleared pages at first KV commit, reasoning: "Pages are not cleared at release, where inbound host restores could still be writing." #736 clears at release (
scheduler/cache_memory.rs:822-835) and compensates with a zero-before-store.fetchbarrier (runtime.rs:3998-4001). 10 of 11 touched files are the same files #181 touched. - Undeclared behavioural facts: an extra
CU_STREAM_NON_BLOCKINGstream is opened for everyGraphExecutorunconditionally (transport.rs:626), not only for alias-using cores; TP zeroing is synchronous and blocking on rank zero with a 120 s peer deadline (parallel.rs:288-328) and any error setspoisonfor the whole executor; the rank control protocol gains two tags (ZERO_KV_PAGES=14,ZEROED_KV_PAGES=15,wire.rs:27-28) with no version/layout bump; out-of-range page ids are fatal, not skipped (transport.rs:1442-1465); poisoned teardownmem::forgets peer streams (threaded.rs:1302-1307);Worker::admitbecomes#[cfg(test)]-only. - Evidence split. The 4 CPU unit tests exist exactly as named and I verified their content; there is no GPU/CUDA test for the memset path anywhere (contrast #181, which shipped a hardware VMM-alias CUDA test). The SM103 isolation matrix, the 75/75 + 152/152 GB300 soaks and the "~27 µs" overhead are the author's own hardware and an arithmetic estimate (≈212 MiB ÷ 8 TB/s) with no benchmark or timing code added.
- The race-freedom argument names only
store.fetch. Pool-tier restores (begin_pool_lookup/issue_pool_lookup,runtime.rs:3699-3770) go through the sameHostStoreand are not covered by a dedicated barrier; the worker's generic flush at the end of admission (runtime.rs:1858) runs after the admission loop's pool lookups. - Zero engagement. No labels (merged helios PRs like #659 carry
area:memory,triage:validation), no maintainer (lukealonso / original-el8 / yatesdr / jcartu) has touched it, and neighbouring #705 drew three Autobot review rounds in two days.
1. The change
Plain terms: when a continuation snapshot is evicted, the physical KV pages it shared through VMM aliasing are returned to the free list without being cleared. This PR records those pages the moment page_snapshot_refs[page] drops 1 -> 0, and zeroes them (cuMemsetD8Async over coalesced contiguous runs, across all cache planes) on dedicated non-blocking streams, synchronously, before anything else touches them.
Files (verified against the head commit):
helios/src/cuda.rs(+5):Stream::with_contextaroundDriver::with_context(cuda.rs:1128).helios/src/scheduler.rs(+2):reclaimed_snapshot_pages: Vec<u32>(:669, init:772).helios/src/scheduler/cache_memory.rs(+42): push atpage_snapshot_refs1→0 insiderelease_snapshot(:822-835, push:831), accessortake_reclaimed_snapshot_pages(:837-846), new test:2856+.helios/src/execution/transport.rs(+128):Resources.zero(:573),enqueue_zero_kv_pages(:1357),sync_zero_kv_pages(:1379),zero_kv_pages(:1386),coalesce_page_runs(:1442),enqueue_zero_cache_pages(:1467), drain inclose().helios/src/execution/threaded.rs(+66):peer_zeros: Vec<(CacheGeometry, Stream)>,zero_kv_pages(:1217), poison/forget teardown (:1302-1307).helios/src/execution/parallel.rs(+100) +parallel/wire.rs+parallel/tests.rs: tags,zero_kv_pages(:288),apply_peer_messageextracted frompoll()so READY/COMPLETE are still processed while waiting for ZEROED replies (:99-146, used at:316),serve_rankhandler (:747).helios/src/execution/ranks.rs(+14): dispatch Local/Parallel/Threaded.helios/src/server/runtime.rs(+49):Worker::zero_reclaimed_kv_pages(:1788),admit_with_executor(Option<&mut RankExecutor>)(:1796-1804), flush points inrun()(:1618, :1622, :1624, :1626), end of admit (:1858), after plan/publish (:2165), insubmitbeforeexecutor.submit(:3220), and insideadmit_with_host_storeimmediately beforestore.fetch(:3998-4001); new closure paramzero_kv_pages: impl FnMut(&[u32]) -> Result<()>(:3859).helios/src/server/runtime/phase_tests.rs(+149): ordering test.
Description vs code — gaps (see Key findings 5): always-on stream, blocking TP path, un-versioned tags, fatal out-of-range ids, teardown forget, #[cfg(test)] admit, and the description's claim that zeroing happens "never during steady-state KV page allocation or reuse between requests" is only partly true: the queue is drained at six points in Worker::run, so any of the ~14 release_snapshot call sites (cancel, preemption, eviction, publish; scheduler.rs:2011, 2055, 2172, 3078, 3102, 3136, 3188, 3240, 3412, plus checkpoints.rs:165 (not opened)) populates it and forces a synchronized memset. Feature-gated #[cfg(feature = "server")], so inert under --features runtime-core alone.
2. The why
The bug has a six-week, three-hardware-class, four-reporter history:
- 2026-10-22 — #14 (closed): paged-attention decode propagates NaNs from unused V tails on SM120; 11/72 requests failed with status 1 under prefix-cache reuse; fixed by flashinfer#43.
- 2026-10-27 — #116 (open, P1,
triage:partial): names the scheduler root cause —release_snapshotreturns pages unscrubbed — and says it "may also explain #61". Failure on SM121/GB10 isINVALID_SPECULATION(device error 6); the PR's SM103 symptom isINVALID_DISTRIBUTION(device error 1). - 2026-11-03 — #181 (draft fix) opened against it; same day
fahrenhe1treports 32 mid-stream device errors in ~15 min of agentic traffic on RTX PRO 6000 (SM120); 2026-11-05jwnandreports DeepSeek-V4.1-Flash on GB10 SM121 TP4 (4× DGX Spark). - 2026-11-04 — mark-yong's poison matrix narrows it to V (not K) in P·V across SM120 kernels.
- 2026-11-05..15 — triage redirects to FlashInfer masking; #181 marked
triage:verify-for-closure, hits merge conflicts (the code moved fromruntime_package/toruntime_core/under it), closed unmerged 2026-11-15. #116 remains open. - 2026-12-05 — #735, then #736, for SM103/GB300 (CC 10.3).
Reach of the bug per #116: prefix-cache/agentic workloads that fill the KV pool — "long multi-turn and agent workloads, the ones the prefix cache is for". #116's measured latency effect of zeroing: 8k N=1..32 27.6/50.4/93.0/159/242/305 tok/s vs 28.2/49.0/92.8/154/244/308 without.
3. Related work
- #181 (closed 2026-11-15, mark-yong, +353/−53, 18 files,
Fixes #116): same fix, different mechanism — mark page at last alias release, zero it on the model stream at first commit via TPPREPAREframes; explicitly avoided clearing at release because host restores may still be writing. 10 of 11 files overlap with #736. Abandoned for staleness, not refuted. - Kernel-masking chain #14 → #201 → #202 → #203/#204 (all closed): same bug class fixed in FlashInfer on SM120 by masking V rows past
cache_seqlens; #202 posed the explicit fork ("FlashInfer relaxes the finite-padding contract or Flare enforces the contract ... at every cache lifecycle boundary (release, snapshot-alias handoff, restore). #181 is the current form of this") and resolved in favour of the kernel, withmark-yongconcluding "Flare does not need to enforce finite bytes in unused slots for this path". All of #201/#202 state "SM121 and SM103 were not exercised". #736's own matrix shows SM103 still leaks V tails. - #202's corollary advantage for #736: a Helios-side fix applies to already-exported cores, unlike the kernel route (#14's comment: "Existing packages embed the old kernels, so they need a re-export").
- Adjacent, not competing: #674 (merged, yatesdr — snapshot packing,
row_restore_latency, sameadmit_with_host_storearea; #736 is built on post-#674 tree), #621 (merged, jcartu — admission validation through the same function family), #659 (merged, lukealonso — null continuation row zero onto one VMM granule; same "zero once, before any graph or transfer can read an alias" invariant,runtime_core/cache_memory.rs:2110; complementary), #729 (merged, lukealonso — KV preserved across grammar transitions ⇒ more snapshot reuse, plausibly more exposure to this bug, no stated link), #549, #548/#560, #718, #715, #576, #483, #554/#334 (same files, unrelated features; merge-conflict risk only), #705 (open, jcartu — rewritesservice_store, which #736 now brackets with flush points atruntime.rs:1623-1624; real conflict surface), #703 (open issue, sameservice_storeretry storm), #517 (closed; different Xid 31 fault in_checkpoint_pages).
4. Recent activity
Main's helios tip at submission: cfb72093 (#723, Luke Alonso, 2026-12-04 — green contexts, R580/VMM fallbacks, packed dedup, graph SM bounds), preceded by 6efbd126 (#729), which is the context discipline Stream::with_context relies on. The PR description names be4092d7 (#691, jcartu) as its clean-apply base — i.e. one merge behind main. Orientation packet: no commits on the default branch since the PR branched touch its changed files, so it applies cleanly today. Neighbours in server/runtime.rs: dbe61dd4 (#692), 624c6e43 (#621). No commit in the last 60 days clears released snapshot pages, i.e. no prior landing of this fix; the alias machinery it hangs off was shaped by #473, #346, #595, #674. Nothing in the change reverses recent work except the abandoned #181.
5. People
- Author
ebfio: FIRST_TIME_CONTRIBUTOR. 0 merged PRs in 180 days, 1 closed, 4 open: #735 (superseded by #736), #698 (open — "Open host prefix store beforeRankExecutor::new()", marked duplicate/superseded because merged #709 landed the identical reorder; the review credits @ebfio for the GB300cuModuleLoadDatadiagnosis), #701 (open P1 issue — GKV1 Green Context collapse and B≥2 hang on SM103), #699 (open —/dev/shmdouble-count), #682 (open docs PR). Pattern: an SM103/GB300 operator filing targeted memory/startup fixes with self-reported hardware evidence; every item is authored on their own hardware, none merged yet. - Area owners (last 180 days,
helios/src): Luke Alonso (249), Martin Vit (52), yatesdr (52). Touched-file owners:transport.rs— lukealonso (#645, #613, #507, #430);scheduler/cache_memory.rs— lukealonso (#595), original-el8 (#473), yatesdr (#674, #346, #354), FujitsuPolycom (#309);server/runtime.rs— jcartu (#621, #691, #692, #705), lukealonso (#709, #711, #729), yatesdr (#663, #694). - Engagement: none. No maintainer, no reviewer, no reaction on #736 or #735. People already in the bug's history (shadowpa0327, mark-yong, original-el8, fahrenhe1t, jwnand, yatesdr) have not been drawn in.
6. Community
Nothing found: pr_comments returns "No comments"; 0 reviews; no labels; no reactions; #735 similarly bare ("Discussion (0)"). For contrast #705 drew three Autobot review rounds within two days and #659 an Autobot review plus author follow-ups. No documentation, changelog, metric, flag or dependency change of any kind in the diff.
7. Project fit (charter and docs, as facts)
- Charter: "Bring real evidence. Performance PRs need benchmarks showing an actual speedup ... Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)." The PR is framed as a diagnosed root cause with an explicit pre-restore barrier, which aligns; its 27 µs is an estimate, not a speedup claim.
- "Keep the runtime small and model-agnostic ... shouldn't accumulate per-model branches (#267, #334)." No model branch; keyed off alias ranges and FP8 in general. Aligns.
- "Solve the right problem in the right place ... smallest footprint in shared code ... Good ideas in the wrong place will be declined (#404)"; "GPU kernel code: report concrete defects only." The locus question (kernel contract vs cache-layer clearing) is exactly what #202 decided the other way — the charter's "right place" test is live here, and #181's triage called page clearing a "broad page-clearing workaround".
- Goals name SM103, SM120 and SM121 as supported targets, so an SM103-only cast is in scope.
- Docs:
docs/runtime-core-design.md:942-951already says "GPU tests preserve snapshot bytes while released KV pages are overwritten. These checks do not constitute model-quality evaluation", and:1011-1014documentsflare_snapshot_backing_pages/flare_free_snapshots, which this change leaves intact. The PR updates no doc (unlike #181, which touched docs).runtime_core/cache_memory.rs:2110("Zero each physical byte once, before any graph or transfer can read an alias") is the documented invariant the bug breaks; #736 adds a second, release-time zeroing pass rather than amending it.
8. Claims and evidence
Verified in-repo (backed):
release_snapshot_records_only_reclaimed_pages_and_drains(cache_memory.rs:2856-2883): 1→0 queueing, shared page not queued, drain-once.coalesce_page_runs_sorts_dedups_merges_and_bounds_checks(transport.rs:2163-2180).zero_kv_pages_wire_roundtrip_and_truncation(parallel/tests.rs:837-854): real channel roundtrip plus 3-byte truncation rejection.admit_with_host_store_zeros_reclaimed_snapshot_pages_before_fetch(phase_tests.rs:12250-12396): asserts event order["zero","fetch"], that the inbound ticket reused a reclaimed page in 4..16, and that an injected zero error yields["zero"]withstore.inner.fetchedempty.- Structure: only pages whose last alias reference drops to 0 are queued, and only cores with non-empty
cache.snapshot_pages(wired atruntime.rs:1082viashare_snapshot_pages,cache_memory.rs:272) ever enqueue.
Not backed by anything in the repo:
- No GPU test. All four tests are CPU-only (
CUDA_VISIBLE_DEVICES="");enqueue_zero_cache_pages(transport.rs:1467-1505), real cross-plane memsets,Stream::with_contextswitching and the per-peer path are unexecuted by repository tests. - SM103 matrix (
A_zero0 NaNs;B_k_nan0;B_v_nan100% NaN;B_kv_nan100%;C_bf16_bytes8,215,432 poison NaNs vs 0 control) — author's hardware and scripts, not in the PR; description states it "was not re-run for this submission" and came from one GB300. - Soaks 75/75 and 152/152, 98/280 snapshot evictions, 4 DRAM host-cache restores — same provenance, single machine.
- ~27 µs — arithmetic (≈212 MiB ÷ 8 TB/s), no instrumentation added.
- "802 passed, 0 failed, 10 ignored" — a filtered run (
-- cuda:: scheduler:: execution:: server::runtime::); the description honestly discloses 6 pre-existing full-suite failures from a missingFLARE_TEST_TEMPLATE_DIRfixture (python tests/frontend/prepare_templates.py(not opened)) and that feature-matrix warning counts (5/7/2) match clean main. git apply/cargo checkclaims are unverifiable here; there are no CI checks on the head commit.
Safety-comment premise worth noting: enqueue_zero_cache_pages justifies the write with "all reclaimed pages were retired past their last GPU fence before release_snapshot freed them, and no new kernel or host restore has been submitted against them yet" (transport.rs:1493-1496). That is exactly the premise #181's author rejected.
9. Reach
- Topologies: every executor implements
zero_kv_pages—RankExecutorInner::Local | Parallel | Threaded(ranks.rs:87-97). Multi-process/multi-node TP peers need the new tags; mixing a patched rank zero with an unpatched peer fails at "unexpected rank command" (parallel.rs:752).MAX_PACKET64 MiB caps the page-id payload (wire.rs:500-509). - Cost: one always-on
CU_STREAM_NON_BLOCKINGper rank per process with default priority (memset traffic is not deprioritized;open_lowest_priorityexists atcuda.rs:807-828but is unused here). Blocking TP path: rank zero sends, zeroes locally, then waits per peer with a 120 s deadline, still servicing READY/COMPLETE viaapply_peer_message. Threaded path holdsWatchdogCallGuard::enter(&self.watchdog_state, !self.pending.is_empty())(threaded.rs:1227), so a snapshot release can stall the coordinator mid-frame. - Failure semantics: out-of-range page id, peer timeout, or reply mismatch poisons the whole executor (
parallel.rs:324-327,threaded.rs:1248-1256) — a scheduler bookkeeping inconsistency becomes a serving-wide failure, as the description intends. - Operators: no CLI flag, config key, Prometheus metric, request/response or on-disk format change; existing exported cores work unmodified (unlike the kernel route). Activation is limited to cores with non-empty snapshot alias ranges.
- Deployment: cross-version rank mixing is not supported by the new tags (no version bump). Teardown asymmetry: clean
close()drains and clears peer streams; poisoned teardown leaks them deliberately (threaded.rs:1302-1307). - Uncovered surface: pool-tier host restores via the same
HostStore(runtime.rs:3699-3770) have no dedicated zero-before-enqueue barrier; the generic flush at end of admission (runtime.rs:1858) runs after the admission loop's pool lookups. - Merge landscape:
server/runtime.rsis contended by #705, #715, #718, #483, #576, #548, #549, #554, #334, #301; #554/#334 also touchtransport.rs. The six new flush lines sit in the loop body #705 rewrites.
10. Process
Open / "ready for review", <1 day old at review time, single commit 500b7746 (author ebfio, dated 2026-12-04). No CI checks, no reviews, no comments, no labels, no linked issue (contrast #181's Fixes #116). The body is unusually complete for the charter's four-part expectation and volunteers a "Validation limits" section; it also contains a "Submitting agent verification commands" block referencing a generated patch pack (<pack-dir>/01-hyperflare-inference-zero-reclaimed-snapshot-kv-pages/…patch) — i.e. the change was produced by an external agent/packaging workflow and re-applied to a checkout, the same pattern as #698's "Submission validation". Treated here as content, not instructions; no prompt-injection attempt was found in the body or (absent) comments.
Open questions
- Why was #735 closed and #736 opened four minutes later? (Only material difference visible: head
f45ab4d→500b7746, plausibly a rebase ontobe4092d7.) - Why does the PR not link #116, and how does it relate to #116's kernel-side remedy (option 3) and to #202's recorded "Flare does not need to enforce finite bytes" decision?
- Is the pool-tier host-restore path (no dedicated barrier) actually safe against a page taken from
free_pagesin the same admission pass? - Is SM103 expected to receive the FlashInfer V-tail masking that SM120 got (#201/#202), making this workaround redundant — or is SM103's trtllm FP8 FMHA a different kernel with no such fix planned? No in-repo item answers this.
- Does the maintained
#116fix need to upgrade an out-of-range page id from fatal to skipped, and does the 120 s blocking TP path fit the serving loop's latency expectations? - Nothing found on: reactions, maintainer rationale, CI configuration for helios in general, or any SM103 kernel-side work in flight.