Prose review — PR #496, "Coalesce shared ancestor reads across concurrent Selene disk fetches"
Head 0c04b1e2 (base main), 3 files (+3358/−933): selene/src/disk_store.rs, selene/src/shard.rs, docs/prefix-cache-offload.md. Lens: Prose. No new commits since the previous pass, so previously fixed items remain fixed.
Key findings
- Verdict: should-fix issues only; no blockers.
- One should-fix: the new §2.4 text in
docs/prefix-cache-offload.md:333-366is a single ~250-word bullet that opens on the slot pool and then carries four distinct topics (mechanism, invariants, limits/failure scope, metrics) with no hierarchy, contrary toAGENTS.md:116-121; and theStoreStats.bytes_in/inbound_ratecontract it ends with is stated verbatim a second time in §4 at:1528-1531. - Three nits, all in the PR description: (1) the
InboundWindowSampleclaim is scoped wider than the code — only shared device-fetchstaging windows push a sample (selene/src/disk_store.rs:1617-1620), so caller-ownedread_intonever feedsDiskStore::inbound_rate; (2) two Flash-Next "Read Reduction" values (3.99x, 3.52x) do not equal the ratio of the tabulated MB means (4.010, 3.535) and the caption does not say how the column was derived; (3) the description never mentions that window selection "relax[es] strict arrival-order scheduling across concurrent restores" (docs:350-354) and reports no per-request tail latency. - The description otherwise meets the repository's mandated scheme — why / what / result / evidence in order, expectation separated from measurement, limitations and untested shapes disclosed,
Discord: Doonerpresent, benchmark provenance namingmain(c0c4f798) against the head. - The changed code prose passes: module doc, type/state comments, pass comments, test names and the commit message all describe the code as it exists, in present tense, without chronology.
Rules applied
AGENTS.md:72-112— "Required PR descriptions": the four mandatory questions in order, expectation distinguished from measurement, scope and material limitations attached to a measured result, unexplained differences between runs repaired, no test counts standing in for the tested contract.AGENTS.md:114-132— supporting detail must have a clear hierarchy (central design and principal risks before supporting detail; avoid exhaustive inventories), references resolved, no process assurances.AGENTS.md:142-151— the Discord line.docs/design-review.md:137-150(principle 16, "Write without hidden context") and:153-159(principle 17, Discord contact)..agents/skills/repo-prose/SKILL.md:13-46(not opened) — present-state specification, no chronology, evidence as conditions/measurement/result/conclusion, comments explain invariants and intent, scale detail to the change;:56-59— when reporting a prose defect, quote the passage and say what information would repair it.
Should fix
S1 — docs/prefix-cache-offload.md:333-366: one bullet, four topics, and the metrics contract stated twice
What is wrong. The bullet opens on the slot pool:
"
Stagedshares the host slot pool with the memory store and owns an independent transfer handle and the disk thread.storestreams checkpoints through intake windows into record files;fetchstreams them back to the GPU. With warm zero and disk enabled, the pool contains only intake slots."
and then, without leaving the bullet, runs through the two caller-buffer signatures (:337-340), shared handle plus window coalescing aligned to WINDOW_PAGES (:340-342), one upload per follower and slot release (:343-345), read_into independence (:345-346), the immutability/pin and close-before-Fetched invariant (:346-350), the sibling-demand preference that relaxes arrival order (:350-354), the two sharing limits plus the skip_pages % WINDOW_PAGES bound (:354-358), the shared-vs-private error scope (:358-362), and finally the accounting rule (:362-366). That is four topics — mechanism, invariants, limits and failure scope, metrics — in a section whose neighbouring bullets are single-purpose.
The same accounting statement appears again in §4:
"On
DiskStore,StoreStats.bytes_incounts logical checkpoint bytes restored to GPU destinations across completed fetches, whileStoreStats.inbound_ratemeasures physical staging-window disk reads so coalesced follower restores do not overstate device read bandwidth." (:1528-1531)
Why it matters. AGENTS.md:116-121 requires a clear hierarchy — the central design and principal correctness risks before supporting implementation detail — and warns against exhaustive inventories; the prose skill (:26-29, :40-43) requires documentation to state behaviour directly and scale detail to the change. The two limits and the failure scope are what a reader most needs to judge the mechanism, and here they sit buried mid-chain after four sentences of mechanism. The duplication has no checker: §4 is the measurement section where the contract belongs, while the §2.4 copy is a behaviour claim in a mechanism section, and any later change to the sampler must be made in both places (cf. N1, where one copy is already over-broad).
Fix. Keep §2.4 to what Staged does and how windows are shared — one paragraph, or a short paragraph plus two or three sub-bullets for "limits" and "failure scope"; drop the metrics sentence from §2.4 and leave §4 as its single statement; fold "relaxing strict arrival-order scheduling" into the limits bullet so the behavioural consequence is not lost. Everything here is factually accurate and present tense — this is structure, not accuracy.
AGENTS.md:116-121, .agents/skills/repo-prose/SKILL.md:26-29 (not opened).
Nits
N1 — PR description, What bullet: InboundWindowSample is scoped wider than the code
"Emit one
TransportEvent::InboundWindowSampleper completed physical window read fromdisk::Reply.elapsed(forwarded on rank 0 inSharded, ignored on peer ranks) soDiskStore::inbound_rateprices admission from physical disk bandwidth whileStoreStats.bytes_instays logical."
The sole site that pushes TransportEvent::InboundWindowSample is Staged::apply_shared_disk (selene/src/disk_store.rs:1617-1620, the sample computed at :1605-1609), i.e. shared device-fetch staging windows only. The caller-owned host path (HostInbound :749-993, created in read_into at :1349-1361) increments the test-only disk_window_reads counter but never emits a sample, so a DiskStore restored through read_into (the composite path) does not feed DiskStore::inbound_rate from those reads — the composite keeps its own disk_inbound_rate. docs/prefix-cache-offload.md:362-366 uses the same broad phrasing ("physical staging-window disk reads"), and :1528-1531 is broader still.
Why it matters. AGENTS.md:95-102 requires the metric's scope to be attached to the claim; a reader pricing admission from inbound_rate cannot tell that caller-buffer restores are outside its sample.
Fix. In the What bullet and in both docs passages, say the sample is emitted once per shared device-fetch staging window, and state what feeds inbound_rate for caller-owned buffer reads. Severity: nit — the behaviour is defensible; the prose scope is what is off.
N2 — PR description, Result table: two read-reduction ratios do not match the MB columns
| Row | Before → After (MB) | Ratio of means | Claimed |
|---|---|---|---|
| 27B simultaneous | 18,177.5 → 4,306.7 | 4.221 | 4.22x ✓ |
27B +25 ms stagger |
18,194.2 → 4,843.6 | 3.756 | 3.76x ✓ |
| Flash-Next simultaneous | 7,944.9 → 1,981.1 | 4.010 | 3.99x ✗ |
Flash-Next +25 ms stagger |
7,958.0 → 2,251.5 | 3.535 | 3.52x ✗ |
All four TTFT deltas check out (−29.0%, −13.5%, −3.1%, −2.8%), so only the two Flash-Next reductions are off. The 27B rows state "means over 2 interleaved repeats"; the Flash-Next rows say nothing, so the column plausibly mixes a ratio of means with a mean of per-trial ratios. AGENTS.md:95-102 requires the headline comparison and metric direction with its scope; here the derivation cannot be told from the caption.
Fix. State in the table caption whether "Read Reduction" is a ratio of the tabulated means or the mean of per-trial ratios, and make the two Flash-Next values consistent (4.01x / 3.54x if a ratio of means) — and say for the Flash-Next rows whether they are single trials or repeats. Only the author's raw trial records can settle which was computed.
N3 — PR description, Result: the arrival-order relaxation the docs admit is not stated
docs/prefix-cache-offload.md:350-354 states a behavioural consequence the description never mentions:
"When free slots exist and multiple device restores are in flight, window selection prefers pending windows demanded by sibling restores so concurrent branches stay synchronized on shared ancestors before reading private tails, relaxing strict arrival-order scheduling across concurrent restores."
The What bullet mentions build_pending_demand and the sibling-demand preference; the Result lists the coalescing win and the two costs (no demand indexing for single restores, one extra partial window per segment). Nothing says a restore can now let a later-arriving sibling's windows go first, and no per-request tail latency is reported beside the burst medians — which is precisely what a reviewer of a serving-path change needs to judge whether the TTFT numbers were bought at another request's expense.
Fix. One clause in What or Result naming the reordering and its cost (concurrent restores may reorder windows toward shared ancestors at the expense of strict arrival order among them), with a note that only aggregate burst medians were measured. AGENTS.md:95-102.
Verified clean at this head (checked, do not re-audit)
- Description scheme and contact: all four parts in order plus
Discord: Dooner(AGENTS.md:72-112,docs/design-review.md:137-150,:153-159). - Earlier rustdoc defect fixed:
selene/src/disk_store.rs:236documentsfree_slots;:241-243is back onallocate, whose body (:243-254) matches it. - Earlier evidence gap fixed: the old 8/9 vs 7/9 difference is now explained by five cold-VRAM restart repeats (seeds 1234..1238, 60,534 tokens,
top_logprobs = 5) giving identical FP32 top-5 logprobs and token IDs onmainand head, with the cross-seed variation attributed to positive-temperature sampling and the Helios temperature clamp named —AGENTS.md:106-108("explain differences between runs"). - Expected vs measured: "As an expected bound … at most one extra partial window per segment when
skip_pages % 64 != 0" is correctly labelled (AGENTS.md:95-96) and matchesplan_windows(..., align_to_window = true)(disk_store.rs:702-724); thedevice_inbound.len() <= 1short-circuit exists inbuild_pending_demand(:1732-1738). - Benchmark provenance: the setup names
main(c0c4f798) against0c04b1e2;Not coveredis consistent with it and discloses multi-host RoCE, 2-GPUsplit_pools, discrete PCIe GPUs, Windows serving, and liveCompositeStore/PooledStoreGPU serving (design-review.md:100-105). - Docs signature list:
write_from(id, header, temporary, path, pages, row, sums)/read_into(id, path, expected, first_page, pages, row)(docs:337-339) matchesselene/src/disk_store.rs:1308and:1334. - Changed code prose: module doc
:14-27;WINDOWS_IN_FLIGHT:62;HostInbound:747-748;SharedFileState:1066-1078;SharedSegment::reusable/settled:1097-1110;SharedWindowrelease condition:1125-1129(matchessweep_shared_windows:1824-1843);DeviceSegmentRef:1160-1164;DeviceInbound:1166-1167;HeaderIdentityhash contract:1001-1050(field list matchesHeader'sPartialEq,selene/src/shared/record.rs:136-152(not opened));build_pending_demand:1732-1733;pick_next_pending_plan:1757-1759; pass comments inpump_device_inbound:1887-1930,:2031-2032,:2203. All present tense, all describing the code as it is, no chronology or journey narration. - Test names state the property and match the description's claims:
aligned_windows_align_to_window_boundaries_for_device_coalescing(:8235),concurrent_burst_coalesces_shared_ancestor_opens_and_window_reads(:8294),different_skip_pages_coalesce_aligned_windows_to_exact_gpu_pages(:8510),shared_ancestor_failure_propagates_to_all_followers_without_leaks(:8734),staged_close_drains_active_coalesced_fetches_cleanly(:8831),misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore(:8909),coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical(:9108). - The description's
#[cfg(any(test, feature = "test-support"))]gating claim holds (:200-208,:1285-1295). selene/src/shard.rs: theunreachable!()at:476-478is guarded by thematches!at:722-725; peer ranks skip samples at:1148-1150. The forwarding sentence in the description is accurate apart from N1's scope.- Commit message: a single imperative subject scoped to the layer, with a body carrying the same four-part argument; no attempts, pivots or chronology (
.agents/skills/repo-prose/SKILL.md:40-43(not opened)).
Open questions and what could not be verified
- N2 (ratio derivation) cannot be resolved from the repository; it needs the author's per-trial read totals. State the derivation in the caption and the numbers become checkable.
- The live numbers, test counts and platform claims (
476Linuxselenetests,13Windows IOCP,21SM121heliosoffload::, the GB/s figures, the 30 s decode isolation run) cannot be re-derived from source; they are internally consistent andNot covereddiscloses the untested shapes, so I record no finding against them. What would settle them is a CI run at0c04b1e2— the head currently has no checks — and the raw benchmark artifacts. - Out of this lens, raised by the peer review rather than by prose: whether
TransportEvent::InboundWindowSamplebelongs on the cross-rank completion enum at all,HeaderIdentity's hand-writtenHash, andpick_next_pending_planrestatingLayout::record_slotsare code-architecture findings; the maintainer sign-off on placing a second inbound lifecycle insideStagedis a process item. I did not re-audit them. - No instruction-like content appeared in the PR body, comments or the changed docs that would attempt to direct a reviewer.