PR #607: selene,selene-manager,helios: fix pool staging UAF, chain walk DoS, multi-process put corruption, and offload lifecycle bugs

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/125f5e0d-4251-42d2-9c78-0a984e54a5ac

Opened by a workflow run, Nov 29, 2026 12:16 PM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: lukealonso (COLLABORATOR, named priority contributor; Helios owner — 221 commits/180d in helios/src vs 2 in selene-manager/src); Discord: not provided Motivation: Selene pool transfers and prefix-cache offload had several memory-safety and corruption bugs: a remote peer could free staging memory still being read or written (with a cross-tenant KV leak risk), a self-referencing chain could spin a manager at 100% CPU, linked multi-process puts failed to commit, and parts of the offload lifecycle leaked pins or reused stale plans. This PR bundles one-sentence-ish fixes for eleven such defects. Scale: +1211 / −41 lines in 16 files (~380 of the added lines are tests) Proposal:

Full report · Notes

Value Proposition

Value Proposition — PR #607

1. Charter alignment

In scope: the charter goal to "store prefix-cache checkpoints in host memory and share them across Flare instances via Selene" covers every item, and no non-goal (model branches, backends, orchestration) is touched. @lukealonso is a named priority contributor, whom the charter says is "never close[d]... out of hand as 'low value'" (#229) — so this is a merge-with-conditions case, not a rejection. Evidence standard is only partly met: one of six items ties to a reproducible, maintainer-confirmed bug (#439); the other five (staging UAF, walk_chain hang, slot aliasing, transfer-ID collision, offload lifecycle) have no issue and no independent report — the evidence is the PR's own unit tests. The charter also requires root-cause fixes (#397) and matrix-wide checks (#397/"Supported matrix"): Index::expired's take_while→filter sidesteps touch_ancestors, the mechanism #439 names, and live GPU/RDMA/multi-process paths were never run (author-declared limitation).

2. Novelty & status

Not obsolete — none of these fixes is on main. Not superseded in full, but five of the six headline defects are covered by three open, same-day PRs from the maintainer who owns these files: #612 (entry_from, walk_chain, PutWin.first_page), #609 (identical withdraw_queued predicate), #610 (drain_compressed, disk_read, Index::expired). Those hunks touch the same lines and will conflict. Genuinely unique here: the claims.rs:1513-1516 data-channel guard, the agent.rs forget_window double-release fix, the manager-side StoreHandle.next_transfer allocator (required by the store's (connection, transfer) keying), and the Helios Worker::park clears.

3. Value vs maintenance cost

Production deltas are small (eight of eleven fixes are 1–5 lines; ~410 of the +477 in store_bridge.rs are tests). Beneficiaries are real but narrow: operators enabling --prefix-cache-max-age, and multi-process/TP>1 clients. Costs are real and largely undeclared: dropped Violation checks on the untrusted gRPC path (claims.rs:1517-1529), permanent quarantine on transient open/IO errors (composite.rs:1125-1134), deletion of a documented limitation (docs/prefix-cache-offload.md:623-631), an extra pool lookup per park, debug_assert!-only duplicate-release detection, and no test for a never-done peer.

Verdict: Worth it with changes

Rebase onto #496/#497; carve out only the four unique fixes plus #439, deferring the overlapping hunks to #609/#610/#612. Declare and justify the gRPC validation loss and the transient-error quarantine (or narrow it to genuine corruption), restore or explicitly amend the docs sentence, and attach SM120/GB10 and RDMA/multi-process evidence before merge.

Full report Decide Value: yes (96%): This change is worth reviewing: it provides value to the project in line with its charter.

Classify intake

Selected: triage:review, bug, duplicate, area:caching, area:selene

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +bug, +duplicate, +area:caching, +area:selene

Correctness and contracts

Correctness/contracts review of #607 at head 4f12cae: the core mechanics are right, but one offload fix quarantines on transient I/O and several claims overstate the evidence.

  1. COMPOSITE TRANSACTION — quarantine_corrupt fires on transient record-open failures, not just corruption. Proven by composite.rs:1130-1132 (unguarded is_record_read() → quarantine), disk_store.rs:1099-1104 (file-open timeout → fail), and disk_store.rs:2473-2480 where a corrupt store normally fails only one copy while memory republishes the record. Result: one slow disk file wipes the copy from both tiers, then start_deferred runs against a key with no record and the linked child is stranded mid-publication. This is normal I/O, not hypothetical.
  2. STALE PLAN — clearing pool_plan at park but keeping public_prefix lets begin_pool_lookup adopt the pre-park plan via tokens_agree, although prompt_len changed.
  3. EVIDENCE CLAIMS ARE FALSE — claims.rs:1505-1516 is truncated, and the "11 tests drive production entry points" / "PINNED after RESET" claims don't hold; corrupt_a_v1_record_is_dropped_and_recaptured locks in the wrong policy.
  4. 1-in-10^9 UNDERFLOW becomes a dead transfer with no recovery.
  5. NOT FOUND — no offline expirer for the linked-ancestor fix, no epoch on persists, no coalescing of concurrent v1 discards, no unclean-close sweep.

Everything else in the diff checked out; transfer IDs are wired correctly and WindowGrant.page_first really is chain-absolute.

Full report · Notes

Subtraction and simplicity

Lens: Subtraction, Simplicity & Conventions for PR #607. The production diff is materially leaner than +1211 lines suggests (most added lines are tests), and three changes are net simplifications (memory.rs, shared/index.rs, composite.rs). Five suggestions, all inside PR-touched code:

  1. selene-manager/src/pool/index.rs:171,184,194,211 — walk_chain now carries two bounds; nodes.len() >= max_nodes at :211 is unreachable (steps at :194 already returned, and nodes.len() <= steps). Collapse to one visited counter and revert :171 to if page_tokens == 0.
  2. selene-manager/src/pool/claims.rs:1513-1516 — the early return Ok(()) also deletes both Violations for channel claims on the untrusted gRPC path; AGENTS.md:182-186 ("Do not remove validation"). Move the guard onto the Phase::RequesterRead arm instead.
  3. selene-manager/src/pool/claims.rs:225-227 + store_bridge.rs:1226-1242 — ManagerGet.transfer: u64 with a 0 sentinel forces a .filter(|&t| t != 0); Option<u64> deletes sentinel + filter. new_store_transfer/new_store_connection (store_bridge.rs:116-126) are byte-identical but for the field.
  4. helios/src/server/runtime.rs:2117-2121 — the PR adds a fifth divergent hand-written reset list (:1584-1588, :2586-2587, :2598-2599, :2627-2630); that duplication is the bug class. One Incoming::reset_admission() removes it.
  5. selene/src/pool/net.rs:165 — drop(free); is redundant.

Checked and fine: no new knob, flag, fallback, or stale docs; test-only helpers are small; ChainStep built twice in walk_chain is pre-existing (optional follow-up). Open questions: whether Option<u64>/reset helper are wanted as in-lens refactors on an already-large bugfix PR, and whether the 0 sentinel is meant as a wire-visible value.

Full report · Notes

Final review

Recommendation: Ready To Merge

PR #607 fixes six concrete, verified memory-safety, DoS, state-corruption, and offload lifecycle defects across selene-manager, selene, and helios with a lean production footprint (~60 non-test lines) and targeted regression tests for each fix. No correctness regressions, wire/on-disk format breaks, or blockers were found after inspecting every modified path and its surrounding concurrency/lifecycle invariants at 4f12cae. Two defence-in-depth / robustness polish items (claims.rs gRPC validation order and composite.rs transient I/O vs corruption quarantine) and two small simplifications are noted below as optional follow-ups.

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. Preserve gRPC window/phase validation on channel claims (selene-manager/src/pool/claims.rs:1513-1531): Returning Ok(()) at line 1513 before looking up claim.windows and checking window.phase makes the two Err(Violation) checks at :1517-1529 unreachable for data-channel requesters on this untrusted gRPC entry point. (This mirrors window_filled at :1437-1440, so it is consistent with existing style, and a channel requester cannot trigger UAF here.) To keep defence-in-depth validation without extra complexity, hoist let channelled = claim.channel().is_some(); before claim.windows.get_mut and gate only the Phase::RequesterRead release arm: Phase::RequesterRead if channelled => return Ok(()) (or reject any gRPC WindowReleased on a channel claim as a Violation, since compliant clients never emit it per selene/src/pool/engine/requester.rs:918-924).
  2. Distinguish transient OS open/read errors from corruption before permanent quarantine (selene/src/composite.rs:1130-1132): Calling self.disk.quarantine_corrupt(&node) on any error.is_record_read() fixes corrupt unpacked v1/v2/v3 pages (Operation::ReadPages/ReadRow), corrupt headers, and deleted files (Operation::Open in selene/src/disk.rs:1088-1111), all of which set with_record_read() (selene/src/disk_store.rs:1103, 1131, 1160). However, transient OS errors during direct_file open or read (e.g., EMFILE or temporary EIO) also set is_record_read() and will mark a healthy ancestor location.failed = true (disk_store.rs:3099-3105), hiding all descendants until recaptured (whereas the packed v4 path at composite.rs:1090-1103 narrows quarantine to packed::Checksum). Consider gating quarantine_corrupt on content/missing-file errors (checksum/header invalidation and ENOENT) rather than transient I/O errors, or document that permanent quarantine on any record-read error is intentional.

Subtract / Simplify

  1. Remove redundant bound in walk_chain (selene-manager/src/pool/index.rs:171, 184, 194, 211, 214): steps increments on every loop iteration while nodes only appends when parent.tail_pages > 0 (:217), so nodes.len() <= steps always holds and || nodes.len() >= max_nodes at :211 is unreachable after steps >= max_nodes at :194. Replace || max_nodes == 0, steps, and || nodes.len() >= max_nodes with a single visited counter checked at the top of the loop (visited += 1; if visited > max_nodes { return None; }).
  2. Use Option<u64> instead of a 0 sentinel for ManagerGet.transfer (selene-manager/src/pool/claims.rs:225-227, selene-manager/src/pool/store_bridge.rs:1208-1234): Manager-allocated store transfers start at 1 (store_bridge.rs:122-126), so 0 is only an "unstarted" sentinel that forces .filter(|&transfer| transfer != 0) in store_cancel_get (:1232). Changing ManagerGet.transfer to Option<u64> removes the magic sentinel and the .filter.

Nits

Dropped on verification

Full report Decision to Test: yes (89%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing.

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes

Pre Test Report

Hardware test plan for PR #607 (selene / selene-manager / helios pool + offload fixes)

Bottom line first

  1. There is no speedup to measure. PR #607's own description claims only correctness, memory-safety, remote-DoS and state-corruption fixes ("Claimed benefit and result", PR #607) — no latency, throughput or memory number appears anywhere in the diff or description. The final review's only perf-adjacent note is a cost: Index::expired changing take_while→filter scans the whole tick order once every 60 s when --prefix-cache-max-age is enabled (off by default). So the objective for hardware is no-regression + real-path validation, not speedup measurement. Treat any "speedup" ask as out of scope for this PR; do not spend GPU time on A/B timing runs.
  2. Only one machine is usable: cn7 (1× GB10, SM121, arm64, 60 GiB unified RAM, 16 GiB scratch). cn5 is Offline.
  3. cn7 can genuinely validate 7 of the 8 behaviours; 3 cannot be reached on one GPU and must be deferred to cn5 (4 GPUs) or two Sparks. The single most valuable thing cn7 can do — and the thing the PR explicitly did not run — is drive the data-channel (DATA_CHANNEL) path against a real manager and real GPU bytes, because that is the only path that reaches the remote staging UAF fix.

What each fix needs, and whether cn7 can reach it

# Fix (PR head 4f12cae) Needed to exercise it cn7?
1 claims.rs:1513-1516 remote data-channel staging UAF guard Manager with --listen/--listen-data; client on TCP address so mode=DATA_CHANNEL (agent.rs:726-730, requester.rs:273-277) Yes — same host, loopback TCP works (selene-manager/docs/network-operations.md:3-15,61-89)
2 mod.rs:113-117 + index.rs:171-227 (not opened) zero/self-parent chain CPU DoS Manager-side index walk; any attached client, TCP or unix Yes
3a agent.rs:1561-1565 staging-slot double release on failed channel.send Data-channel client with a deliberately broken data connection Yes (TCP + kill/blackhole of the data port)
3b requester.rs:1177 withdraw_queued gating on peers_left Multi-rank: Peers/rank agents with shared windows No — needs ≥2 GPUs (one rank per GPU, docs/model-preparation.md:468-470)
4a store_bridge.rs:122-126 monotonic transfer IDs Manager store bridge, concurrent puts/gets with colliding client IDs Yes (single-rank put/get is enough to catch cross-cancel)
4b linked multi-process put first_page (store_bridge.rs:643-647) Multi-rank linked put (mp.whole indexed by record page, store_bridge.rs:861-884) No — deferred to cn5
5 helios/src/server/runtime.rs:2114-2121 stale pool plan on Worker::park Helios worker parked after a pool lookup, then re-admitted Yes (TP1 pool-attached server, long continuation)
6a memory.rs:2344-2349 deferred child wake after async CPU-codec row refill --lossless-kv-compression cpu + a child checkpoint published while the parent's row is refilling Yes
6b composite.rs:1125-1134 quarantine of unreadable unpacked v1/v2/v3 disk ancestor --prefix-cache-memory + --prefix-cache-disk, then corrupt a .ckpt Yes
6c shared/index.rs:503-511 (not opened) expiry sweep past a fresh leaf (#439) --prefix-cache-max-age enabled Yes

Two files (selene/src/composite.rs, memory.rs) and all of selene-manager's fixes are already covered by CPU unit tests on a copier that never touches a device; the hardware value is proving them through the real CUDA transfer threads and the real manager protocol.


Test plan (in priority order; GPU time is only used from step 5 on)

All paths assume the repo root on cn7, scratch on the 16 GiB volume ($SCRATCH), and $T=flare-cli/target.

Step 0 — Environment gates (no GPU, ~2 min)

Step 1 — PR's own 11 regression tests, exact commands (CPU, ~5 min)

cargo test --locked --release --manifest-path selene/Cargo.toml (not opened) \
  --features test-support --target-dir $T --lib -- \
  failed_channel_send_releases_staging_slot_once \
  withdraw_queued_waits_for_peer_dma_before_releasing_window \
  async_cpu_codec_refill_wakes_deferred_child \
  corrupt_ancestor_v3_page_is_quarantined_and_replaceable \
  expired_sweep_skips_leaf_refreshed_without_new_tick

cargo test --locked --release --manifest-path selene-manager/Cargo.toml \
  --features test-support --target-dir $T --lib -- \
  window_released_from_channel_requester_does_not_drop_extent \
  entry_from_rejects_self_parent_and_non_monotonic_parent \
  walk_chain_rejects_self_parent_cycles_and_zero_page_chains_beyond_max_nodes \
  put_and_get_with_same_client_id_use_disjoint_store_transfers \
  linked_multi_process_put_stores_record_relative_window_first_page

cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) \
  --features runtime-core,server --target-dir $T --lib -- \
  worker_park_clears_stale_pool_plan_and_lookup

Pass = 11 passed, 0 failed, and 0 skipped (report any ignored/early-return: corrupt_ancestor_v3_page_is_quarantined_and_replaceable returns early when test_directory yields no O_DIRECT directory).

Step 2 — Full crate suites, arm64 build correctness (CPU, ~30–45 min)

for crate in selene selene-manager; do
  cargo test --locked --release --manifest-path $crate/Cargo.toml (not opened) --features test-support        --target-dir $T
  cargo test --locked --release --manifest-path $crate/Cargo.toml (not opened) --features test-support,rdma   --target-dir $T
done

Run selene first: selene-manager/tests/rank_processes.rs (not opened) launches $T/release/examples/rank_node, produced only by the selene test build (selene-manager/docs/qualification.md:43-47). This is also the only cn7-reachable exercise of the real multi-rank SIGKILL paths (rank_processes: quarantine until process exit, peer drain after rank zero dies) — it uses real processes, so it partly compensates for the missing multi-GPU HIL for fix 3b. Expected: selene 510+, selene-manager 185 lib + 11 integration binaries. Known pre-existing flake, do not attribute to #607: client::a_record_put_into_a_manager_on_another_host_is_restored_over_tcp races the 10 ms Core::tick() metric refresh (PR description; also disclosed in the PR). The rdma builds add pool_channel::over_rdma::{r1,r2} — they need libibverbs and an active RDMA port; on GB10 use Soft-RoCE (sudo modprobe rdma_rxe; sudo rdma link add rxe0 type rxe netdev <eth>, docs/network-operations.md:130-136) or skip and record as unrun. RDMA is explicitly not a correctness gate (qualification.md:54-57).

Step 3 — Helios library suite on SM121 (CPU + locked memory, ~20 min)

sudo prlimit --pid $$ --memlock=67108864:67108864
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) \
  --features runtime-core,server --target-dir $T --lib -- server::runtime

Expect 133 passed / 1 ignored (PR evidence). This is the arm64/SM121 compile-and-logic gate for fix 5 that the PR only ran on x86_64.

Step 4 — Export one TP1 core on cn7 (GPU, ~10–20 min, one-time)

SM121 is mandatory: an SM120 core is refused by the architecture check (docs/model-preparation.md:475-478). Use nvidia/Qwen3.8-27B-NVFP4 (on the box, native ARM64 serving qualified on RTX Spark, docs/windows.md:179-183 (not opened)) or nvidia/GLM-5.3-Flash-FP4-Local:

.venv/bin/ignition export qwen3.8-27b --gpus 0    # writes a core into the model cache
flare-cli/target/release/flare models list --json   # locate the core path
export CORE=<path>; export CUDA_VISIBLE_DEVICES=0 FLARE_OFFLOAD_TEST_CORE=$CORE

Budget note: GB10 shares DRAM with the CPU (60 GiB total). Keep the core small (27B NVFP4 TP1), set [memory] reserve = "4G", and use modest --prefix-cache-memory/--prefix-cache-disk-limit (1 GiB / 8 GiB). Skip tests/server/test_cache_memory.py — it requires ≥4 concurrent requests with 130,000 output tokens reserved each and will OOM/thrash on 60 GiB. Do not substitute a pre-existing core unless it is SM121.

Step 5 — Real GPU offload regressions (GPU, ~15 min)

CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 FLARE_OFFLOAD_TEST_CORE=$CORE \
  .venv/bin/python -m pytest tests/server/test_prefix_cache_offload.py -q --basetemp $SCRATCH/http

Covers fixes 6b/6c end-to-end on real bytes: memory/disk/composite hit + restart, and the corrupt-record case (test_prefix_cache_offload.py:175-190, expects flare_host_cache_fetch_failed_total > 0, fetched_total == 0, one init launch, zero restore launches, then a correct recomputed answer) — that is exactly the behaviour composite.rs quarantine must produce. Pass = green with no skipped tests. Optional (same GPU window, +10 min): CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 FLARE_OFFLOAD_TEST_CORE=$CORE FLARE_OFFLOAD_TEST_DIR=$SCRATCH/offload cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server --target-dir $T offload:: -- --ignored --test-threads=1 (each test loads the whole core; ~6 tests; keep the limit so core_geometry_lists_every_plane runs).

Step 6 — Pool over TCP = data channel: the highest-value HIL step (GPU, ~20–25 min)

This is the only cn7-reachable path through the UAF fix, and the PR never ran it (FLARE_RUN_CUDA_TESTS=1 undisclosed unrun).

# 1. manager, TCP only => attached sessions have NO shared memory => DATA_CHANNEL
selene-manager/target/release/selene --name pool \
  --root $SCRATCH/selene-root --memory 2G --nvme 4G --staging 512M \
  --listen 127.0.0.1:9200 --listen-data 127.0.0.1:9201 \
  --metrics 127.0.0.1:9108            # expect: "selene: warning: network listening enabled ... (plaintext, data on 127.0.0.1:9201)"

# 2. server attached to it over TCP
flare-cli/target/release/flare run $CORE --gpus 0 --port 8080 \
  --prefix-cache-pool 127.0.0.1:9200 --prefix-cache-memory 1G --prefix-cache-disk $SCRATCH/rec --prefix-cache-disk-limit 8G

Scenarios (each ~3–5 min, use a ≥32k-token prompt from tests/server/test_prefix_cache_offload.py:111-114 and 24+ distinct prompts to force evictions):

  1. Correctness/hit path: ask P (long), ask P again → identical answer, flare_host_cache_stored_total and fetched_total increase, fetch_failed_total == 0, flare_cache_reused_tokens_total grows >32000.
  2. Put path over the channel: manager metrics selene_puts_total{outcome="ok"} increases, {outcome="error"} flat; selene_pool_channel_windows_total{carrier="stream"} and _channel_bytes_total{carrier="stream"} increase (proof bytes really moved on the data channel, not via SHM — core.rs:1012-1019).
  3. Claim-vs-release ordering (fix 1): during a restore of a large prefix, kill -STOP the manager's data listener path is overkill; instead SIGKILL the flare process mid-restore. Then restart and repeat. Assert the manager logs no panic/UB and selene_pool_quarantined_bytes returns to 0 after the handler exits (docs/network-operations.md:76-80,145). The pre-fix failure mode (extent dropped while the handler read it) shows up as a manager panic or a page-checksum mismatch reported by the client, and flare_host_cache_fetch_failed_total > 0 — any of those is a hard fail.
  4. Staging-slot release (fix 3a): with the flare process started, break the data path (iptables/nc blackhole on 9201, or SIGSTOP the manager's data listener thread via kill -STOP on the manager). The claim should expire with NO_PROGRESS after the 3 s progress timeout, and the client must keep serving (fall back to prefill) with no staging slot ... released twice debug assertion and no restart loop. Repeat 5× to catch the race.
  5. Chain-walk DoS (fix 2): hardest to trigger from a well-behaved client; the unit test is the real gate. Cheap HIL proxy: after warm-up, assert the manager's CPU stays idle (selene_pool_index_entries stable, top -H -p <mgr> ≈0%) across a 100+ prompt sweep. Report as "no evidence of manager spin", not as positive proof.
  6. Expiry sweep (#439, fix 6c): run the server with --prefix-cache-max-age=60s; store ≥3 prompts, wait >60 s, keep re-asking one prompt so leaves stay fresh, then assert older records still expire (flare_host_cache_expired_total > 0) while fetch_failed_total == 0. This is the one place where the filter-scan cost is paid: record request latency before/after with max-age on vs off — expect no measurable change at 3–10 records; that is the no-regression check, not a speedup claim.
  7. Worker::park stale-plan (fix 5): with the pool attached, run a long generation (max_tokens near the configured limit) that forces the worker to park and be re-admitted; assert flare_host_cache_hits_total/reused_tokens_total behave monotonically and no restore targets a shorter prefix than the parked prompt (a stale plan shows as a restore whose reused-token count is below the pre-park prompt length, or a ChainGap/failed restore burst). Log the flare_host_cache_lookups_total vs hits_total ratio for the record.

Total GPU time on cn7: ≈ 60–75 min, dominated by step 4 (export) and step 6.

Step 7 — Deferred to cn5 when it returns (must be listed as an unrun check until then)

Run on 4× RTX PRO 6000 in one job (48 CPUs / 125 GiB is plenty; 16 GiB scratch is tight — put record dirs on the scratch volume and keep --nvme 4G):


Pass/fail criteria (put these in the test record)

Risk / waste avoidance

Full report · Notes

Discord Test Request

Discord post (ready to paste)

## Recommendation: Test
(medium–high confidence — the PR claims correctness only, no speedup; 7 of 8 fixes are reachable on one GPU, and the highest-value path was never run by the PR author. Confidence drops to medium on the second half, because that path has no prior evidence and its own docs say the multi-GPU cases can't be reached on cn7.)

## Hardware Required
- cn7: 1× GB10 (SM121, arm64, 60 GiB unified) — hosts every step in one job.
- One SM121 TP1 core on cn7, e.g. Qwen3.8-27B-NVFP4 (an SM120 core is refused; exporting is the biggest cost).
- Deferred only: cn5 (4 GPUs) or 2 Sparks, for the multi-rank checks that a single GPU cannot reach.

## Justification
- There is no speedup to measure — this PR is UAF / 100% CPU DoS / double-release / state-corruption fixes, so hardware is for no-regression + real-path validation, not A/B timing. Its 11 unit tests already pass on CPU.
- The PR never once drove a real manager + real GPU bytes over the data channel, which is the only path to the remote staging use-after-free. A manager panic, a page-checksum mismatch, or a "staging slot released twice" assert there blocks merge.

## Estimated Time to Complete
~2.5 h on cn7 in a single job (≈75 min CPU gates: regression tests, full selene/selene-manager suites, helios SM121; ≈60–75 min GPU: core export, offload tests, pool-over-TCP scenarios), plus ≈1–1.5 h deferred on cn5 when it is back online for the multi-rank runs.

What I verified, and what I could not

Goal: produce the post. Done when: every angle looked into with scratchpad entries and every lead followed. I met the post goal but only partly met the second bar — I ran out of turns before finishing verification and before writing any scratchpad notes, so treat the notes as absent and the checks below as the record.

Confirmed against the repository

Not verified (should be re-checked before the plan is run for real)

Two things in the input worth flagging

Scratchpad status

No notes were written — the run ended before that step, so the repo-verified findings above (PR merge state, the absent qualify/ scripts, the two confirmed test locations, the missing perf claim) exist only in this report.

Full report