Explore report · NVIDIA/hyperflare-inference #609

Raw Markdown for agents: https://autobot.eidonix.com/p/16ec7d9b-f510-441c-ada0-a332e9ae76e5.md

Case file — PR #609: fix(selene): preserve DMA, RDMA, and shared-region lifetimes across cancel, close, and scatter

Author: yatesdr (COLLABORATOR; body says "Discord: D-Rock"). Branch fix/selene-dma-lifetime-safety → main, base 5df8edd3 (the merge of #607), single commit 304dd3a. Merged 2026-11-29 17:27, 19 minutes after opening, with 0 reviews, 0 comments, no labels, and CI failed on the head commit per the orientation packet. 15 files, +225/−71 (selene/src 12 files +154/−48; selene-manager/src 3 files +71/−23).

Key findings

  1. Landed unreviewed, on a red head commit. Opened 17:08 and merged 17:27 the same day by its own author's account flow; no review, no labels, no autobot case file on this PR (contrast the sibling #607, which got a full autobot "Ready To Merge" review). The packet records CI as failed on 304dd3a; which job failed could not be identified from here (see Open questions). — [#609 metadata; note #4].
  2. Its hardware evidence is not its own. The entire "Combined 4-PR validation & SM120/SM121 hardware qualification" block was run on the stack of #609+#610+#611+#612 before the rebase, and the body concedes only CPU tests were re-run afterwards. The same block, including the same limitation sentence, appears verbatim in #610, #611 and #612 — one qualification run cited four times. The named CUDA suite is helios::offload::, and this PR does not touch helios. — note #3, note #5.
  3. "Zero latency or parity regression" carries no numbers. The only quantitative statement is "bit-exact pos0 parity"; there is no latency or throughput figure anywhere in the PR. — note #3.
  4. The diff does more than the description says. (a) SliceLayout::new gains checked arithmetic with two new error strings — same overflow-hardening class as #612's work, never mentioned. (b) An existing #497-era regression assertion in selene/src/offload/tests.rs is relaxed, deleting the fail == Some(1) case that proved memory is not closed when disk close fails, so that short-circuit can no longer be caught by that test. (c) Engine::quarantine goes from private to pub(crate). (d) rdma::Device::open loses its unsafe marker and changes signature to Arc<Region> (both pub(crate)). — note #2.
  5. Operator-visible behaviour changes the description does not spell out. MemoryStore::close can now return a new error: "host KV compression did not finish before close" (selene/src/memory.rs:3113-3115); CompositeStore::close now runs both closes and returns disk.and(memory) (selene/src/composite.rs:1619-1626), so a memory error can surface where previously only the disk error could; and conn::shutdown on its timeout path now calls engine.quarantine() (selene/src/pool/conn.rs:216-223), which mem::forgets session regions, SHM attachment regions and staging for the life of the process (selene/src/pool/engine/mod.rs:549-573; selene/src/pool/agent.rs:1729-1737). No doc mentions the widened retention. — note #11, note #15.
  6. No linked issue, crash report or reproduction backs the "why". The defects are self-asserted from an apparent one-day audit that also produced #610/#611/#612, all opened in the same minute. The closest independent confirmation that this area had real aliasing/UAF bugs is #607 (merged 10 minutes earlier, and reviewed), which fixed staging-slot double release and peer-DMA-gated window release. — note #7.
  7. Two of the fixes are "never free it". On failure paths the PR leaks rather than frees: core.pool.leak() (memory.rs:3104-3106), mem::forget(compressor) (memory.rs:3111), mem::forget(regions) in both quarantine paths, plus the pre-existing mem::forget(staging). This matches the existing quarantine idiom ("keep every pin, mapping and registration for the life of the process"), but #609 extends it to two objects previously freed. — note #10.
  8. The Windows #[cfg(windows)] IOCP attach is the one unexercised build path (selene/src/disk.rs, ReadAhead::start), and the description admits it was never compiled or run on Windows — while sibling PRs #496/#497 reported Windows IOCP test runs. Windows selene tests are part of CI (.github/workflows/native-serving.yml:53-55 (not opened)), so a break here would surface in later PRs, not this one. — note #3, note #6, note #15.

The change

Verified hunk by hunk against the diff (note #1):

Description/diff mismatches are in Key findings 4–5; the user-visible close error is the one that reaches operators.

The why

The stated problem has four strands: (1) slab pools unmapped before transfer/compression threads were joined and CompositeStore::close skipping memory.close() when disk.close() failed; (2) quarantine dropping mapped shared/session regions while an un-drained peer or copier still referenced them, and rdma::Device not retaining the staging region of a quarantined QP; (3) overlapping &mut [u8] from LocalRegions across concurrent readers and multi-rank scatter — undefined behaviour in Rust; (4) a Windows overlapped handle not attached to its IOCP queue.

No issue, report, crash dump or reproduction is linked; the body references only #496, #497 and #607. Of the four strands, the CompositeStore::close short-circuit and the IOCP attach are plainly visible as unconditional defects in the code; the quarantine strand depends on a timeout path (CLOSE_TIMEOUT) actually firing; the aliasing strand depends on two data-channel handlers overlapping, which I verified is reachable: each accepted data connection is its own task (selene-manager/src/data/channel.rs:435-447) and all handlers share one Arc<LocalRegions> (channel.rs:230, 1033), so two rank windows of the same put can concurrently form &mut views over overlapping bytes (note #14).

Context that does exist: #607, merged ten minutes earlier and reviewed, fixed the reported staging-slot double release that enabled "concurrent &mut [u8] aliasing" and released windows while a peer rank still had in-flight DMA. #609 generalises that theme to quarantine, RDMA staging and the manager's scatter. There is no evidence any of these defects were hit in the field. — note #7.

Recent activity

The same day, immediately before #609: 5df8edd3 (#607, the base), f7256584 (#496) and dad2fa56 (#497) (PCCessna's disk-fetch work), 716df00f (#504, 2026-11-25, AsyncCompressor), and ad72c493 (require pool attachment at startup / register off the I/O thread — the "first connect decides" attachment contract in conn.rs:590-675 that Engine::quarantine now unwinds). After #609: 8d05b9b6 (#611), a56333a0 (#610), 3801ff1b (#612). Nothing in the touched files was reverted or reversed; #609 sits in the middle of a same-day pile-up and is neither undone nor undoing. — note #9.

People

yatesdr is a COLLABORATOR with 79 merged PRs in 180 days and is the dominant committer in the touched areas — 36 commits in selene/src and 30 in selene-manager/src over 180 days, versus Luke Alonso 5/3 and Martin Vit 2. Their areas of record: helios/src (34), docs (33), selene/src (32), selene-manager/src (25), selene-manager/tests (20). The charter's named priority contributors are @voipmonitor, @original-el8, @lukealonso — yatesdr is not among them, but is effectively the owner of this code.

Who else works here: Luke Alonso (@lukealonso, priority contributor) authored #607, the PR this stacks on, and touched agent.rs/net.rs/engine/tests.rs (not opened); PCCessna (FujitsuPolycom) authored #496/#497 and owns the offload test #609 modifies.

Engagement on #609 itself: none. 0 comments, 0 reviews, no reactions, no labels. The only cross-PR attention is #607's autobot review naming #609 as a companion. — note #8.

Community

Nothing found beyond the above: no comments, reviews, reactions or cross-links on #609 other than the #607 mention. — notes #4, #8.

Project fit

Lines up: the Goals line "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene." (charter line 24) is precisely the path this hardens; "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)" is honoured in spirit — leaks are deliberate ownership retention, not swallowed errors; "No per-model special cases or flags" (line 43) is satisfied — no flags, no model branches, no wire-protocol change (selene.proto (not opened) untouched); "Be explicit and pin everything (#215)" is neutral — no dependency changes.

Where it strains: (a) "Solve the right problem in the right place … look for the smallest footprint in shared code" (line 9) — the fix is spread across 15 files and several layers, and two of its mechanisms (field declaration order in memory.rs/disk_store.rs (not opened)) are invisible invariants that no compiler check protects; (b) the Code Review Standards"Supported matrix & compatibility: … every supported … hardware target named in the docs" (line 42) — the Windows path is explicitly unverified and no evidence exists for #609 alone; (c) the "keep it alive forever" idiom is consistent with the existing quarantine doc comment but deliberately leaks on failure paths, and #609 extends it to two more objects. No non-goal (line 28) is touched. — notes #10, #18.

Claims and evidence

Claim Backing
cargo check --all-targets with -D warnings clean (selene + selene-manager) Self-reported; no log, no CI link. Packet says CI failed on the head commit.
541/541 --lib release tests with --features codec Self-reported. Plausible against the siblings' counts (#610/#611 claim 542, #612 claims 540), but unverifiable here.
28/28 FLARE_RUN_CUDA_TESTS=1 SM120 CUDA tests Suite is helios::offload::, which this PR does not touch; run on the combined stack.
Baseline-vs-patched parity across TP1/TP2/TP4, off/cpu/gpu, SM120 + GB10 --roce-ring: 0 panics, 0 quarantined bytes, bit-exact pos0, clean SIGTERM Combined 4-PR stack, before rebasing onto #496/#497/#607; only CPU tests re-run post-rebase. Nothing isolates #609.
"zero latency or parity regression on SM120 and SM121" No latency or throughput numbers exist in the PR.
Three new unit tests All three verified present: engine/tests.rs:1571-1589, shared/slice.rs:446-462, selene-manager/src/regions.rs:132-146. But ptr_mut gets only negative bounds asserts and scatter_disjoint is only tested single-threaded, 3-rank — no concurrent test of the aliasing fix.
Windows IOCP attach Explicitly not compiled or executed on Windows.

— note #3, verified against the diff.

Reach

Affected: anyone running flare run with the Selene pool (host prefix cache / selene-manager), single-host SHM and cross-host --roce-ring RDMA; anyone on the default codec feature (the compressor lifetime change); Windows users (IOCP attach). No wire-protocol change, no on-disk format change, no config/default/CLI change, no dependency change, no public API change (Staging::region/rdma::Device::open are pub(crate)). No docs are updated — nothing documents the new close error or the wider quarantine retention. Observable behaviour: a close can now fail where it previously "succeeded" silently while leaking the memory tier, and the pool status can become PoolStatus::Disabled("a copy could not be drained; memory is quarantined") with memory retained until process exit. — note #11.

Process

Draft vs ready: marked ready and merged the same minute-range; packet says "merged, ready for review". CI failed on head 304dd3a (workflow not identified). No review requested or given; no labels (siblings carry area:selene, bug, triage:review); no autobot intake comment on this PR, whereas #611/#612 both got "Review Stopped — already fixed another way / no longer needed" and #607 got a full "Ready To Merge" review. The PR body does contain all four parts the charter's description standard asks for (why / what changed / claimed result / evidence) plus an unusually candid limitations section. — notes #4, #17.

Open questions / what could not be found