Case file: PR #611 — fix(selene): fix pool client event-loop starvation, fencing, backpressure, and overflow bugs
Author yatesdr (COLLABORATOR, Discord "D-Rock"), branch fix/selene-pool-client-reliability → main, head aac8f4f, 12 files, +260/−43. Opened 2026-11-29 17:08, merged 17:32 (24 minutes later) as commit 8d05b9b6. 0 comments, 0 reviews, 0 reactions; CI listed as pending on the head commit.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/611
Key findings
- No review and no automated case file, merged with CI pending. #611's discussion is empty (
pr_comments: "No comments";read_item611: "Discussion (0)"). Its three same-day siblings #607, #609 and #612 each carry a flare-autobot "case file opened / Ready To Merge" comment; #611 is the only one of the quartet with neither human nor bot review. It was merged 24 minutes after opening while the orientation packet still records CI as "pending" on the head commit. - The description does not match the diff in several places. (a) "hold partial-open
TP >= 3export pins until opened peers reportDone" — the code contains no TP count or>= 3test; the branch fires wheneverself.ranks.is_some()andopen_export_peersfailed after some peers opened (selene/src/pool/engine/source.rs:322-349). (b) "verifymax_window_byteson reconnect innet_staging" — the comparison is againstnet_shape().1 = max(max_window_bytes, page_record_bytes, row_record_bytes)(engine/netio.rs:41-48, 63-71), wider than the stated field. (c) It lists two new tests; three exist —staging_slots_saturates_instead_of_overflowing(selene/src/shared/limits.rs:129-140) is unlisted. (d) "Engine::pump_flowdid not draincollect_outbound_fills()" —pump_flowis introduced by this PR; the pre-existing method ispump(engine/mod.rs:586-603). - Undeclared behaviour changes. A new session-termination condition: if
drain_outkeeps returningFullfor more thanCLOSE_TIMEOUT(30 s,selene/src/copier.rs:18(not opened)) the loop breaks (pool/conn.rs:848-853) — a deliberate give-up not mentioned in the backpressure bullet.Announcer::spillednow also pushesNotice::Evicted { key, tier: from, heir: None }whenfromwas removed buttocould not be added at capacity (pool/announce.rs:139-158) — the description mentions only the reordering. Leftoverpending_outis re-emitted throughengine.emiton session exit (conn.rs:919-925), the unstated second half of the fence-preservation fix. - Evidence is pooled, not per-PR. The "Combined 4-PR validation & SM120/SM121 hardware qualification" paragraph (cn5 SM120 pool retirement/restore; cn6–cn9 GB10 cross-host TCP, 300–400 stream windows, "0 disconnects, 0 leaked pins, 0 quarantined bytes, bit-exact pos0 parity") is byte-identical in #609 and #611, and the description itself says hardware ran against the combined stack before rebasing onto #496/#497/#607. CPU tests were re-run after rebasing to
5df8edd3c(claimed 542/542 with--features codec;RUSTFLAGS="-D warnings" cargo check --all-targets --features codec,rdmaclean for selene and selene-manager). - Test coverage is thin relative to the fix count. Of nine fix clusters, only the put/fence state machine and
session_lostpreservation have new tests (engine/tests.rs:1592-1648). No tests for therun_sessionrewrite /drain_out/tx.reserve()backpressure /next_tick, IPv6 trim,Staging::planned_bytes/newoverflow, thenet_stagingreconnect check,wind_downtimeout,quarantineclearing,spilledordering,pool_peerempty-rendezvous guard,refused_on_open, or theCopyChecksumclassification. - No linked issue or reproduction. #611 refers only to pull requests (#496, #497, #607) as rebase bases. The defects are asserted reachable ("could stall, drop required fence acknowledgments, livelock…"), not observed. The nearest precedent for a tracked pool-client degradation is #335 ("Prefix-cache pool and scheduler fixes from a production degradation (DeepSeek V4.1 TP4)", closed 2026-11-19), which spawned #344/#345/#365 — #611 attaches to nothing of the kind.
The change (what it does, in plain terms)
Nine independent micro-fixes inside the pool client, no wire/protocol change (selene.proto (not opened) untouched, no Cargo or docs change):
- Session loop rewrite (
pool/conn.rs:836-949, replaces the oldflush()+ freshsleep(tick)per select iteration): a persistentnext_tickdeadline, apending_outVecDeque,drain_out()returningDrained/Full/Closed, and atx.reserve()select arm guarded byneed_permit = !pending_out.is_empty() || tx.capacity() <= 64(conn.rs:882, 897-905).flow_indexis paused whilecan_flow = pending_out.is_empty() && tx.capacity() > 64(conn.rs:871-873). - Engine pump split (
engine/mod.rs:586-603):pump(now)delegates topump_flow(now, true);pump_flowcallscollect_net,collect_ranks,collect_outbound_fills(),poll_jobs,submit_pending, then optionallyflow_index. Withflow_index == falseit returnsmore = falsebut still drains fills and jobs. - Session recovery (
engine/mod.rs:340-349):session_lostno longer clearsoutblindly; it re-queues onlyFenceAck/ExportEnd/WindowReleasedintoself.owed, matching the pre-existingemitrule (mod.rs:243-260) replayed bysession_opened(mod.rs:309-311). Verified in code at PR head. - Put accept state machine (
engine/writer.rs:315-347):Phase::Acceptedset immediately after theBeguncheck (line 334); unknownput_idemitsOut::PutCancel+FenceAck(Drained)(lines 317-327);accept.packed && put.packed_offer.is_none()fails the put (lines ~372-377). Note the unknown-id branch cannot distinguish a cancelled/timed-out put from a completed one — completed puts are removed fromwriter.putsindrive_put(writer.rs:709), so a duplicate accept for a committed put also producesPutCancel+FenceAck(Drained). - Partial-open export pins (
engine/source.rs:322-349): onopen_export_peerserror with already-opened peers, keep the runPhase::Pinned, setcancelled/refused_on_open(source.rs:54-56, 148), sodrive_exportsuppresses the secondExportEnd(source.rs:783-799). - Packed checksum classification (
engine/requester.rs:883-895): a failed restore whose errorcarried()acrate::shared::packed::Checksumis reported aswire::CopyOutcome::CopyChecksuminstead ofCopyErrorOutcome(the otherCopyChecksumsite, window verification, is pre-existing at line 598). - Overflow-safe sizing:
Staging::planned_bytesuseschecked_next_multiple_of+checked_mul, returningu64::MAXon overflow (pool/net.rs:73-78);Staging::newreturns errors instead of wrapping (net.rs:88-94);limits::staging_slotsuses saturating add/mul (shared/limits.rs:121-127). This matters becauselimits::validateonly rejects zero limits, never upper bounds (limits.rs:98-119). - Reconnect window check (
engine/netio.rs:40-50): an existing staging region withslot_bytes() < required_bytesis an error ("the manager's window size (…) exceeds registered staging (…)"). Verified. It compares slot bytes only —let (_, required_bytes)discards the slot count — so a manager that increaseswindow_credits/max_open_putsacross a reconnect is not caught; and same-host shared-memory attachments bypassnet_stagingentirely (conn.rs:629-635,Attachment::Shmarm). Failure is soft:attachprints "warning: cannot use the pool's data channel (…); restores and puts are off" (conn.rs:620-626), leaving the instance on local tiers. - Lifecycle/address fixes:
dialtrims[/]from the host so IPv6 literals parse (conn.rs:574-578);RankAgent::wind_downwraps the Goodbye send in a 2 stokio::time::timeout(agent.rs:486-501);quarantineclearsself.jobs/self.pending(agent.rs:1711-1717, stillmem::forgets regions afterwards);Announcer::spilledremovesfrombeforeupsert(to)(announce.rs:139-158);pool_peerguards an empty rendezvous list (peers.rs:196-199).
The why
- No issue, no reproduction, no operator report is cited. The frame is "under active traffic, disconnects, or untrusted manager metadata … could stall, drop required fence acknowledgments, livelock on resync, or overflow staging calculations" — conditional risk language, not an observed incident.
- The starvation claim has two interacting halves that the description states but doesn't spell out:
tick() → source_tick()already calledcollect_outbound_fills()(source.rs:804-805, unchanged by this PR), so fills were serviced only after a tick; the tick itself was starved becausetokio::select!rebuiltsleep(tick)each iteration (old code replaced atconn.rs:836-949). - Prior public record of pool-client reliability work: #335 (production degradation, closed 2026-11-19; pool-client items #344, #345, #365). #611 does not join that lineage.
Related work
- Stacked on #607 (lukealonso, merged 17:17, 15 min earlier). #611 says it was rebased onto post-#607 main
5df8edd3c. #607 touched the same pool-client files —pool/agent.rs,engine/requester.rs,engine/tests.rs,pool/net.rs(plusmemory.rs(not opened),composite.rs(not opened),shared/index.rs(not opened)) — and #607's autobot review records that "#609, #610, #611, #612 by yatesdr are already rebased onto #607 (overlapping hunks removed, #607 referenced explicitly)". Luke Alonso's edits in agent.rs/requester.rs (not opened) are in different functions (window_drained/forget_window,withdraw_queued), so no line conflict. - Sibling quartet, all yatesdr, all opened 17:08 on 2026-11-29, all merged by 17:32: #609 (DMA/RDMA/quarantine lifetimes, +225/−71; also touches
pool/conn.rsandengine/mod.rs), #610 (local storage tier/input cache/sharding/codec), #611, #612 (selene-manager hardening — the manager-side half of the same protocol, so operators get both halves only together). - Code whose semantics #611 changes: #504 (packed KV compression) introduced the packed put path now guarded by the
accept.packedrejection; #524 (mixed-chain retirement, packed errors) introduced the classificationrequester.rs:883-895extends withCopyChecksum; #413/#415/#429 shaped the linked-put/accept logic inwriter.rs; #142 (window credits) and #92 (created the pool client:conn.rs,engine/mod.rs,announce.rs) are the origin of thestaging_slots/window_creditsbounds now made saturating. - Pre-existing tests the change must not regress:
engine/tests.rsheld 50+ pool engine tests includinglosing_the_session_mid_copy_drains_before_failing_and_owes_the_fence_to_the_next_session(tests.rs:1064),a_late_grant_is_never_used_and_its_terminal_is_fenced_at_once(tests.rs:938) andput_accept_below_homogeneous_suffix_boundary_cancels_as_permanent_refusal(tests.rs:2136) — the last directly adjacent to the newPhase::Acceptedtransition. - No competing, superseding or reversing item found. Searches for pool-client starvation, backpressure, FenceAck wedging and IPv6 pool dialing returned nothing but #611 itself. #611 is already on main as
8d05b9b6.
Recent activity
selene/src/pool in the last six months is almost entirely yatesdr (36 of 43 commits in selene/src; Luke Alonso 5, Martin Vit 2). Merge order on 2026-11-29: 5df8edd3 (#607) → e2522eb0 (#609) → a56333a0 (#610) → 8d05b9b6 (#611), within ~35 minutes. Earlier: 2026-11-25 #524/#504 (the packed paths hardened here); 2026-11-18 the #335 cluster, including #365 (register memory off the I/O thread) which introduced the registration window feeding Staging::planned_bytes; 2026-11-02 #140/#142 (multi-host TP prefix pools, opt-in RoCE); 2026-10-28 #92 created the pool client. #611 builds on this work and reverses none of it — the session_lost change makes that function consistent with the existing emit fence-class rule rather than inventing a new one.
People
- yatesdr — COLLABORATOR; 79 merged, 9 closed, 4 open PRs/issues in 180 days; touched helios/src (34), docs (33), selene/src (32), selene-manager/src (25), selene-manager/tests (20). Effectively the owner of the Selene pool client and manager. Not one of the charter's named priority contributors (
@voipmonitor,@original-el8,@lukealonso), so the charter's "extra weight" clause does not cover him. - Luke Alonso — the only other regular in
selene/src(5 commits); his #607 is this PR's direct base. PCCessna — disk-offload side (#496/#497), named by #611 only as rebase targets. - Who engaged: nobody. No reviewers, no human comments, no reactions. The only external pointer is the shared "Discord: D-Rock" line. Pattern: four PRs from one author merged within 35 minutes, none human-reviewed.
Community
Zero visible interest: 0 comments, 0 reviews, 0 inline comments, 0 reactions; no autobot case file (contrast #607 with two bot comments, #609/#612 with case files). Merged 24 minutes after opening, before CI reported.
Project fit
- Aligned. The charter goal "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene" (charter line 24) is exactly the subsystem
selene/src/pool/hardens. No new flag, config knob, dependency, or protocol/API change — consistent with "smallest footprint" and "keep the runtime small and model-agnostic". It strays into none of the non-goals (rack-scale disaggregation, CPU backends, orchestration). - Description contract. The charter asks for four parts (why / what changed / claimed result / evidence); #611 has all four headings plus an explicit "Material limitations" line — formally met.
- Evidence standard. The charter's "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)" fits the per-mechanism nature of these fixes; the weakness is attribution, not mechanism — pooled hardware evidence and no reproduction.
- Docs.
docs/prefix-cache-offload.mdis the area's design doc (pool client at lines 29, 1515-1517; pool protocol/flags at 1168). #611 changes no docs, unlike #607 which updated that file for itsIndex::expiredchange. Two behaviour changes arguably touch documented semantics and are unrecorded: the reconnect data-channel failure when staging is too small (netio.rs:40-50) and the newEvicted{heir:None}notice (announce.rs:149-155).
Claims and evidence
| Claim | Backing | Gap |
|---|---|---|
cargo check --all-targets --features codec,rdma (selene + selene-manager) clean under -D warnings |
author statement | not independently reproduced here; CI pending at merge |
cargo test --release --features codec --lib → 542/542 |
author statement | counts the whole lib suite, not per-fix coverage |
| Event-loop no longer starves fills/ticks | code change verified (conn.rs:836-949, mod.rs:592-603) |
no test exercises it |
| Fence acks never dropped across session loss / late accepts | code verified (mod.rs:340-349, writer.rs:317-334) + 2 tests (tests.rs:1592-1648) |
— |
| Backpressure instead of disconnect | code verified (conn.rs:882, 897-905) |
no test; new 30 s give-up unmentioned |
| Overflow-safe staging limits | code verified (net.rs:73-94, limits.rs:121-140) + 1 test |
test unlisted in description |
| "0 disconnects, 0 leaked pins, 0 quarantined bytes, bit-exact pos0 parity" on SM120/GB10 | author statement, pooled across 4 PRs | description itself disclaims per-PR attribution; pre-rebase stack |
Reach
- Users/operators: instances run with
--prefix-cache-pool ADDRESSagainstselene-manager(docs/prefix-cache-offload.md:1168, 1515-1517). Observable: far fewer session drops under outbound pressure (previously the first full send on the 4096-slot channel broke the session —OUTBOUND = 4096,conn.rs:58), no lost fence acknowledgments (manager no longer waits on a fence that never arrives), IPv6-literal data-channel addresses now dial. - Config/defaults: unchanged.
staging_slots/planned_bytes/Staging::newproduce identical values for all sane limits (MAX_OPEN_PUTS=4,WINDOW_CREDITS=2,MAX_WINDOW_BYTES=4 MiB,limits.rs:11-20); only hostile metadata behaves differently. - Compatibility: no wire/proto, Cargo, or on-disk change; old and new
selene/selene-managerinteroperate. - Regressions to watch:
quarantinenow clearsjobs/pending(agent.rs:1711-1717) — fine, since a quarantined agent is already terminal (agent.rs:1741-1743), but it stops polling those jobs;wind_down's 2 s timeout bounds a shutdown that could previously hang, at the cost of possibly dropping the Goodbye frame; thenet_stagingreconnect error silently downgrades the instance to local tiers only (conn.rs:620-626). - Docs/deployment: nothing to update per the diff; the two undocumented behaviour changes above are the documentation debt.
Process
Draft/ready state: not marked draft; merged. CI: pending on head aac8f4f at the time it merged. Review: none. Autobot case file: none (the only such PR of the four). Age: opened and merged the same day, 2026-11-29, 24 minutes apart.
Open questions / not found
- No issue, reproduction, log, or operator report for any of the nine defects; whether they were seen in production or found by inspection is unrecorded.
- No per-PR hardware attribution; which of the four PRs the SM120/GB10 results actually exercise is not separable from the description.
- The pre-#611
flush()semantics were not reconstructed line-by-line from the parent commit (the claim that the first full send tore the session down rests on the description plus the newOUTBOUND = 4096/stalled_sincecode). - Whether the absence of an autobot case file for #611 (while #607/#609/#612 had one) is a tooling gap or intentional could not be determined.
- No maintainer other than the author has commented on, reviewed, or reverted any of the same-day four; nothing open currently reverses #611.