PR #496 — "Coalesce shared ancestor reads across concurrent Selene disk fetches"
Head reviewed: 0c04b1e2 (no new commits since the previous round) · Base: main c0c4f798
Files: 3 — selene/src/disk_store.rs (+3313/−931), selene/src/shard.rs (+10/−0), docs/prefix-cache-offload.md (+35/−2) = +3358/−933
Case file: https://autobot.eidonix.com/api/v1/cases/774e16ea-5f84-4ff8-9166-74ab6876cc37.html
Verdict: Ready to Merge; no blockers. 5 should-fix, 10 nits.
Key findings
- The change belongs in the repository and in the layer it chose. It fixes a measured performance problem on a served workload, which is what the charter's merge criteria require (charter line 35, "a measured performance/memory issue"; AGENTS.md:165-166 (not opened)), inside the subsystem the charter names (line 24: share prefix-cache checkpoints across Flare instances via Selene). No rejection criterion is crossed: no CPU/non-NVIDIA path, no interchangeable backend, no training, no routing, no orchestration, no per-model branch (coalescing keys on
SegmentKey/WindowKey, not model identity), no new flag, env var or recipe knob, noHeader/on-disk format change, no wireKindchange. - Every blocker and should-fix from earlier rounds is resolved at this head (list below). The previous post on this PR said "Changes Requested" at this same head; on re-weighing, none of the surviving items can make a released build wrong, so none is treated as a merge gate here.
- Five should-fix items remain, all refinements to code and prose already written: a rank-local rate sample riding the cross-rank completion enum (which also re-arms composite maintenance once per physical window), a hand-written
Hashthat must track an equality in another module, an admission guard that restatesLayout::record_slots, one over-packed docs paragraph that states the metrics contract twice, and one recorded-maintainer-decision ask. - Ten nits, none behavioural on the success path.
- The mechanism itself checks out: slot/file lifetimes, failure isolation, the unshared host path, the single-restore fast path and the tests were all verified sound (see "Checked and sound").
Blockers
None. All five lenses (architecture, conventions, simplicity, correctness, prose) report no blocker at this head, and the subtractive lens found nothing left dead behind the change. Correctness explicitly re-verified that its three previous defects (physical-vs-logical accounting, the close count, misaligned-follower coverage) are fixed and found nothing new.
Should fix
S1. Take the rank-local rate sample off the cross-rank completion enum, and stop it amplifying the composite's maintenance cadence
Finding. TransportEvent documents itself as "Completion the transport reports to the disk store" (selene/src/disk_store.rs:83), and five of its six variants are job completions carrying a super::JobId (Stored :86-90, StoreInvalidated :92, Fetched :93-96, Truncated :102-105, Unlinked :106-109). The new sixth does not:
97 /// One shared staging window's physical disk read completed.
98 InboundWindowSample {
99 bytes: u64,
100 elapsed: Duration,
101 },
Verified consequences:
Kind::ofis no longer total over its own input domain. Every arm returns(Kind, JobId, Result<u64>); this one cannot, so it panics —unreachable!("window rate samples stay local to rank zero")(selene/src/shard.rs:476-478). The function's own convention for an unrepresentable input is an error, not a panic.- A second
unreachable!()lives in the variant's own consumer:DiskStore::applymatches it first (disk_store.rs:3632-3635) and must then re-armTransportEvent::InboundWindowSample { .. } => unreachable!()(:3638) just to keep the match exhaustive. - The panic is upheld only by two distant hand-written guards that must stay in sync:
Sharded::absorb_localre-pushes the sample intoself.events(shard.rs:722-725) andPeer::forwarddrops it (shard.rs:1148-1150). A third consumer ofTransportEventadded later panics at runtime instead of failing to compile. - An existing test helper would break:
events.sort_by_key(|event| Kind::of(event).1)(selene/src/shard/tests.rs:339(not opened)) survives only because those tests issuestore_empty/unlink/truncateand never a fetch. - Concrete cost in serving:
CompositeStore::pollincrementsself.stats.progress += 1for every transport event before dispatch (selene/src/composite.rs:1376), and that counter gates maintenance —if !self.disk.preserve_committed && (self.maintenance_progress != progress || retry)(:1420) →self.spill_parked(...)(:1427) +self.disk.maintain()(:1428). So each completed physical 64-page window read now re-arms a spill and a maintenance pass, once per window per restore — the opposite of the hot-path relief this PR is after.StoreStats.progressis documented as "Completion and capacity-release events" (selene/src/store.rs:202(not opened)); a bandwidth sample is neither, andDiskStore::applydeliberately does not count it, so the two stores' progress counters now advance at different rates for the same work.
Request. Carry the sample out of band. Three shapes, author's choice: a Staged drain method returning a byte/elapsed accumulator (the store already reads Staged state directly for in_flight() and pool()), a field on the existing Fetched event, or the crate's existing precedent for a rate signal that is not an event (Budget::progress(), selene/src/input.rs:146-152 (not opened)). Whichever is chosen, keep it out of CompositeStore's stats.progress so that counter means "completions". A test asserting Kind::of is total over every TransportEvent would settle the panic path permanently.
Why. This is the charter's "Solve the right problem in the right place" (line 9) and AGENTS.md:188-193 (not opened)'s rejection of unsupported abstractions. A rank-local measurement has been pushed through the cross-rank completion channel; the panic is the symptom, and the fix needs no new machinery. The mechanism is not in question — physical-rate observation, the removed per-record observe, and the two rank guards are all correct. This is only about where the signal is carried. It is also the one place the PR's "No core re-export or format change is required" is loose: TransportEvent is a public enum in a public module and gained a variant (see N10).
S2. Move HeaderIdentity's hand-written Hash next to the equality it tracks
Finding. HeaderIdentity(Arc<Header>) implements PartialEq by delegation (disk_store.rs:1006-1010), then hashes by hand: it destructures Header, hashes its fields one at a time, and closes the pattern with .. (:1014-1050, .. at :1030). The contract it must mirror lives in another module: impl PartialEq for Header (selene/src/shared/record.rs:136-152), with the private version field excluded there (:118-119) and correctly excluded here too.
Correction to an earlier claim of mine, stated plainly because it changes how the risk is described. A previous round of this review said a new Header field would "silently drop out of the hash and coalescing stops". That is the wrong direction:
HashMapsoundness requiresa == b ⇒ hash(a) == hash(b). Hashing fewer fields thaneqcompares keeps that implication true. The hash only becomes coarser: colliding entries still land in the same bucket and are still separated byeq. Cost: slowerwindow_indexlookups (disk_store.rs:1229,find_reusable_window:1646-1663), never wrong results.- The genuinely unsound direction is the reverse — a field in
hashbut not inPartialEq. Todayversionis excluded from both, correctly, so there is no present soundness bug. - What survives as real risk: the contract is split across two modules with no derive for the compiler to police and no test to catch divergence, and the
..rest makes any omission invisible in review.
The drift is already live, not hypothetical. On main, Header has grown pub packed: Option<Arc<packed::Layout>> (main's shared/record.rs:127) and PartialEq now compares it (main's :146). This branch predates it, so on rebase the hash covers strictly fewer fields than equality — exactly the coarser-hash case above. A real, already-scheduled maintenance hazard; not a correctness bug.
Request. Implement Hash for Header itself, beside the PartialEq it must track, in shared/record.rs (same field list, version still excluded), and let SegmentKey (:1052) and WindowKey (:1058) derive, which removes HeaderIdentity entirely. Minimum acceptable alternative if the wrapper stays: hash only self.0.key — Hash need only be consistent with Eq, PrefixKey already derives Hash (selene/src/vocab.rs:30 (not opened)), and a collision costs one bucket comparison. Either way, add the missing a == b ⇒ hash(a) == hash(b) property test.
Why. A hash whose field set must be hand-kept in step with an equality defined in another module, via a non-exhaustive pattern the compiler cannot check, is the duplicate representation docs/design-review.md:74 (not opened) asks a change to account for. It is also this crate's only hand-written Hash in selene/src; everything else derives (PrefixKey vocab.rs:30 (not opened), RankSizes record.rs:89, DiskRecord disk_store.rs:72, and this PR's own SegmentKey/WindowKey). Moving it beside PartialEq turns a silent future omission into a compile error.
S3. Call Layout::record_slots instead of restating it in the admission guard
Finding. pick_next_pending_plan predicts whether a plan fits in the free pool by recomputing the slot count by hand (disk_store.rs:1766-1777):
let free = self.resources.free_slots();
let layout_row_slots = self.resources.pool.as_ref()
.map(|_| lock(&self.resources.transfers).layout().row_slots())?;
...
let needed = plan.count + if plan.row { layout_row_slots } else { 0 };
Layout::record_slots(pages, row) is exactly this expression — pages + usize::from(row) * self.row_slots() (selene/src/geometry.rs:180-182, with row_slots() :173-178) — and it is what the allocator this guard is predicting already uses: Resources::allocate (disk_store.rs:245), plus memory.rs:468 and composite.rs:810/:1167. Secondary: lock(&self.resources.transfers) is taken once per call and sits outside the plan loop, so the transfers mutex is acquired for a loop-invariant value.
Request. let needed = lock(&self.resources.transfers).layout().record_slots(plan.count, plan.row);, hoisted beside free outside the loop. One line.
Why. A guard that predicts the allocator must use the allocator's own arithmetic. A change to record_slots (a future per-record fixed slot, a bucketed row share) would make the guard optimistic and turn a clean budget check into a pool-exhaustion failure path instead of a scheduling decision. The crate already has the helper; two formulas for one cost is the duplication AGENTS.md:188-193 (not opened) is about.
S4. Split the §2.4 bullet and state the metrics contract once
Finding. docs/prefix-cache-offload.md:337-366 is a single 30-line bullet carrying about a dozen independent behaviours: the write_from/read_into signatures (:337-339), the shared open handle and WINDOW_PAGES-aligned coalescing (:340-342), per-follower upload and slot lifetime (:343-345), read_into independence (:345-346), the immutability/pin and close-before-Fetched invariant (:346-350), sibling-demand preference that "relax[es] strict arrival-order scheduling across concurrent restores" (:350-354), the two sharing limits and the extra-partial-window bound (:354-358), shared-vs-private failure scope (:358-362), and the bytes_in/inbound_rate split (:362-366).
The content is accurate and complete — every earlier doc ask is met, the signatures match the code (:337-339 vs disk_store.rs:1308, :1334) and the limits are present. What remains is shape and duplication: the metrics contract is stated again almost verbatim in §4 at :1528-1531 ("On DiskStore, StoreStats.bytes_in counts logical checkpoint bytes restored to GPU destinations …, while StoreStats.inbound_rate measures physical staging-window disk reads …"), and §4 (:1520-1526) is where the measurement table lives, so §4 is its right home.
Request. Keep one paragraph of mechanism in §2.4 (shared handle; aligned WINDOW_PAGES fan-out to every attached upload; independent read_into), move the limits (pinning assumption, close ordering, re-read after release, extra partial window) into short bullets in the style the same section already uses at :333-336, keep failure scope as its own bullet, and state the bytes_in/inbound_rate contract only in §4 with a pointer from §2.4.
Why. This is the paragraph a future reader will trust to learn the transport's contract; a run-on makes a correctness invariant, a scheduling heuristic and a metric look like one mechanism, and the two limits a reviewer most needs sit mid-sentence. A contract in two homes drifts — and N10 shows one of the two copies is already scoped more broadly than the code. AGENTS.md:52-60 (not opened) (one purpose per document), docs/design-review.md (not opened) principle 16.
S5. Record the design decision for the second inbound lifecycle (process; no code change)
Finding. The change puts two inbound lifecycles inside Staged where there was one: a five-state shared-file machine (SharedFileState, :1066-1078), reference-counted shared windows with separate disk and upload pins (:1113-1160), out-of-order plan completion (DeviceInbound, :1168-1214), credit-gated attach (has_window_credit :1683, attach_pending :1711) and close-only-when-settled (Pass 5e, :2213-2230). The PR Why argues the choice soundly — DiskThread sees only file offsets and raw host addresses and finishes when direct I/O and xxh3 complete, whereas staging slots must stay pinned until every follower's asynchronous Copier upload finishes — consistent with docs/design-review.md:64-68 (not opened) (never release slots while queued work references them). Nothing in the thread records a maintainer decision, and AGENTS.md:201-206 (not opened) is explicit that passing tests or a performance gain does not waive an architectural invariant, and that a PR Why section is not that decision.
Request. A maintainer records on the PR that Staged, not DiskThread, owns shared-staging lifetime — before merge, not by merge.
Why. The technical content held up under review, but an invariant this central should rest on a recorded decision rather than on review-time inference.
Nits
N1. inbound_rate now prices restores optimistically, and two stores measure different things under one name
The sample's elapsed is disk::Reply.elapsed, set only around worker.execute in disk::run (selene/src/disk.rs:448-450 (not opened)) — one O_DIRECT read plus xxh3, excluding slot wait, copier queue and GPU upload. hit() divides record bytes by it to produce estimated_seconds (disk_store.rs:3625: bytes as f64 / self.inbound_rate.get().max(1.0)), feeding worth_fetching/worth_transfer (selene/src/store.rs:422-438 (not opened), "a fetch is worthwhile when the transfer takes less than half the prefill it replaces") and the host_cache_inbound_rate metric. Before this PR the rate came from per-record Inbound.started.elapsed(). Meanwhile CompositeStore derives a same-named quantity from read_into completion spans (composite.rs:994-1004). The PR's own evidence shows the physical rate is fine (6.07 GB/s single vs 7.71 GB/s 8-way), so the metric is honest as device read bandwidth; it is the admission estimate that is now optimistic even for a single restore. Request: document inbound_rate as device read bandwidth and keep an end-to-end estimate for admission, or include the per-record wait in the sample. What would settle the size of the error: a measured single-restore admission-to-Restore wall time against hit().estimated_seconds on the same prefix.
N2. Staged::close reports a non-job count as a job count
abandoned is store_jobs.max(internal) where internal is a .max() chain over owners.len(), maintenance.len(), shared_segments.len() and shared_windows.len() (:2522-2528), then reported as "{abandoned} disk transport jobs did not complete within {:?}" (:2540-2544). After this PR the maximum can come from shared_windows — pinned staging slots, not jobs — so an operator reading a shutdown log mis-sizes the leak. The shared_windows term is provably dead as a raiser (a SharedWindow owns no disk job id). busy() (:2367-2374) already answers whether anything is pinned. Request: report the store-job sum alone and word it as unfinished store jobs, or return invalid("disk store still busy after {:?}") when busy(); the three locals and two .max() chains go away.
N3. memory.rs:1336-1367 is now the last copy of the WINDOW_PAGES splitter this PR unified
This PR unified the two disk-side splitters into one plan_windows(segments, align_to_window) (:682-727) — a good change. But the same policy now lives in two homes: chunk into windows of WINDOW_PAGES, row attached to the last window, row-only window when the page count is zero, empty link → none. If the two drift, host-tier and disk-tier window boundaries disagree — exactly the defect class the unification removed. Request: call windows from the disk path, or give the policy one shared home.
N4. Two settled() predicates, three repeated unindex blocks, two identical detach closures
Segment::settled (:662-664) means "file unopened or closed"; SharedSegment::settled (:1106-1109) means "no disk jobs outstanding" — one name, adjacent concepts. The "unindex only if the index still points at me" body appears three times (:1525-1527, :1543-1545, :1837-1839); the subtle part (a newer window reusing the key must not be unindexed) is exactly what will eventually be stated wrong once. The follower-detach retain closure appears twice identically (:1813-1816 in detach_unwinding_windows, :1900-1904 in Pass 1 of pump_device_inbound). The two detach paths differ deliberately in byte crediting — only Pass 1 does record.bytes += win.read_bytes (:1901) — and that asymmetry deserves a one-line comment so the next reader does not "fix" the duplication by unifying them. Request: rename one settled (closed()/drained()), extract unindex_window(&mut self, key, id), and give WindowFollower a matches/remove method defining its (record, plan_index) identity (:1119-1123) once.
N5. HostInbound is a one-element Vec with an always-zero owner index
read_into inserts exactly one segment at index 0 and always passes 0 as the owner index (:1351-1360), yet HostInbound holds segments: Vec<Segment> (:749-750), Owner::HostInbound(JobId, usize) carries an always-zero index (:265-267), apply_disk tolerates a missing segment (:789-791) and pump iterates the vec (:865). Separately, Segment::reads_left is set to plans.len() (:1357), decremented only at :822 and tested only at :867, while self.done == self.plans.len() (:882) says the same thing. Request: struct HostInbound { segment: Segment, .. }, Owner::HostInbound(JobId), delete reads_left and close on self.done == self.plans.len() && segment.settled (the file close would then wait one extra pump for windows finishing in the same call — harmless).
N6. SharedSegment.id / SharedWindow.id duplicate their HashMap keys
Both fields are copies of the keys of shared_segments/shared_windows (:1083, :1131); their only uses are min_by_key(|seg| seg.id) (:1433-1434) and the identity guards before removing an index entry (:1525, :1543, :1837). Request: iterate (&id, seg) / (&id, win) so the id comes from the map, and compare the iterated id in the guard. Two fields and the invariant that they always equal their key disappear.
N7. Dead term in the demand lookup
let peer_demand = if demand.is_empty() { 0 } else {
demand.get(&record.window_key(plan_index)).map_or(0, |t| t.saturating_sub(1))
};
map_or(0, ..) on an empty map already yields 0 (:1781-1787). Request: drop the branch. (The device_inbound.len() <= 1 short-circuit at :1734-1738 is the real fast path — keep it.)
N8. Test-only residue: disk_read_counted flags and GatedCopier's positional 4-tuple
HostWindow.disk_read_counted and SharedWindow.disk_read_counted (:743, :1140, with :915, :939-940, :957-958, :2009, :2102-2103, :2130-2131) exist only so disk_window_reads counts windows rather than ReadPages/ReadRow jobs; they are already behind #[cfg(any(test, feature = "test-support"))], so nothing ships — the cost is code. GatedCopier::wrap (:8092-8122) returns (SharedCopier, Arc<Mutex<bool>>, Arc<Mutex<VecDeque<copier::Reply>>, Arc<Mutex<Option<JobId>>>); five call sites destructure positionally and three discard the tail with _ (:8406, :8530, :8984; :8650 keeps fail_job; :9234 ignores the tail). Request: count windows once at window creation and delete both flags, or add one doc line naming disk_window_reads' unit; replace the tuple with a named struct (hold/held/fail), placed beside StoppedCopier in selene/src/testing.rs (not opened) if composite.rs tests ever need it.
N9. Duplicated test scaffolding (~90-110 lines recoverable)
~10 new coalescing tests each rebuild the identical 2-line pool setup plus 13-line DiskStore::new(...) block (e.g. :8313-8329, and at :8407-8420, :8531-8544, :8655-8668, :8770-8783, :8850-8863, :8934-8947, :8985-8998, :9183-9199, :9236-9252), three repeat the same records vec, and staged_close_drains_active_coalesced_fetches_cleanly (:8830-8906) duplicates concurrent_burst_... (:8293-8384) apart from calling close() before polling. ObservedTransport (:9110-9160) delegates all eight DiskTransport methods to Staged solely to recompute a rate the store already reports (:9324-9350). Request: a staged_store(...) helper plus for close_early in [false, true] in the burst test; delete ObservedTransport and keep the disk_window_reads() == 2 and 5%-tolerance assertions, which are what actually test the stated property.
N10. Description and docs wording
- Sample scope. "Emit one
InboundWindowSampleper completed physical window read" is broader than the code: the sole emitter isStaged::apply_shared_disk(:1605-1620), i.e. shared device-fetchwindows only — caller-ownedread_intonever feedsDiskStore::inbound_rate, anddocs:362-366and:1528-1531inherit the broad phrasing. State the scope in all three places. - Ratios. Two Flash-Next "Read Reduction" values (3.99x, 3.52x) do not equal the ratio of the tabulated MB means (7,944.9/1,981.1 = 4.010; 7,958.0/2,251.5 = 3.535); the four TTFT deltas and both 27B ratios check out. Say in the caption whether the column is a ratio of means or a mean of per-trial ratios, and whether the Flash-Next rows are repeats.
- Arrival-order relaxation.
docs:350-354admits that window selection "relax[es] strict arrival-order scheduling across concurrent restores"; the description never mentions it and reports no per-request tail latency beside the burst medians. - "No core re-export or format change." True for re-exports and format;
TransportEventis a public enum in a public module and gained a variant (see S1).
Resolved since the previous round (recorded so the fixes are not lost)
- Blocker — 8/9 vs 7/9 at 61.3K. Closed with five cold-VRAM repeats (seeds 1234..1238, 60,534 tokens,
top_logprobs = 5) against one shared disk checkpoint: identical FP32 top-5 logprobs and token IDs onmainand at head in all five. Cause identified — Flare has no greedytemperature = 0(helios clamps into the core's positive sampling range) and the first script used distinct per-build prompt nonces. Further pinned bymisaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore(byte-equalSimulatedGpupages and row against a private baseline,skip_pages = 13). inbound_rateon logical bytes. Fixed: one sample per completed physical window carryingwin.read_bytesand the summeddisk::Reply.elapsed(:1596-1620);applyfeeds the sampler and returns beforestats.progress += 1(:3632-3635);bytes_instays logical (each follower creditsrecord.bytes += win.read_bytes,:1899-1905, spent at:3669). Live rank-0 metric confirms it: 6.07 GB/s single vs 7.71 GB/s 8-way simultaneous, 6.02 GB/s staggered onQwen3.8-27B-NVFP4.- Benchmark provenance; expected cost stated as a result. Table keyed to
main c0c4f798vs0c04b1e2; the single-restore cost is labelled "As an expected bound" with thedevice_inbound.len() <= 1fast path named; un-rerun multi-host RoCE moved to Not covered. - One planner, one window key, one attach helper.
plan_windows(segments, align_to_window)(:679-727) replaced the twin splitters;SegmentKey/WindowKey+window_indexgive O(1)find_reusable_window(:1646-1663) and drop the per-pumpPathBufclones;has_window_credit(:1683-1687) andattach_pending(:1711-1730) replaced the duplicated attach loops;PlanState→started: Vec<bool>;SharedWindow.path/.expectedremoved. - Earlier nits. Counters gated
#[cfg(any(test, feature = "test-support"))](:200-208, accessors:1279-1295);allocate's rustdoc back onallocate(:241-243) withfree_slotson its own line (:236-239); module doc rewritten (:7-27). - Design rationale. The Staged-vs-DiskThread argument is now in the PR Why on technical grounds and discharges the design-review ask in substance; only the maintainer record remains (S5).
Checked and sound — no action requested
- Scope fits the charter. Fixes a measured performance problem (charter line 35, AGENTS.md:165-166 (not opened)) inside the subsystem the charter names (line 24). No rejection criterion crossed; no per-model branch (charter line 43); no new flag, env var or recipe knob anywhere in the diff.
- No compatibility break. No
Headeror on-disk format change, no wireKindchange, no re-export change;WINDOWS_IN_FLIGHTstill derives fromcrate::shared::WINDOW_CREDITS. Files written before this PR load unchanged. - Slot and file lifetimes. A shared window is freed only when
followers.is_empty() && disk_referenced == 0 && upload_referenced == 0(sweep_shared_windows,:1755-1771); every disk submit and upload increments before the risk window (:2100,:2128) and decrements before any release decision (:1594), so a reply can never arrive for a freed window and no slot is released while aCopierupload is outstanding. Segment removal requiresactive.is_empty()and no pending disk reads (Pass 5e,:2213-2230), sodisk::Closeis submitted only after the last attached restore's I/O drained. - Failure isolation. Shared open/read errors fail every attached restore after in-flight I/O drains (
fail_segment_users:1509-1536,fail_window:1538-1551) and route throughwith_record_read()so only the lookup row is invalidated (:3676-3682); a private child or GPU-upload error fails one restore. - Host path not penalised.
read_intokeepsplan_windows(..., false)with segment-relative windows (:682-722, call site:1349), private opens and unaligned packing, soCompositeStore's caller-owned buffers see no behavioural change and gain no extra job; only device restores pay the "at most one extra partial window per segment" cost, which the description discloses. - Fast path real.
build_pending_demandreturns immediately whendevice_inbound.len() <= 1(:1734-1738), so a lone restore behaves exactly as before. - Scale is not churn. +3313/−931 is load-bearing: the host path must stay private (caller-owned registered buffers cannot be pinned in
SlabPoolacross followers), and the device path genuinely needs per-file and per-window reference state (SharedSegment,SharedWindow) to keep uploads independent and failures isolated.pump_device_inboundis long but each of its passes carries an ordering argument the others depend on. Nothing is left dead: the replacedDestination/InPhase/apply_transfer/submit_uploadcode is deleted in the same diff, and everyplan_windowscall site is updated (:1349,:2435,:6262,:8235). - Tests exercise the real path. Byte-exact
SimulatedGpupage and row assertions, physical open/window counts read at the real submit sites, andpool.free_slots() == pool.slot_count()after each test — the property, not a mock (AGENTS.md:194-199 (not opened)).Rate::observeignores zero-byte/zero-elapsed samples and the sample is only produced whenwin.read_bytes > 0(:1605), so the degenerate cases are covered at both ends. - Description quality. Four-part scheme in order, expectation separated from measurement, limitations and unrun checks disclosed,
Discord: Doonerpresent.
Open questions / what could not be established
- Size of the
estimated_secondsoptimism (N1). Needs one measured single-restore admission-to-Restoretime on a ~60K prefix compared againsthit().estimated_seconds. - Which shape for S1's out-of-band sample (
Stageddrain, a field onFetched, orStoreStatscounters) — internal API shape, the author's call. Folding it intoStoreStatswould also make coalescing visible to operators. - Maintainer sign-off (S5). Nothing in the thread records one.
- #497 reconciliation. Both PRs touch
Staged::pump_all; the PR says either merge order works. Whoever merges second must confirm the resolvedpump_allstill runshost_inboundandpump_device_inboundahead of outbound writes and maintenance, and re-check S1 against the new ordering (the ordering changes when samples are produced relative to maintenance). - Does the demand-preference scheduler earn its ~65-80 lines? Only the staggered-vs-simultaneous gap is at stake (3.76x vs 4.22x on the 27B); worth measuring before cutting, since the fallback is a
peer_demand > 0test over the existingwindow_index. - The
Unopenedshared-segment case inStaged::close(N2) — whether it is meant to be covered byinternalor already bystore_jobs. - Untested shapes, all declared Not covered by the author and not exercised here: multi-host RoCE serving, 2-GPU
split_pools, discrete PCIe GPUs, Windows serving (fullseleneremains gated on/dev/urandom), and liveCompositeStore/PooledStoreGPU serving. N1's composite interaction is precisely in that last path.
Limits of this review
No toolchain, GPU or test run was available: nothing was compiled or executed, so every finding is established from source at 0c04b1e2 and from the evidence the PR reports (476 selene tests on x86_64 and ARM64 Linux, 13 coalescing tests on Windows IOCP, 21 single-GPU SM121 helios offload:: tests, test_core_boundary.py (not opened), and the SM121 benchmark table), not from a build performed for this review. The head carries no CI checks. The ~5,300-line test module (disk_store.rs:5100-9358) was read for the new fixtures and every assertion touching the reviewed constructs, not line by line. No instruction-like content appeared in the PR body, comments, code or docs; nothing attempted to direct the reviewer.