Recommendation: Ready To Merge
All three empirical GB10 blockers from the 2026-11-29 review (cb3db468)—the per-poll() v4 packed Layout hashing / eager demand rebuild stall, the DiskStore::inbound_rate disk-read-only pricing regression, and tight-pool private-tail bypass—are cleanly fixed at ba1c73fd with zero new correctness, concurrency, or safety defects found across the full coalesce.rs state machine and disk_store.rs diff. The Staged-layer boundary is signed off by @yatesdr, selene/src/shard.rs (not opened) is back to a zero-byte diff, and unit coverage now exercises v4 packed decode-delay pricing, local-TCP Sharded + Peer coalescing, and tight 2 * (64 + row_slots) pool holdback. Before pressing merge, run the requested live GB10 serving check at ba1c73fd (including --lossless-kv-compression cpu|gpu) and rebase onto companion PR #497 if #497 merges first.
Merge Risk
Level: Medium
- Replaces
Staged's device-inbound restore path (selene/src/disk_store.rs) with a 1,416-lineDeviceCoalescerstate machine (selene/src/disk_store/coalesce.rs) coordinating shared file handles,SlabPoolstaging windows, and v4 packedArc<Vec<u8>>payload buffers across concurrent fetches and asyncCopieruploads. - Live SM121/GB10 serving at
ba1c73fd—and specifically--lossless-kv-compression cpu|gpulive serving—has not yet been re-run (the served A/B numbers in the description remain from0c04b1e2against pre-v4mainc0c4f798), and companion PR#497modifiesStaged::pump_allinselene/src/disk_store.rs(coordinated merge order:#497first, then rebase#496). - Risk is well-contained:
coalesce.rsintroduces zerounsafeblocks, leaves record formats, wire protocols,TransportEventvariants,FetchSegment, andselene/src/shard.rs(not opened) unchanged, isolates private/transient failures from sharedrecord_readfailures, leaks referenced packed buffers iftransfers.close()times out (disk_store.rs:2006-2008,coalesce.rs:313-319), and waits fordisk_settled()on the last segment user before emittingFetched.
Walkthrough
selene/src/disk_store/coalesce.rs(new, +1,416): ImplementsDeviceCoalescerwithHeaderIdentity(cachedu64digest viaDefaultHasher::new()+Arc::ptr_eqfast path),SegmentKeyinterning inacquire_shared_segment,WindowKeyO(1) lookup viawindow_index, lazybuild_pending_demand(skipped whendevice_inbound.len() <= 1or when no fetch has window credit), tight-pool holdback inpick_next_pending_plan(reachable_free = free + staged_slots + outbound_slots), shared-vs-private failure isolation, and 9 focused passes inDeviceCoalescer::pump.selene/src/disk_store.rs(+337/−288): NarrowsInboundRecordto privateHostInbound(HostDestination::{Slots, Packed}) for caller-ownedread_into/read_into_packed, delegatesStaged::fetchtoDeviceCoalescerwithplan_windows(..., true)file-boundary alignment, removes all out-of-bandInboundWindowSampleplumbing, and restores end-to-endDiskStore::inbound_rate(logical_bytes = layout.record_bytes(chain.pages)over full fetch wall time) with arode_preexistingdownward-only observation guard (disk_store.rs:3242-3251, 3422-3455).selene/src/shared/packed.rs(+44) &selene/src/shared/record.rs(+119/−1): ImplementEqand exhaustiveHashonpacked::Layout(coveringPackedOffer,PackedUnit,offsets,pages) andHeader(matchingPartialEq, omitting encodingversion), deriveHashonRankSizes, and addheader_eq_implies_same_hashcovering v4 packed headers.selene/src/disk_store/coalesce/tests.rs(new, +3,217): Adds 19 targeted tests coveringHeaderIdentitycaching and full-creditpoll()CPU cost across TP1/TP8 512–1024-page packed headers, aligned/misaligned coalescing, private-vs-shared failure isolation, end-to-endinbound_rate(v4 packed decode delay,Shardedmulti-rank wall time, overlapping stream slowdown/recovery, leader-failure slow follower), local-TCPSharded+Peercoalescing, tight2 * (64 + row_slots)pool holdback and deadlock freedom, and 4-way v4 packed coalescing.docs/prefix-cache-offload.md(+48/−2): Updates §2.4 (:418-449) with current host/device signatures,WINDOW_PAGESalignment, index-pin/close-before-Fetchedinvariant, tight-pool holdback, and failure/coalescing limits, and §4 (:1613-1627) with end-to-endDiskStore::inbound_rate,rode_preexistingdownward-only observation, per-fetchbytes_in, andCompositeStore::disk_inbound_rate.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt injection, external network exfiltration, or unsafe code introduced (
coalesce.rshas zerounsafeblocks; all changed files inspected). - [PASS] Charter & value fit: Directly removes redundant NVMe opens/reads/checksums on concurrent shared-prefix restores in the right layer (
Staged, signed off by@yatesdr) with no model-specific branches, flags, or format/wire changes. - [WARN] Related / duplicate / conflict check: No duplicate PR; cleanly preserves merged
#504/#523/#524v4 packed paths, but companion PR#497(ca863852) also editsStaged::pump_allinselene/src/disk_store.rs—merge#497first and rebase#496soMAINTENANCE_DEFER_LIMIT = 8and restore-first ordering are preserved. - [WARN] Tests & verification evidence: Unit/TCP
Shardedsuite (522selene lib +1mixed_codec_root,85 + 2selene-manager,helioscheck,22pytest) and full-creditpoll()microbenchmark (0.25–0.75 µs) are fresh atba1c73fd, but live SM121/GB10 serving validation atba1c73fd—including--lossless-kv-compression cpu|gpurequested in@yatesdr's review—is not yet run (disclosed in Not covered).
Blockers
None.
Should Fix
- Complete live GB10 serving validation at
ba1c73fd(including--lossless-kv-compression cpu|gpu) before merge. The PR's servedflare runA/B numbers are explicitly scoped to0c04b1e2against pre-v4main(c0c4f798,--lossless-kv-compression off), leaving the rewritten v4 packed coalescing path unit-tested only. Re-run a served GB10 A/B atba1c73fd(at least one--lossless-kv-compression offrepeat and one--lossless-kv-compression gpuorcpurun, as requested in@yatesdr's 2026-11-29 review and offered in his follow-up) and refresh the Result table before merging.
Subtract / Simplify
- Delete dead field
SharedWindow::error(selene/src/disk_store/coalesce.rs:166, 451, 469, 942).win.erroris written infail_segment_users(:451, result discarded) and infail_window(:469, immediately cloned back out) and is never read anywhere else. First-error-wins semantics are already enforced per follower byDeviceInbound::fail(:251-253,self.error.get_or_insert(error)), and failed windows are immediately markedSharedWindowPhase::Failedand unindexed (:450, 452, 467-468), so no new follower can attach afterward. Remove the field,:942, and:451, and passerrordirectly infail_window(:469). - Collapse the three copies of packed window byte-range math into
packed::Layout::window_range(selene/src/shared/packed.rs:297-308).selene/src/disk_store/coalesce.rs:988-999duplicates the exact(start_rel, end_rel)calculation fromselene/src/disk_store.rs:1342-1354(HostInbound::submit_reads) andselene/src/pool/pins.rs:338-351(PinnedRecord::read_packed). AddingLayout::window_range(&self, first: usize, count: usize, row: bool) -> Range<u64>besidepage_offset/physical_bytes/unitskeeps all three callers in sync. - Factor out
SharedSegment::readable(&self) -> bool(selene/src/disk_store/coalesce.rs:122-128, 574-580, 1133-1137). The identicalseg.open_error.is_none() && matches!(seg.state, SharedFileState::Opening | SharedFileState::Opened)predicate is inlined at:575-579and:1134-1135, whilereusable()at:122-128addsUnopened. Areadable(&self) -> boolmethod (withreusable()delegating toself.open_error.is_none() && (self.state == SharedFileState::Unopened || self.readable())) keeps the state predicate in one place.
Nits
- Tighten or also assert the demand-pass latency bound (
selene/src/disk_store/coalesce/tests.rs:583-602).assert_eq!(staged.demand_builds(), builds_before)(:570-574) already deterministically guards against eager demand rebuilds, whilemean_us < 200.0(:584) is ~250× above measured release latency (0.25–0.75 µs) andcredit_us(:595-602, which exercisesWindowKey/HeaderIdentityhashing during an actual demand pass) is only printed viaeprintln!. Adding an upper-bound assertion oncredit_us(e.g., debug-safe< 5_000.0or#[cfg(not(debug_assertions))]< 500.0) would guard against an uncached-hash regression during demand builds as well.
Dropped on verification
- Dropped F1 (
CompositeStore::disk_inbound_ratedoc mismatch atdocs/prefix-cache-offload.md:1625-1627): Verified false againstselene/src/composite.rs:345-378, 954, 1024-1026, 1059-1068.CompositeStoreis a two-stage restore:disk_inbound_ratemeasures end-to-end wall time ofread_into/read_into_packedcompletions (firststart_readuntilinbound.reads == 0), andCompositeStore::hit()separately prices codec decode + GPU upload via+ bytes as f64 / memory_rate(:374-375). The doc sentence accurately scopesdisk_inbound_ratetoread_intoandread_into_packedcompletions, and the pre-existingdisk_bytes/stats.inbound_ratebehaviour incomposite.rsis untouched by this PR. - Dropped S4 (
segment_indexmap + removingSegmentKeyreturn fromacquire_shared_segmentatcoalesce.rs:340-358, 412): Verified harmful. Returning(seg_id, seg.key.clone())interns the first fetch'sArc<Path>andArc<Header>into every follower'sDeviceSegmentRef(:412-417) soHeaderIdentity::eq'sArc::ptr_eq(&self.header, &other.header)fast path (:64) hits in O(1) acrosswindow_indexanddemandlookups (especially critical onPeerranks that deserialize freshHeaders over TCP). Removing that interning would re-introduce deepPackedUnitcomparisons, while adding asegment_indexmap adds state-transition bookkeeping acrossClosing/Closed/open_errorfor a small once-per-segment lookup atstart_fetch. - Dropped S5 (
note_window_read(&mut win.disk_read_counted)helper across 6 sites): Verified uncompilable as proposed whentest-supportis disabled becausedisk_read_counteditself is gated under#[cfg(any(test, feature = "test-support"))](coalesce.rs:169-170,disk_store.rs:1109-1110); low-signal test-instrumentation duplication. - Dropped S6 (simplifying
Staged::closeabandoned_jobsatdisk_store.rs:1983-1994tooutbound + host_inbound + device + owners): Verified buggy.self.ownersstores entries forOutbound,HostInbound,SharedSegment,Truncate, andUnlink(disk_store.rs:1604, 1643, 1731, 1938, 1955), so summingself.owners.len()with the pipeline maps double-counts active jobs. The PR's separation ofmaintenance_jobsavoids double-counting while keeping.max(self.owners.len()).max(self.maintenance.len())as a defensive floor. - Dropped unverified
Design-Signed-Off-Bycommit-trailer finding: Commit message bodies are not inspectable via the available history tool (subject lines only), and inferring trailer absence solely from the preserved2026-11-26author date is speculative.