#1 [high] Change: what PR #496 actually does in selene/src/disk_store.rs
PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches", author FujitsuPolycom, head f9c9191, base main, 2 files: selene/src/disk_store.rs +2803/−913 and docs/prefix-cache-offload.md +5/−1. No comments, no reviews, no CI checks at head.
What it does (verified by reading the diff and file at pr/496):
- The old single
InboundRecord(+Destination::{Device,Host}enum) is split into two pipelines:HostInbound/HostWindow(fieldspages: Vec<usize>,row: Option<Vec<usize>>) = caller-owned host reads, used byStaged::read_into(composite / host_inbound). Unchanged behaviour, stillplan_windows(disk_store.rs:672).DeviceInbound/DeviceActiveWindow/DeviceSegmentRef= GPU restores viaStaged::fetch(disk_store.rs:1117-1159, 2387-2433), which use the newplan_aligned_windows(:700) and shared structures.
- New shared-state machinery in
Staged:shared_segments: HashMap<SharedSegmentId, SharedSegment>,shared_windows: HashMap<SharedWindowId, SharedWindow>,next_shared_segment,next_shared_window(struct at :1161-1177).Owner::Inbound(JobId,usize)becameOwner::HostInbound(JobId,usize)+Owner::SharedSegment(SharedSegmentId)(:255-262). SharedSegment(:1021-1058): one disk-thread open file per exact(path, Header)pair, with a 5-state machineUnopened/Opening/Opened/Closing/Closed,disk_outstanding,next_disk_window,pending_page_reads: HashMap<u32,SharedWindowId>,pending_row_reads: VecDeque(becausedisk::Job::ReadRowcarries no window id, FIFO),open_error,users: HashSet<JobId>.acquire_shared_segment(:1362) attaches a new fetch to the lowest-id reusable segment for the same (path, header).SharedWindow(:1070-1100): one staged staging window (SlabPool buffers) per (path, expected Header, first, count, row), withphase: Reading/Read/Failed,disk_referenced,upload_referenced,followers: Vec<WindowFollower{record, plan_index}>,read_bytescredited per follower.plan_aligned_windows(:700-744): splits each fetch segment on absoluteWINDOW_PAGES(64-page) file boundaries instead of packing from the restore's own first uncached page, so branches with different GPU-resident prefix lengths produce identical suffix windows. Row is only placed on the chunk that ends the segment (row: row && chunk_end == end).pump_device_inbound(:1811-2266) is a new 5-pass (1, 2, 3, 4, 5a-5e) scheduler replacing the old per-record pump: reap uploads/detach; attach followers to in-flight windows within theWINDOWS_IN_FLIGHT(=2) credit; sweep unreferenced windows; start new windows (opening the shared file lazily, allocating staging slots, submitting ReadPages/ReadRow); submit per-follower GPU uploads from the shared staged buffers; detach/sweep; close segments that no longer need reads; complete fetches (last user of a shared segment waits for it to settle, i.e. Close reply, before emittingFetched).build_pending_demand(:1647) +pick_next_pending_plan(:1684): per-pump index of pending window demand across all healthy fetches (keyed by path, first, count, row -> Vec<(Header,count)>), so an arriving fetch prefers windows that siblings also need.debug_assertonly in dev.- Failure isolation:
fail_window(:1475) fails only attached followers;fail_segment_users(:1449) fails all users of a shared segment on shared Open failure, tagging witherror.with_record_read()(:1494-1520). Private child/upload errors are recorded per-record and only thatFetchedgets Err. Staged::in_flight()now returns(outbound, host_inbound + device_inbound);Staged::closeabandonedcount includes both maps (:2485-2489).- Test-support-only counters added:
disk_opens,disk_window_reads,coalesced_windowsinResources(:189-200) and accessorsStaged::disk_opens(),disk_window_reads(),coalesced_windows()behind#[cfg(any(test, feature = "test-support"))](:1213-1235), asserted by the new tests. These are the only public API additions; no re-exports or on-disk format change. - New tests (module
testsat :3897):aligned_windows_align_to_window_boundaries_for_device_coalescing(:8192),concurrent_burst_coalesces_shared_ancestor_opens_and_window_reads(:8252),staggered_arrival_attaches_out_of_order_to_in_flight_windows(:8345),different_skip_pages_coalesce_aligned_windows_to_exact_gpu_pages(:8468),private_failure_isolation_preserves_sibling_sharing_ancestor(:8580),shared_ancestor_failure_propagates_to_all_followers_without_leaks(:8692),staged_close_drains_active_coalesced_fetches_cleanly(:8789). Helperswrite_shared_ancestor_tree(:8136),poll_all_fetches(:8172). 7 coalescing tests, matching the description. plan_windowsdoc comment narrowed to "caller-owned host reads" (:677-679); the module doc (:14-25) gained the sharing paragraph.
#3 [high] Claims and evidence: #496's benchmarks, test suites, and what it does not cover
From PR #496 description (unverified against reviewers, no reviews yet):
- Benchmark: single-pass
flare runon NVIDIA GB10 (SM121),--prefix-cache-memory 0 --prefix-cache-disk /tmp/selene-disk, main425ab2d4vs this change; 8 concurrent /v1/chat/completions after restart with one ~61K warm shared prefix + 8 branches. - Physical NVMe read: 27B TP1 18,026.4 -> 4,285.8 MB (-76.2%, 4.21x); +25 ms stagger 18,093.5 -> 4,562.6 MB (-74.8%); Flash-Next TP1 7,943.7 -> 1,981.1 MB (-75.1%); Flash-Next TP1 stagger -71.7%; Flash-Next 2-host RoCE TP2 -75.2% / -71.0%; DeepSeek TP4 1,877.5 -> 1,875.2 MB (1.00x, described as reads finishing (~15 ms/rank at 47.1K) faster than tokenization so no overlap).
- Burst median TTFT: 27B simultaneous 8,483.8 -> 7,112.4 ms (-16.2%); 27B stagger -20.3%; Flash-Next TP1 3,333.5 -> 3,337.1 (no change); Flash-Next TP1 stagger -2.5%; Flash-Next TP2 -4.5% / -6.9%; DeepSeek TP4 +1.1% slower (2,456.9 -> 2,483.6).
- Author's own caveat: "measured before the linear demand-index and close-count edits covered by the unit tests below"; single-pass runs not repeated after the demand-index edit or rebase.
- Tests:
cargo test --locked --release --manifest-path selene/Cargo.toml --features test-support= 474 passed on x86_64 Linux (O_DIRECT + io_uring) atc0c4f798; all 7 coalescing tests on Windows IOCP;heliosoffload 121 passed / 8 GPU ignored;flare-cli --features roce,rdma. - Not covered:
helios FLARE_RUN_CUDA_TESTS=1, discrete PCIe GPUs, Windows serving, live CompositeStore/PooledStore GPU serving, repeated post-edit benchmarks. - Live checks: 9-fact numerical retrieval at temperature 0 — DeepSeek TP4 9/9 at 23.1K and 47.1K; Qwen3.8-27B TP1 9/9 at 30.1K but 61.3K: 8/9 on main vs 7/9 on this PR (a regression on one fact vs main, disclosed); four concurrent unique-prefix decode streams 30–45 s: 0 errors, 59.4->58.2, 96.6->96.7, 109.2->122.4 vs 118.4 no-offload, 73.6->74.1 tok/s.
- The PR description mentions "Adds
test-supportcounters" — verified:Staged::disk_opens/disk_window_reads/coalesced_windows(), cfg(any(test, feature="test-support")). - Description's companion note: merge this PR first, then rebase #497 so
Staged::pump_allruns host_inbound + pump_device_inbound ahead of writes and maintenance. - Process: opened 2026-11-24 (same day as read), 0 comments, 0 reviews, no CI checks on head f9c9191, single commit f9c91915 "Coalesce shared ancestor reads across concurrent Selene disk fetches" (2026-11-23), +2808/−914 over 2 files. Marked ready for review (state open, ready for review per orientation), no labels, no milestone.
#4 [high] Related work: stacked with #497, same-file overlap with #477/#486
- #497 (open, same author, opened same day 2026-11-24): "Reduce disk offload restore latency and integrated-memory intake overhead" — selene-spark-pipeline branch, +1163/−67 across 16 files including selene/src/disk_store.rs (+151/−10) and docs/prefix-cache-offload.md. Explicitly stacked with #496: each PR's description names the other as companion; #496 must merge first, then #497 rebases so
Staged::pump_allruns inbound queues ahead of writes/maintenance. Both base onmain425ab2d4and share the same benchmark baseline run. Overlap: both touchStaged::pump_all(in #496 it was rewritten tooutbound -> host_inbound -> pump_device_inbound; #497 wants inbound-first ordering) and both touch docs/prefix-cache-offload.md (section 2.4 area). #497 also changes disk-only intake sizing tointake_slots(layout, 1)=2*row_slots + 2*WINDOW_PAGES— i.e. staging for only two windows regardless of concurrency; #496's burst test deliberately sizes its pool the same way (crate::offload::intake_slots(&layout, 1)at disk_store.rs:8271) to show six concurrent restores share the two ancestor windows, so the two changes are complementary in intent. - #477 (open, draft, yatesdr) and #486 (open) both rewrite record files / add codecs at rest: they touch selene/src/disk_store.rs but in Store/DiskStore paths (recovery, packed windows). #477 changes
selene/src/disk.rs(record file header/checksum read) anddisk_store.rsrecovery (:1525-1541 per the autobot review on #477); no overlap with the inbound transport, but a textual conflict in the same file is likely if both land. #477 also carries an autobot "Changes Requested" review. - Historical work this builds on: #141 (host-tier eviction), #142 (hash records once, direct-I/O row reads, prompt window credits — introduced
WINDOW_CREDITS), #168 (store only what a request may resume), #413/#415/#429 (Selene pool puts, rows by role, link under any ancestor), #455 (single-process prefix checkpoints for the pool), #416 (refresh host prefix-cache recency,425ab2d4— the benchmark baseline), #92 (Selene pool across instances), #80 (move host tiers into the CUDA-free selene crate). All merged, all yatesdr. None of them coalesced concurrent disk reads; the per-restore private read path being replaced dates from #142/#168. - No issue, PR, or doc in the local copy asks for coalescing concurrent disk restores. Searches for "coalesce", "shared ancestor coalesce window", "disk restore concurrent branches duplicate reads", "prefix cache disk restore latency" returned #496, #497, #477, #486, #455, #168, #92, #429, #80 and #439 — nothing that predates #496 and requests this. The motivation appears to be the author's own benchmark observation.
- #439 (open issue, default labels area:caching/area:selene/bug): prefix-index
expiredsweep stops early — unrelated code path (index eviction), only adjacent thematically.
#6 [high] Amendment 2026-11-24 run 236: new sibling PRs and what they change about #496's merge order
Event since the 2026-11-24 run-235 report: no new comments and no new commits on #496 (pr_comments = "No comments"; single commit f9c91915 still the head; files still docs/prefix-cache-offload.md +5/−1 and selene/src/disk_store.rs +2803/−913). The change is that the surrounding PR set moved. New items:
NEW SIBLING PRs, none of which touch #496's files (so no new same-file competitor):
- #498 (FujitsuPolycom, draft, opened 2026-11-24 20:09, head 08f5c8a, +259/−16, 1 file heliopause/src/export/capture.rs): "Flush PCIe D2H tails before completion in Heliopause export downloader". Adds
Downloader::fence+flush_d2h_tail(same-stream HtoD read of ≤64 trailing bytes) before sync/event on all four D2H paths. Claims 63/400,000 corruptions without fence vs 0/400,000 with it, 51.1 vs 51.6 GB/s. Limitations: lib +--ignoredCUDA tests not yet run at 08f5c8a; noNVreg_EnablePCIERelaxedOrderingMode=0control; unrelated to the disk restore path. - #499 (FujitsuPolycom, draft, opened 20:10, head 2dab6ba, +1546/−191, 18 files ignition/helios/docs):
--row-shard-prefillplanning,RebuildManifest.row_shard_prefill = 28, PreparedReduceScatter/GatherShards and auxiliary-stream overlap wrappers in ignition/components/collectives.py. Touches docs/TODO.txt and docs/cli-design.md — not docs/prefix-cache-offload.md, not selene/. - #500 (voipmonitor, opened 20:22, head 974db22, +193/−209): ERNIE 5.5 XML tool/think parsers +
flare::pcie_all_reduce_addend_dep. Unrelated to #496. => Net effect on #496's review: same author now has four open PRs in flight (#496, #497, #498, #499), two of them drafts started ~2h after #496. Context for review load, not a correctness issue for #496.
CONCRETE AMENDMENT to the merge-order claim in the previous report (verified by reading pr/497 and pr/477, pr/486, pr/492):
- #497 does NOT contain #496's refactor. At pr/497, selene/src/disk_store.rs still has
fn pump_inbound(:1673),fn pump_all(:1691) and the textDestination::HostPacked(:1112); searching pr/497's disk_store.rs forSharedSegment|plan_aligned_windows|DeviceInboundreturns nothing. So the two PRs are independent edits of the same region, not stacked commits. - Therefore the "merge #496 first, then rebase #497" instruction costs more than a text conflict: #497 carries
staged_pump_all_prioritizes_inbound_ahead_of_outbound_and_maintenance(pr/497 disk_store.rs:6978, callsstaged.pump_all()at :7061/:7072/:7081) which asserts the pre-#496 singlepump_allorder. After rebasing onto #496 it must be rewritten against the newoutbound -> host_inbound -> pump_device_inboundsplit, i.e. it has to assert host_inbound and device_inbound both run ahead of writes/maintenance. Worth naming as a review item on #496: the inbound-first ordering #497 wants is now two queues in #496, so #496's own pump order is the thing that has to be right. - #477 and #486 still have the old
InboundRecordat selene/src/disk_store.rs:710 and #492 hasInboundRecordat :975 withDestination::HostPacked(:893, :1112, :1206) plusread_into_packed/write_packed. #496 deletedDestinationentirely and rewrote every inbound path, so any of the three compression PRs that merges after #496 must re-target v4 packed restores ontoDeviceInbound/SharedWindow— the packed path has no shared-window equivalent in #496 (noHostPacked, nocompleted_packedin pr/496). That is the concrete conflict risk to state; my earlier note only said "textual conflict in the same file is likely".
AUTOBOT REVIEWS now on the neighbourhood (for consistency of the process picture): #477 has a Changes Requested review (2026-11-24 17:53) with three blockers (containers stop building because selene/native/ is not shipped, multi-host ranks cannot start with compression on because the single-use decoder is bound twice, recovery deletes intact raw records); #486 and #492 were halted by Auto-Review as "low value or does not align with the project charter". #496 still has no review, no CI checks and no labels, so it remains the only Selene disk PR with no automated assessment at all.
#7 [high] Research summary
Amendments only (PR #496 itself is unchanged: still head f9c9191, single commit, no comments, no reviews, no CI).
-
What the new event actually is: nothing moved on #496; the neighbourhood did. Three new PRs opened on 2026-11-24 evening (#498 Heliopause PCIe D2H tail fence, #499 row-shard prefill planning + collectives, #500 ERNIE 5.5 parsers). #498 and #499 are both FujitsuPolycom drafts opened ~2h after #496, and neither touches selene/ or docs/prefix-cache-offload.md, so no new same-file competitor and no new charter evidence for #496 — but it is now one of four open PRs from the same author, two of them drafts.
-
Correction to my earlier merge-order claim, verified by reading the heads: #497 does NOT contain #496's refactor. At pr/497, selene/src/disk_store.rs still has
fn pump_inbound(:1673),fn pump_all(:1691) andDestination::HostPacked; a search forSharedSegment|plan_aligned_windows|DeviceInboundreturns nothing. So they are independent edits of the same region, not stacked commits, and "merge #496 first, then rebase #497" costs more than a text conflict: #497's teststaged_pump_all_prioritizes_inbound_ahead_of_outbound_and_maintenance(pr/497 disk_store.rs:6978, pump_all at :7061/:7072/:7081) asserts the old single-queue order and must be rewritten against #496'soutbound -> host_inbound -> pump_device_inboundsplit. This makes #496's own pump ordering a review item, not just #497's. -
Sharper conflict statement with the compression PRs. #477/#486 keep the old
InboundRecord(disk_store.rs:710) and #492 hasInboundRecord(:975) withDestination::HostPacked(:893, :1112, :1206) plusread_into_packed/write_packed. #496 deletesDestinationand every inbound path, and has no packed-host or shared-window equivalent (no HostPacked, no completed_packed at pr/496). So whichever of the three compression PRs lands after #496 must re-target v4 packed restores onto DeviceInbound/SharedWindow — a semantic port, not a textual conflict. -
Process picture: #477 now has an autobot Changes Requested review (2026-11-24 17:53) with three blockers; #486 and #492 were halted by Auto-Review as low value / off-charter. #496 remains the only Selene disk PR with no automated review, no labels and no CI checks at head.
Everything above is saved in scratchpad entry #6; the earlier report's findings (change description, benchmarks, disclosed 7/9-vs-8/9 at 61.3K, test counts, related work) stand unamended.
#8 [high] Amendments to issue in the final report (2026-11-24, run 236)
The next report must be presented as amendments only (the operator asked: "Output only the amendments, do not re-iterate your entire previous report"). Use these four items verbatim in substance; they replace nothing in entry #5, which stands unamended.
-
What the new event actually is: nothing moved on #496 itself (still head f9c9191, single commit f9c91915, 0 comments, 0 reviews, no CI checks, 2 files / +2808−914). The neighbourhood moved. Three PRs opened on 2026-11-24 evening: #498 "Flush PCIe D2H tails before completion in Heliopause export downloader" (FujitsuPolycom, draft, 20:09, +259/−16, heliopause/src/export/capture.rs only), #499 "recipe-declared row-sharded prefill planning and PCIe DMA / RoCE row-shard collectives" (FujitsuPolycom, draft, 20:10, +1546/−191, 18 files, docs/TODO.txt + docs/cli-design.md, no selene/), #500 ERNIE 5.5 XML tool/think parsers +
flare::pcie_all_reduce_addend_dep(voipmonitor, 20:22, +193/−209). None touches selene/ or docs/prefix-cache-offload.md, so no new same-file competitor and no new charter evidence for #496; but #496 is now one of four open PRs from FujitsuPolycom, two of them drafts started ~2h after it. -
Correction to the merge-order claim. #497 does NOT contain #496's refactor — verified at pr/497: selene/src/disk_store.rs still has
fn pump_inbound(:1673),fn pump_all(:1691) andDestination::HostPacked(:1112); a search forSharedSegment|plan_aligned_windows|DeviceInboundreturns nothing. They are independent edits of the same region, not stacked commits. So "merge #496 first, then rebase #497" costs more than a textual conflict: #497's teststaged_pump_all_prioritizes_inbound_ahead_of_outbound_and_maintenance(pr/497 disk_store.rs:6978;staged.pump_all()at :7061/:7072/:7081) asserts the old single-queue order and must be rewritten against #496'soutbound -> host_inbound -> pump_device_inboundsplit. Consequence: #496's own pump ordering is a review item in its own right, not just a rebase chore for #497 — the inbound-first ordering #497 wants is two queues after #496. -
Sharper conflict statement with the compression PRs. #477 and #486 keep the old
InboundRecord(selene/src/disk_store.rs:710); #492 hasInboundRecord(:975) plusDestination::HostPacked(:893, :1112, :1206) andread_into_packed/write_packed. #496 deletesDestinationoutright, rewrites every inbound path, and has no packed-host or shared-window equivalent (no HostPacked, no completed_packed at pr/496). Whichever compression PR lands after #496 must therefore re-target v4 packed restores onto DeviceInbound/SharedWindow — a semantic port, not a textual conflict. This supersedes the softer "a textual conflict in the same file is likely" wording in entry #4. -
Process picture around it: #477 now has an autobot Changes Requested review (2026-11-24 17:53) with three blockers (container images stop building because selene/native/ is not shipped; multi-host ranks cannot start with compression on because the single-use decoder is bound twice; recovery deletes intact raw records). #486 and #492 were halted by Auto-Review as "low value or does not align with the project charter". #496 remains the only Selene disk PR with no automated review, no labels and no CI at head — so the review gap is now conspicuous rather than merely early.
#2 [medium] Change: docs/prefix-cache-offload.md section 2.4 edit
docs/prefix-cache-offload.md, +5/−1, at the paragraph describing Staged in section 2.4 (the Disk transport). Added text: "Concurrent fetch jobs reading the same record file share one open file handle and coalesce aligned 64-page windows while staged so one disk read fans out to each attached fetch's GPU upload before its staging slots are released; caller-owned read_into reads run independently." Previous sentence about read_into moving records between files and caller-owned registered slots kept. This matches the description's claim that section 2.4 is updated. No other doc touched (AGENTS.md, design-review docs untouched).
#9 [medium] Coverage this run: every angle re-checked, no other changes found
Angles re-checked for the amendment pass (all confirm the run-235 findings rather than changing them):
- PR body / description: unchanged (read_item 496, updated 2026-11-24 18:13, same benchmark table, same 7/9-vs-8/9 61.3K disclosure, same "measured before the linear demand-index and close-count edits" caveat).
- Comments and reviews:
pr_comments= "No comments"; no inline reviews. - Commits:
search_historyat pr/496 still shows only f9c91915 on top of main; main has since gained c0c4f798 ("Remove redundant RegistryDwords EnableResizableBar check in flare doctor", unrelated file flare-cli/src/doctor.rs) — the only main-side commit after #496's base 425ab2d4 that is not already in the reported history, and it does not touch selene/ or the doc. - Files:
pr_files= docs/prefix-cache-offload.md (+5/−1) and selene/src/disk_store.rs (+2803/−913), unchanged; docs diff still the section-2.4 paragraph only. - Same-file competitors:
items_touching selene/src/disk_store.rsanddocs/prefix-cache-offload.md— #497, #477, #486, #492 still the only open ones; #498/#499/#500 do not appear. - New same-day items scanned: #494 and #495 (scheduler fixes, autobot reviews), #491 (collectives), #498, #499, #500 — none touches Selene disk restore.
- Lead judged not relevant: #498's PCIe D2H tail-fence bug is real corruption in Heliopause export under Relaxed Ordering, but it is the export downloader path, not the Selene staged restore path, and #496 does not change D2H copy semantics; noted so the report can say the lead was followed and dismissed.
- Also not relevant: #492's own text was previously read as a same-file conflict; it is, but only via the packed-host restore path described in entry #6 item 3. Nothing in the charter, the doc, or the tests changed for #496, so the run-235 body (change description, benchmark claims, uncovered areas, related work) needs no rewrite — only the additions in entry #6.