Case file — PR #607: "selene,selene-manager,helios: fix pool staging UAF, chain walk DoS, multi-process put corruption, and offload lifecycle bugs"
State: open, ready for review, opened and last updated 2026-11-29, base main, head 4f12cae, 16 files, +1211/−41, CI passed on head, zero reviews, zero comments, no labels. Author: lukealonso (COLLABORATOR).
Key findings
- Five of the six headline defects are fixed independently by three other open PRs, opened the same day, by the maintainer who owns these files. yatesdr's #612 (open) duplicates the
entry_fromparent validation, thewalk_chainbound and thePutWin.first_pagefix in the same files; #609 (open) contains a byte-for-byte identicalwithdraw_queuedpredicate; #610 (open) makes the sameMemoryStore::drain_compressed,CompositeStore::disk_readandIndex::expiredchanges. Only four items are unique to #607: the data-channelWindowReleasedguard (claims.rs), theAgentstaging-slot double-release, the manager-allocated store transfer IDs, and the HeliosWorker::parkclear. Neither side references the other; the overlapping hunks are the same lines and will conflict on merge. - The evidence is CPU-unit-test only. The author's 11 regression tests all exist and match the description, and CI is green, but nothing exercises live GPU/RDMA/multi-process execution — while the competing series (#609–#612) reports SM120/GB10
flare runqualification. #607's own limitations section admits live GPU/RDMA runs and theFLARE_RUN_CUDA_TESTS=1paths were not run. - Undeclared effects on the untrusted gRPC path. The new guard at
selene-manager/src/pool/claims.rs:1513-1516returnsOk(())for channel claims before the window lookup, so for those claims the twoViolations atclaims.rs:1517-1529(unknown window index; window not yet filled) are no longer raised. The description only says the call "ReturnsOk(())immediately". - Undeclared: transient disk errors now permanently quarantine records.
is_record_read()is also set on record open failures (selene/src/disk_store.rs:1099-1104), so the newquarantine_corruptcall inselene/src/composite.rs:1125-1134fires on a transient EIO/ENOENT, marking unpacked v1/v2/v3 records failed until recaptured — stronger than the previous "drop only the lookup row" (disk_store.rs:3223-3233). The description frames the arm as "corrupt disk pages" only. - #439 is fixed by scanning past the symptom, not the root cause the issue names.
Index::expiredgoestake_while→filter(selene/src/shared/index.rs:503-509), while the missing access tick intouch_ancestors— the mechanism in the issue title — is left in place. Thetake(64)now caps the result, not the scan; sweep cost grows with live-leaf count when max age is enabled. #610 makes the same choice. - Item 4's second half completes a half-done fix: merged #392 had already introduced the record-relative
first_pageexpression forWindowSpec; #607 hoists it soPutWinshares it (selene-manager/src/pool/store_bridge.rs:640-647). The description does not say this. - The docs edit removes a documented limitation:
docs/prefix-cache-offload.md:623-631deletes the sentence "A fresh former interior node left as a leaf by pressure eviction can delay a sweep by up to one max age." - Process/people: author's centre of gravity is Helios (221 commits/180 days in
helios/src) versus 2 inselene-manager/src(yatesdr: 28; 32 inselene/src). No review has been requested or given; the only outside trace is issue #439's backlink.
The change — plain terms, scale, file map
Eleven independent bug fixes in one bundle, not one feature. Most of the added lines are tests: store_bridge.rs +477/−24 of which ~410 are two tests; selene/src/pool/agent.rs +155 is all test; phase_tests.rs +79 and engine/tests.rs +47 are all test. The production change is small: one early return (claims.rs:1513-1516), two validation clauses (mod.rs:113-117; index.rs:171 and :192-197 plus a steps counter), a transfer-ID allocator threaded through existing call sites, one hoisted local (store_bridge.rs:640-647), one added line (agent.rs:1563), one tightened predicate (requester.rs:1177), one debug_assert! (net.rs:159-167), five field clears (runtime.rs:2117-2121), a deleted if (memory.rs:2344-2350), one rewritten match arm (composite.rs:1125-1134), take_while→filter (shared/index.rs:503-509) and a doc paragraph.
Reviewer anchor map (all at pr/607):
selene-manager/src/pool/claims.rs:1505-1533window_released guard (test:3022);:225-227ManagerGet.transfer;:283-291new#[cfg(test)] Claim::new_for_test;:2201-2207put-side cancel usesrec.transfer.selene-manager/src/pool/store_bridge.rs:39-42StoreHandle.next_transfer;:122-126allocator;:55-57PutRec.transfer;:434-438put allocation;:1190-1194get allocation;:1226-1241store_cancel_get(filterstransfer != 0);:632-690put_answer; tests at:1740and:1860.selene-manager/src/pool/mod.rs:98-135entry_from(+:113-117), test:299;selene-manager/src/pool/index.rs:163-232walk_chain, test:403;selene-manager/src/pool/core.rs:424-428init.selene/src/pool/agent.rs:1555-1570window_drained+forget_window, test:1856;selene/src/pool/net.rs:159-167;selene/src/pool/engine/requester.rs:1149-1167test hook +:1177, testselene/src/pool/engine/tests.rs:2122.selene/src/memory.rs:2344-2350, test:6260;selene/src/composite.rs:1120-1135, test:6000;selene/src/shared/index.rs:501-509, test:1392;selene/src/testing.rs:255-265SimulatedGpu::shared_with.helios/src/server/runtime.rs:2110-2122, testhelios/src/server/runtime/phase_tests.rs:6851-6927;docs/prefix-cache-offload.md:623-631.
Not touched: selene/proto/selene.proto (not opened), any Cargo.toml (not opened)/Cargo.lock, selene-manager/src/data/channel.rs (not opened) (the file the claims.rs guard protects), selene-manager/src/pool/{mp,pass,windows,store}.rs, helios/src/scheduler.rs.
What the description does not say (verified against the code)
- The guard analogy is approximate: the new check uses
claim.channel()=root(&legs, false)(claims.rs:293), whilewindow_filled's check is onsource_channel()=root(&legs, true)(claims.rs:296,:1437). The new branch protects the requester leg, not the source leg; a source-channel claim's writes are still released throughChanOwner::Claim(key) => reader_doneatclaims.rs:1795. - Dropped validations on the gRPC path (
claims.rs:1517-1529) — see Key finding 3. - The double-release detection is
debug_assert!only (net.rs:159-167), compiled out in release; only the behavioural fix (forget_window) applies there. StoreCommandtransfer IDs are manager-allocated everywhere, butput_answer'sOk(PutAnswer::Accept(accept))(store_bridge.rs:598-631) never compares the echoedaccept.transferwithrec.transfer; the invariant relies on the store echoing correctly. The test asserts the value but production does not enforce the match.entry_fromrejection drops a client's announced index entry at ingest, andwalk_chainrejection surfaces to clients asChainGap(claims.rs:627-636,selene-manager/src/pool/lookup.rs:207(not opened)) — misses, not errors, no new error code.- Transient-error quarantine — see Key finding 4.
Worker::parkclearingpool_lookupabandons the outstanding ticket and relies onLookupTicketdrop to withdraw it (no explicit call atruntime.rs:2117-2121; the test assertswithdrawn == 1on theFakeStore);blockedis cleared unconditionally; and every park now performs a fresh pool lookup for the extended prompt. The mechanism is real:begin_pool_lookupbails early whenpool_plan.is_some() && !retry(runtime.rs:2755-2757) and otherwise clones the old history viarefresh_admission_plan(helios/src/scheduler.rs:1592-1598).Index::expiredscan cost — see Key finding 5.- Three undeclared
#[cfg(test)]surfaces appear in the file list:Claim::new_for_test,Engine::attach_shared_peer_for_test,SimulatedGpu::shared_with. - Two tests can be skipped or vacuous:
async_cpu_codec_refill_wakes_deferred_childis#[cfg(feature = "codec")](memory.rs:6259) andcorrupt_ancestor_v3_page_is_quarantined_and_replaceablereturns early iftest_directoryyields None (composite.rs:6001-6003). - The description's "No model core re-export or wire protocol change" is accurate — no proto, Cargo or on-disk format change;
StoreCommandis an internal manager↔store channel.
The why
- Cited issue: #439 (open, by shieldstar, 2026-11-21, labels area:caching/area:selene/bug) — "Prefix-index sweep stops at a refreshed leaf whose access tick never advanced". Strong report: standalone test file plus two cargo commands against upstream
25b49519, showingswept=[]while an independently expired leafbackstays selectable, with a control case where both leaves are swept. - Maintainer confirmation: yatesdr's 2026-11-21 comment confirms by reading
selene/src/shared/index.rsexpired/touch_ancestorsand amemory.rscaller, bounds the impact (only with--prefix-cache-max-age/ manager--max-age; expiry off by default; "later expiry, never wrong output"), and notes the docs already described the stop-at-first-fresh-leaf behaviour. He explicitly leaves one question open: whether a repeatedly re-offered leaf can hold a sweep back longer than one max age. #607 does not answer it. The issue proposes two fixes — a fresh tick intouch_ancestors, or scanning past non-expired nodes; #607 and #610 both take the second. - The other five items have no issue and no external report: the data-channel staging UAF / "cross-tenant KV leak", the "remote 100% CPU hang in
walk_chain", the staging-slot aliasing, the store transfer-ID collision, and the three offload lifecycle bugs are all self-identified, backed only by the new unit tests. - Baseline validity I could confirm from code: the store really does key
opson (connection, transfer) and rejects duplicates (selene-manager/src/store.rs:615,:4818-4823,:4893-4896), andStore::cancelkeys only on (connection, transfer) (store.rs:3477-3507) — so the transfer-ID fix is required by the store's contract, not cosmetic. The store'sPutAccept.first_pageandWindowGrant.page_firstreally are chain-absolute (store.rs:1731-1733,:1798-1806,:4720-4724,:4755-4759), so thePutWinbug only bit linked (parent-nonzero) multi-process puts on the commit path.
Related work
Direct duplicates (all open, all yatesdr, all opened 2026-11-29 17:08 — minutes after #607):
- #612 (branch
fix/selene-manager-hardening, +375/−63, 11 files, head6c5e2e1) — shares 6 files:selene-manager/src/pool/{claims,core,index,mod,store_bridge}.rsandselene/src/shared/index.rs. Same three fixes:entry_fromrequiresparent.consumed_tokens < key.consumed_tokens;walk_chainbounds hops and enforces decreasing tokens;PutWin.first_pagetail-relative somp.wholeindexes from zero. Adds more (validate_scope 64 ranks/1 TiB,windows::planoverflow, TLS handshake cap, idle-scope bounding, pidfd EINTR, rank-0 reconnect secrets,session_claims_lostreclamation), and rejects multi-process packed PutBegin/PinAck outright, which #607 does not. - #609 (branch
fix/selene-dma-lifetime-safety, +307/−72, 16 files, headdb83ae7) — theEngine::withdraw_queuedchange is identical:w.jobs_left == 0 && w.peers_left.is_empty() && !w.released(selene/src/pool/engine/requester.rs:1177), with the same test scenario. Shares 6 files with #607 (agent.rs,net.rs,memory.rs,composite.rs,engine/tests.rs,requester.rs). Covers ground #607 does not: drop order of MemoryStore/disk_store resources,CompositeStore::close, async-compressor counter leak on panic, quarantine on region retention, conn shutdown → quarantine,rdma::Deviceretaining stagingRegion, overlapping&mut [u8]inLocalRegions, Windows IOCP ReadAhead. - #610 (branch
fix/selene-local-tiers-and-sharding, +629/−166, 16 files, head39128a8) — same change toMemoryStore::drain_compressed(unconditionalstart_deferred), sameCompositeStore::disk_readdrop/quarantine, sameIndex::expiredtake_while→filter(testexpired_skips_fresh_leaves_ahead_of_older_leaves). - #611 — overlaps 3 files (
agent.rs,engine/requester.rs,net.rs) on different defects (event-loop fairness, fence acks, staging arithmetic). Not a conflict on the same lines.
Cumulative: if #609 + #610 + #612 land, 5 of #607's 6 headline defects are already fixed elsewhere; #607's unique content is the claims.rs data-channel guard, the Agent double-release, the store transfer-ID allocator, and the four item-5/Helios-adjacent fixes minus the three #610 takes. The three descriptions and #607's never mention each other. #607's Discord field is "no username provided" while #609–#612 carry "D-Rock" and #613 carries "lukealonso".
Lineage (background, no conflict): #413 "Link Selene pool puts to held ancestors and store each page once" and #392 "Count pool put-grant pages from the accepted record" (merged) created the linked-put feature and introduced the record-relative first_page for WindowSpec — #607 hoists that same expression so PutWin shares it, i.e. it completes a half-done #392. #524 (packed-v4 quarantine/composite slots) built the packed path #607's composite fix extends to v1/v2/v3. #504 (pure-CUDA/CPU KV compression) created the async CPU-codec refill path whose refill guard #607 removes. #415 (rows by role / write-back on eviction), #429, #416, #455, #486, #342, #402, #476 are merged same-file history in the pool/store bridge; none is superseded or reversed by #607. #497 and #496 (PCCessna, merged 2026-11-29, hours before) rewrote CompositeStore::disk_read, MemoryStore intake and the offload restore/park path — #607 patches on top of work merged the same day (see Recent activity).
Not relevant: #613 (same author, opened 17:12 — Helios scheduler/checkpoint/CUDA-teardown/wire; no file overlap), #608 (same author — catalog validation, CPU Python tests, script separation; no overlap).
Recent activity
selene-manager/srclast 60 days, essentially all yatesdr: #523, #504, #476, #402, #415, #413, plus 9710cadc (Luke Alonso, core acquisition descriptors) and b930771b. #607'sPutWin.first_pagesits directly on #413/#392; itsStoreHandle.next_transfersits on the store-bridge/queue-pressure work (#342).selene/srcin the two days before: f7256584 (#496) and dad2fa56 (#497) — both PCCessna, both merged 2026-11-29, both rewriting the exact offload intake/restore path #607'sdrain_compressed,disk_readand park items touch; then ba3afb13 (#589), 6d74db3a, #527, #524, #526, #523. Both competing series say they rebased onto f7256584 (#496); #607 states only that its tests ran at head4f12cae.helios/src: Luke Alonso 221 commits/180 days, Martin Vit 52, yatesdr 47; the author's own #595, #598, #593, #596 landed the day before. #607'sWorker::parkchange is a fifth small fix in the same runtime area by the same author, not described as part of that series.docs: Luke Alonso 378, Martin Vit 55, yatesdr 47 — the one-paragraph docs edit is in the author's strongest area.- No open branch is stacked on #607 and it neither supersedes nor reverses a merged PR.
People
- lukealonso: COLLABORATOR, 17 merged / 0 closed / 2 open in 180 days; ships fast (several merged the day they opened: #598, #596, #595, #593 on 2026-11-28/29); merged-PR concentration
helios/src(12) anddocs(10). No prior selene-manager pool change of this size. - yatesdr: owns the touched Selene areas (28 commits in
selene-manager/src, 32 inselene/src) and is the person whose four PRs duplicate most of this one. Also the maintainer who triaged and confirmed #439. - PCCessna: authored #496/#497, merged the same day, in the same offload path.
- shieldstar: filed #439 with the reproduction.
- Maintainers with commit rights in the touched directories: yatesdr (selene-manager, selene, helios) and Luke Alonso (helios, docs).
- Reviewers/engagers so far: none.
Community
pr_comments returns "No comments."; no reviews, no labels, no reactions. The only outside trace is issue #439's "Referred to by #607" backlink created by the Fixes #439 line. Two other PRs by the same author are open the same day (#608, #613). Zero expressed interest — notably including no response from yatesdr, whose four same-day PRs fix the same defects.
Project fit
Aligned:
- Charter goal, verbatim: "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene." Every item is inside that goal.
- "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs." One of six items cites a reproducible bug and a maintainer-confirmed report (#439); the other five are self-identified.
- "PR descriptions: Expect four parts: why the change is needed, what changed, the claimed result, and the evidence backing it." #607 has all four and is unusually thorough.
- The author is a named priority contributor ("Priority contributors (
@voipmonitor,@original-el8,@lukealonso) carry extra weight—we never close their PRs out of hand as 'low value.'"). - Non-goals do not apply: no model branches, backends, or orchestration.
Tensions (facts, not verdicts):
- "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)." Two fixes are skips rather than root-cause repairs: the claims.rs guard skips the whole validation+release path for channel claims, and
Index::expiredscans past the leaf instead of advancing the tick intouch_ancestors, which is what #439's title names. #610 makes the same second choice. - "Supported matrix & compatibility: Check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target named in the docs." The multi-process/DMA items are exactly those interactions, and only CPU unit tests were run.
- "the smallest footprint in shared code": eight of eleven fixes are 1–5 lines, but
store_bridge.rsis +477/−24 (~410 test lines).
Claims and evidence
Backed by the repo (verified at pr/607):
- All eleven named regression tests exist with the exact names given:
window_released_from_channel_requester_does_not_drop_extent(claims.rs:3022),entry_from_rejects_self_parent_and_non_monotonic_parent(mod.rs:299),walk_chain_rejects_self_parent_cycles_and_zero_page_chains_beyond_max_nodes(index.rs:403),put_and_get_with_same_client_id_use_disjoint_store_transfers(store_bridge.rs:1740),linked_multi_process_put_stores_record_relative_window_first_page(store_bridge.rs:1860),failed_channel_send_releases_staging_slot_once(agent.rs:1856),withdraw_queued_waits_for_peer_dma_before_releasing_window(engine/tests.rs:2122),async_cpu_codec_refill_wakes_deferred_child(memory.rs:6260),corrupt_ancestor_v3_page_is_quarantined_and_replaceable(composite.rs:6000),expired_sweep_skips_leaf_refreshed_without_new_tick(shared/index.rs:1392),worker_park_clears_stale_pool_plan_and_lookup(phase_tests.rs:6851). - Every line-level claim in "What exactly changed" matches the diff, and CI on the head commit passed.
- The best test is the Helios one: a real admission drive (
pooled: true, lookup grace expiry,admit(),budget_pass) asserting the re-plannedPrefixHistoryis 4 tokens and the abandoned ticket was withdrawn.
Claimed but not checkable here (author's own logs): 11/11 targeted, selene 510 passed, selene-manager 185 --lib plus 11 integration binaries, --test client 84/85, helios server::runtime 133 passed / 1 ignored, verification/helios-lifecycle/check.py (not opened) exit 0. The single client failure (a_record_put_into_a_manager_on_another_host_is_restored_over_tcp, "stream: 2 windows") is declared pre-existing/flaky against the 10 ms Core::tick() refresh and reported as passing 1/5 isolated reruns; no issue is filed for it.
Gaps a decider should weigh:
- No live/hardware validation at all, while the code under change is peer-DMA/RDMA/multi-process. The competing #609–#612 report SM120 (cn5) and GB10 (cn6–cn9)
flare run+ selene-manager qualification, bit-exactpos0parity, zero leaked pins, zero quarantined bytes; #609's own description argues this bug class needs DMA-level validation. - No reproduction case for the "100% CPU hang" or the "cross-tenant KV leak" beyond the unit tests, and no issue number for either.
put_and_get_with_same_client_id_use_disjoint_store_transfersbuilds the claim throughClaim::new_for_testand a seededManagerGet { transfer: 0, .. }rather than drivingclaim_begin, so the concurrency scenario is simulated at theput_begin+manager_getboundary — though it does assert the real invariant (the two allocated ids differ, andput_cancelcancels only the put's).linked_multi_process_put_...builds aPutRecby hand withaccepted: Noneand feedsPutAnswer::Accept/Grant, so it exercisesput_answer,put_pass_doneandput_commitbut notput_beginor wire framing.- Declared limitations:
flare/Cargo.toml (not opened) --lockedfailed on an upstream lockfile mismatch (deepseek-recipe;flare/andflare-cli/untouched by this PR); Helios chat-template tests needingFLARE_TEST_TEMPLATE_DIRandFLARE_RUN_CUDA_TESTS=1were not run.
Reach
- Operators: only those enabling prefix expiry (
--prefix-cache-max-age/ manager--max-age) see the #439 change — more leaves swept per pass, and the sweep now scans the whole tick order (result still capped at 64). Everything else is a fix with no knob. - Multi-process / TP>1 clients:
withdraw_queuedno longer releases a window while a peer is still DMAing (released later byon_peer_done; the description does not say which path guarantees release if a peer never reports done), andPutWin.first_pagechanges wheremp.wholestarts — linked multi-process puts that previously failed commit should now succeed. - Trust boundary (selene-manager gRPC): one change starts rejecting announcements that were previously stored (
entry_from), another stops rejecting malformedWindowReleasedfor channel claims. Both matter to anyone versioning or fuzzing clients. - Helios servers: an extra pool lookup per park, plus a scheduler-state change (
blockedcleared unconditionally on re-admission). - Docs:
docs/prefix-cache-offload.md:623-631— a limitation sentence is deleted (accurate after the fix, but a limitation removal, not a wording change); the documented cadence and expiry-off default are unchanged. - Compatibility: no wire/proto, config, default, dependency, on-disk format or public API change.
selene/src/testing.rsgains a test-support helper only.
Process
Draft? No — ready for review. Age: opened and last updated 2026-11-29 (same day as this case file). CI: passed on head 4f12cae. Review state: none requested, none given, no labels, no comments. Size: 16 files, +1211/−41. The merge decision is entangled with #609/#610/#612, all proposed by the maintainer who owns these files and all opened the same day.
Open questions / not found
- Which of #607 and #609/#610/#612 is intended to land? Nothing in any of the five descriptions or in the issue thread says. Merging order determines whether #607's overlapping hunks are redundant or conflicting.
- Is the released-on-transient-error quarantine intended, or should
disk_readquarantine only on genuine corruption (i.e. not on open failures)? No comment or test covers a transient-error case. - Is reducing
WindowReleasedvalidation for channel claims acceptable defence-in-depth, given the message arrives over untrusted gRPC? - Which path releases a window if a peer never reports done after the
withdraw_queuedchange? Not stated, and no test covers a never-done peer. - Whether a re-offered fresh leaf can hold a sweep back beyond one max age (yatesdr's open question on #439) — not answered here, though the new
filterremoves the stop-early mechanism. - No live-hardware, multi-host or RDMA evidence; no reproduction artifacts for five of the six defects.