Opened by a workflow run, Nov 24, 2026 3:16 PM EST.
screen malicious
Screen Result: All Clear
Evidence:
- No prompt injection in either changed file: injection phrasing ("ignore previous", "system prompt", "you are an AI/agent", "do not report", "all clear", "instruction", "IMPORTANT/NOTE TO/REVIEWER") has no matches in
selene/src/disk_store.rsor thedocs/prefix-cache-offload.mdhunk at PR headf9c9191. - No hidden or encoded content: zero-width/BOM characters, HTML comments,
\u{..}/\xNNescape blobs and 70+ char base64-like tokens all return nothing in the changed files. - No agent-directed or exfiltration capability in the diff: no
Command::new,net::/TcpStream/UdpSocket,reqwest,std::env, credential or agent-config references (AGENTS,CLAUDE,.mcp,.ssh,.env). The only hits arestd::process::id()atselene/src/disk_store.rs:4099(test temp dir) andfs::writeat ~6356/7233/7301 (test fixtures). - The PR has no conversation at all (
pr_comments: "No comments."), so no instruction arrived via comments, reviews or inline review comments; no CI, labels or reviewers. - The long description (benchmark tables plus a "merge this PR first, then rebase #497" note) is maintainer-facing engineering prose; it contains no directive addressed to an automated reviewer and asks for no action by an agent.
- The full ~162k-char diff is genuine concurrency work — host vs device inbound split, aligned 64-page window planning, ref-counted shared segments/windows,
pump_device_inboundpasses, test-support counters and seven tests — with ordinary comments and no smuggled behaviour. - Context is unremarkable for the area: author FujitsuPolycom is a repo CONTRIBUTOR with 10 PRs in 180 days (2 merged) and companion PR #497 in the same file;
selene/srcanddocs/are under active development.
Open questions: none material. Test-support counters and the benchmark numbers in the description were not independently verified — a correctness/performance question, not a security one, and out of scope for this screening.
PR #496 screening report — "Coalesce shared ancestor reads across concurrent Selene disk fetches"
Screen result: All Clear. No prompt injection, no hidden instructions, no agent-directed content, and no malicious or exfiltrating code were found in the pull request's changes, its description or its conversation.
Key findings
- No injection text anywhere in the changed surface. Phrase scans for "ignore previous", "system prompt", "you are an AI/agent", "assistant", "do not report", "all clear", "malicious", "instruction", "jailbreak/override/disregard" and "IMPORTANT / NOTE TO / REVIEWER / LLM / AI AGENT" produce no matches in
selene/src/disk_store.rsor thedocs/prefix-cache-offload.mdhunk at headf9c9191. - No hidden or obfuscated content. Zero-width/BOM byte sequences,
<!-- ... -->HTML comments,\u{...}/\xNNescape blobs and[A-Za-z0-9+/]{70,}={0,2}base64-like tokens return no matches in the changed files. - No capability that could act on the agent's behalf. The diff contains no HTTP/URL fetching, no
Command::new, nonet::/TcpStream/UdpSocket/UnixStream/reqwest, nostd::env, and no reference to credentials or agent configuration (AGENTS,CLAUDE,.mcp,.ssh,/home/,/root/,.env,.github/workflows). The only process/filesystem hits are ordinary test scaffolding:std::process::id()in a temp-dir name atselene/src/disk_store.rs:4099, andfs::writetest fixtures at approximately lines 6356, 7233 and 7301. - The PR has no conversation.
pr_commentsreports "No comments." — no reviews, no inline review comments, no CI checks and no labels. There is therefore no channel in this PR through which an instruction to an agent could have been delivered. - The description is long but benign. It contains benchmark tables and a merge-ordering note for companion PR #497 ("Merge this PR first, then rebase #497"). That is normal maintainer-facing coordination; it addresses humans merging code and contains no directive to an automated reviewer, no request to suppress findings, and no claim the review should be skipped.
- The diff itself is genuine engineering. The whole ~162k-character diff was read in pages: it splits host (
HostInbound) and device (DeviceInbound) inbound paths, adds aligned 64-page window planning (plan_aligned_windows), reference-countedSharedSegment/SharedWindowstructures with followers, thepump_device_inboundpasses, test-support counters, and seven new tests. Comments are ordinary engineering prose; no test smuggles privileged behaviour and no code path reaches outside the disk-restore subsystem. - Nothing anomalous about provenance. The author (FujitsuPolycom) is a repository CONTRIBUTOR with 10 PRs in the last 180 days (2 merged) and a companion PR #497 in the same file;
selene/srcanddocs/are under very active development by several maintainers. This looks like exactly what its title says.
Prompt injection attempts
Nothing found.
No text in the changed files, the PR description or the (empty) conversation is phrased as an instruction to a model or agent. Searches for the usual markers — "ignore previous", "disregard", "system prompt", "you are an agent/AI", "do not report", "all clear", "malicious", "instruction", "jailbreak", "IMPORTANT", "NOTE TO", "REVIEWER", "AI AGENT", "LLM" — matched nothing in selene/src/disk_store.rs or the changed hunk of docs/prefix-cache-offload.md at ref pr/496.
Hidden or obfuscated content
Nothing found.
- Zero-width characters and BOMs (
\xe2\x80\x8b, BOM patterns): no matches. - HTML comments (
<!--,-->): no matches. - Escape sequences (
\u{,\xNN): no matches. - Long base64-like blobs (
[A-Za-z0-9+/]{70,}={0,2}): no matches. - Non-ASCII scan: only legitimate line-number and identifier text; no smuggled prose or encoded payload.
Malicious or agent-directed capability
Nothing found.
The change is confined to the Selene disk-restore path. Negative checks at ref pr/496: http, curl, base64, eval(, exec(, api_key, token=, net::, TcpStream, UdpSocket, UnixStream, reqwest, Command::, std::env, HOME, AGENTS, CLAUDE, .mcp, .github/workflows, credentials, ssh, /home/, /root/, .env, include_str!, include_bytes!, unsafe, extern crate. The only hits are:
std::process::id()atselene/src/disk_store.rs:4099— test-only temp directory naming.fs::writein tests at approximatelyselene/src/disk_store.rs:6356,7233,7301— writing fixture records inside tests.
No network egress, no credential access, no write outside test temp dirs, no unsafe, no build-script or CI-hook manipulation.
Description-versus-code consistency and claims
The documentation hunk (docs/prefix-cache-offload.md, section 2.4 "The three stores", lines 335-342) adds a sentence stating that concurrent fetch jobs on the same record file share one open handle and coalesce aligned 64-page windows, while caller-owned read_into runs independently. This is consistent with the code: the counters disk_opens / disk_window_reads / coalesced_windows at selene/src/disk_store.rs:192-200, plan_aligned_windows near line 697, the SharedSegment/SharedWindow structures around lines 1000-1100, and the pump_device_inbound passes around lines 1446-2200 implement exactly that split.
The description's benchmark and live-validation numbers were not independently verified; that is a performance/correctness matter for the reviewers, not a security finding, and is out of scope for this screening.
Context and related items
Companion PR #497 by the same author touches the same area (Staged::pump_all) and is discussed openly in the description's merge-ordering note. Related open PRs #477 and #486 and merged PRs #455, #429, #415, #416, #413 touch the same files, so heavy churn in selene/src/disk_store.rs and docs/prefix-cache-offload.md is expected. The author is a repo CONTRIBUTOR with 2 merged and 8 open PRs in the last 180 days. Nothing about the provenance or the surrounding activity suggests an attempt to manipulate a reviewing agent.
Open questions and what could not be found
- No injection, hidden content or malicious capability was found; no gaps in the negative scans were identified that would change the verdict.
- Not verified: the benchmark and correctness claims in the description (physical NVMe read reductions, TTFT medians, 474-test run, live SM121 matching). These are claims about performance and correctness, not about agent safety.
- Not in scope: reviewing the concurrency logic of the coalescing implementation for correctness. The code was read end to end only to the extent needed to confirm it is genuine engineering work rather than a vehicle for injected instructions or hidden behaviour.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR; Discord: Dooner) Motivation: Concurrent restores that share a disk-resident ancestor each re-open the same record file and re-read/re-verify the same 64-page windows, so the same bytes are pulled off NVMe once per branch. This PR makes concurrent GPU restores share one open file handle and one staged window per aligned window so a single disk read feeds every attached fetch. Scale: +2808 / −914 lines in 2 files Proposal:
- Split the single inbound pipeline into
HostInbound(caller-ownedread_into) andDeviceInbound(Staged::fetch), deletingInboundRecordand theDestinationenum - Add
SharedSegment(one disk-thread open per(path, Header), 5-state machine) andSharedWindow(one staged 64-page window per aligned range, ref-counted for disk read and GPU upload) underStaged - Align device restore segments on absolute 64-page (
WINDOW_PAGES) file boundaries via newplan_aligned_windowsinstead of each restore's own first uncached page - New 5-pass
pump_device_inboundscheduler with a per-pump linear pending-demand index that lets a later arrival attach to windows siblings also need - Failure isolation (window failures fail only followers, shared open/read failures fail all users),
test-supportcounters, and a 5-line section 2.4 doc update Touches: - selene/src/disk_store.rs — the whole
Stagedtransport, inbound scheduling, ref counting, close/drain semantics - docs/prefix-cache-offload.md — section 2.4
Stagedparagraph only - (test-support surface)
Staged::in_flight(),close()abandoned accounting, three new counters Related items: - #497 Reduce disk offload restore latency and integrated-memory intake overhead (open): named companion; must rebase after #496, and it is NOT stacked on it
- #477 Compress host checkpoints at Selene write-back and decode them on restore (open): same file, keeps the deleted
InboundRecord/Destination - #486 Compress Selene checkpoints at rest with predictor + Zstandard (open): same file, same stale structures
- #492 VRAM-to-DRAM lossless KV compression (open): same file plus the packed-host restore path #496 removed
- #498 Flush PCIe D2H tails before completion in Heliopause export downloader (open): same author, same evening, unrelated path (lead followed, not relevant)
Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Autobot comments: PR #496 itself has not moved since the last report (head f9c9191, one commit, 0 comments, 0 reviews, no CI, no labels). The amendments: (1) #497 does not contain this refactor — at pr/497
disk_store.rsstill haspump_inbound/Destination, so "merge #496 first" is a semantic rewrite of #497's inbound-firstpump_alltest, not a rebase chore. (2) Contrary to the description's framing, #496's ownpump_allstill submits maintenance (unlinks/truncates) before outbound, host_inbound and device_inbound, so it does not itself deliver the inbound-first ordering #497 wants. (3) #496 has no packed-host/shared-window equivalent, so #477/#486/#492 must port v4 packed restores ontoDeviceInbound/SharedWindow— a semantic conflict, not a textual one. (4) The disclosed 61.3K regression (8/9 on main vs 7/9 here) plus benchmarks taken before the demand-index and close-count edits remain the only quantitative evidence, and the new siblings (#498/#499/#500) add no same-file competitor and no charter evidence.
Value Proposition
PR #496 — Coalesce shared ancestor reads across concurrent Selene disk fetches
Verdict: worth merging, with changes
The problem is real, it sits in the layer the charter says it belongs in, and on this project's target hardware the win is large (reported 3.5–4.2× fewer physical NVMe bytes on concurrent shared-ancestor restores, −16% / −20% median TTFT on the 27B TP1 burst). But the change is ~1,000 net new lines of reference-counted pipeline state in one already-8.8K-line file, with two unmeasured edits and an unmerged companion PR in the same function. It should not land in its current state; it should land after the items under "What must change" below.
Charter fit — good
- Goal, not a non-goal. Goal 4 is "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene." This is a pure
seleneruntime change (one file, plus one docs paragraph); no new format, no new model branch, no new flag, no new re-export. That matches "keep the runtime small and model-agnostic." - Right place. The duplication lives in
Staged::fetch(selene/src/disk_store.rs), where each branch submits its own ticket. Helios already dedups tickets per key (helios/src/scheduler.rs:1668-1691) anddocs/prefix-cache-offload.md:318-319already promises "an inbound for a key already in flight attaches the request as another waiter" — so the shared work being repeated below that boundary is precisely the gap. Not a wrong-layer fix. - Evidence rule (#210). Satisfied in kind: before/after on a served workload (
flare run,/v1/chat/completions, TTFT +flare_host_cache_inbound_bytes_per_second), four topologies, cold-VRAM restart, correctness spot-checks attemperature = 0. This is far more than most performance PRs bring.
Who benefits, and how much
Benefits: anyone running concurrent agent/branching traffic against a disk-resident shared prefix, i.e. the headline use case ("long conversations, coding agents, heavy tool use") on SM121/DGX Spark with --prefix-cache-memory 0 --prefix-cache-disk.
| Workload (author's GB10 numbers) | Physical read | Median TTFT |
|---|---|---|
| 27B-NVFP4 TP1, 4 branches, simultaneous | 18.03 → 4.29 GB (4.21×) | 8484 → 7112 ms (−16.2%) |
| 27B-NVFP4 TP1, 4 branches, +25 ms stagger | 18.09 → 4.56 GB (3.97×) | 8200 → 6539 ms (−20.3%) |
| Flash-Next TP1 / TP2 | 7.9→2.0 GB, 8.4→2.1 GB | −0% / −2.5% / −4.5% / −6.9% |
| DeepSeek-V4.1 TP4, 4 hosts @47K | 1.00× | −1.1% (no overlap window) |
Read honestly: the bandwidth win is uniform and large; the latency win is concentrated where a single disk thread is the bottleneck (27B TP1). On Flash-Next, simultaneous arrival reads 76% less and TTFT does not move at all (3333.5 → 3337.1 ms) — worth stating plainly, because it means the value is "less NVMe/fewer opens, and a burst-latency win on the heaviest model," not a general speedup.
Who does not benefit: single-stream restores (no sibling to share with), CompositeStore/read_into callers (explicitly kept on the old private path), and pool (PooledStore) serving. No regression is claimed for them beyond the described per-pump cost, and busy()/close() accounting was extended to the new maps (disk_store.rs:2344), so idle and shutdown paths stay correct.
Is there a simpler way?
I looked for one; there isn't a good one:
- Fan out via
copier::Job::replication(selene/src/copier.rs:31-40) — replication is for "one verified share reused by every local rank," not one host window feeding several different GPU page ids across different requests. It doesn't remove the duplicate disk read, which is the actual cost. - Serve shared prefixes from host memory instead of staging from disk — on these prefixes (~61K tokens × ~4.19 MB/page ≈ 4 GB per copy, author notes ≈28 GB across the 8-request burst) that is exactly what
--prefix-cache-memory 0exists to avoid on a 128 GB Spark. Not a substitute. - Dedup higher up, in the scheduler, on the ancestor checkpoint — tickets are per-key and each branch needs its own page range into its own snapshot slot, so one ticket can't serve them; this PR is the narrowest place the bytes can actually be shared.
Nor is it duplicating an existing mechanism: the only sharing that exists today is per-key ticket attachment, documented at docs/prefix-cache-offload.md:318-319.
What it costs
Implementation complexity (the main concern). Nominal diff is +2803/−913, but roughly 900 lines of that is the DiskStore block relocated within the same file, so the real addition is ≈1,000 lines of new production code and ≈500 of tests. The new state machine adds SharedSegment/SharedSegmentId, SharedWindow/SharedWindowId, SharedFileState (5 states), SharedWindowPhase, WindowFollower, PlanState, DeviceActiveWindow, DeviceSegmentRef, DeviceInbound, and an 8-pass pump_device_inbound (disk_store.rs:1811) with ~12 helpers (acquire_shared_segment:1362, find_reusable_window:1568, find_best_existing_window_for:1602, build_pending_demand:1647, pick_next_pending_plan:1684, detach_unwinding_windows:1726, sweep_shared_windows:1755, segment_needs_disk_reads:1773, fail_segment_users:1449, fail_window:1475, apply_shared_disk:1489, apply_device_transfer:1548). It is spelled out and commented well, and the invariants I spot-checked hold — disk::Reply is per-job FIFO (selene/src/disk.rs:447-455), so the pending_row_reads FIFO is sound even though ReadRow replies carry window: 0; and Pass 5e (2205-2255) correctly delays Fetched until the last user's segment settles, because the index pin is released on Fetched (3609-3615). But this is now three concurrent pipelines (host, device-shared, outbound) plus an owners map in one file, and that file was already 6,976 lines on main.
Performance of the non-beneficiary paths. Dispatch cost is paid by everyone: find_reusable_window/find_best_existing_window_for scan all shared windows per pending plan, acquire_shared_segment scans all segments per fetch, and build_pending_demand (1647) clones PathBuf + Header into a fresh HashMap on every pump while free slots exist. Pumps run at the worker's 2 ms idle / 100 µs pool-wait cadence (helios/src/server/runtime.rs:1187-1201), so this is small in absolute terms — but on single-restore workloads it is pure overhead for zero gain, and the author concedes single-pass benchmarks were not re-run after this edit. A cheap fix: skip the demand rebuild unless device_inbound.len() > 1 (already partially there) and cache it across pumps.
Shared risk surface (intentional, but real). One shared record_read error now fails all attached restores, and a coalesced window holds its SlabPool slots until the slowest follower's GPU upload finishes. With WINDOW_CREDITS = 2 (selene/src/shared/limits.rs:18 (not opened)) that briefly pins staging slots to the slowest sibling, and pick_next_pending_plan deliberately prefers windows siblings also want — i.e. it trades fair round-robin ordering among concurrent fetches for synchronization. Both choices are defensible; neither is documented in docs/prefix-cache-offload.md, and the failure coupling changes the blast radius of a corrupt record from one request to a cohort.
Maintenance/process risk. The PR is one file away from a conflict with the author's own companion #497, which rewrites Staged::pump_all ordering — the exact function #496 extends (disk_store.rs:2268). The author says "merge this PR first, then rebase #497," which is sensible, but it means the reviewed shape of pump_all is not the shape that ships. Also note the report glosses two TTFT deltas (e.g. "8,200.0 -> 6,539.0 ms (-20.3%)" reads as −1,661 ms; the parenthetical in another row sums two rows), so the numbers should be re-derived, not quoted.
Tests / evidence—adequate to good, with gaps
Strong: plan_aligned_windows misalignment cases, byte-exact SimulatedGpu page + row verification for two tickets with different skip_pages, simultaneous and staggered coalescing with counters disk_opens/disk_window_reads/coalesced_windows (disk_store.rs:1227), private child-vs-upload failure isolation (8580), shared record_read propagation with slot/pin leak assertions (8692), and Staged::close drain (8789). These run in CI (selene with --features test-support, .github/workflows/native-serving.yml:51 (not opened)). One fragility: the staggered test asserts exact totals (coalesced_windows() >= 2, disk_window_reads() + coalesced_windows() == 10, 8444-8445) on real disk-thread timing — it passed on Linux and Windows IOCP once, and is a flake risk under load.
Gaps the author honestly lists and that matter for the verdict: single-pass SM121 runs not repeated after the linear demand-index and close-count edits; helios with FLARE_RUN_CUDA_TESTS=1, discrete PCIe GPUs, Windows serving, and live CompositeStore/PooledStore GPU serving not run. Since this touches the hot restore path for every disk-only deployment, at minimum one re-measured SM121 pass on the final commit is needed before merge.
What must change before merge
- Re-run the SM121 27B TP1 burst (simultaneous + staggered) and the Flash-Next TP2 point on the exact commit to be merged, and report
disk_opens/disk_window_readsalongside physical bytes. The load-bearing claim is −16% to −20% TTFT on the flagship model; it must not be a stale number. - Make the demand index cheap: only build
pending_demandwhen there is true sibling overlap, and reuse it across pumps rather than reallocatingPathBuf/Headerkeys per pump, so single-restore workloads pay ~nothing. - Document the two behavioral trade-offs in
docs/prefix-cache-offload.md§2.4 (beyond the current +5 lines at337-343): one shared read error fails every attached restore, and sibling-attachment preference relaxes fair ordering among concurrent fetches. - State the latency result honestly: bandwidth 3.5–4.2×; TTFT −16%/−20% on 27B TP1, ≈0% to −7% elsewhere, 1.00× on DeepSeek TP4. Fix the two arithmetic slips in the Result table.
- Sequence with #497 explicitly: rebase #496 onto
main, land it first, then rebase #497 sopump_allordering (host_inbound→pump_device_inbound→ writes → maintenance) is reviewed as it will ship. - De-flake the staggered test (assert
>= 2coalesced windows and a read-count bound, not an exact total that depends on disk-thread timing). - Optionally, split the
DiskStorerelocation into its own commit so the reviewable delta is the coalescing logic, not a 900-line move.
Bottom line
Worth it with changes. It solves a genuine, measured, charter-aligned bandwidth problem in the right layer and with the right instincts about failure isolation, but it buys a 3.5–4.2× read reduction with ~1,000 lines of concurrent state in the most delicate file in selene, on evidence that predates the last two edits of the same code, next to an unmerged companion PR touching the same function. Land it after items 1–6; if item 1 comes back confirming the burst TTFT win, this is clearly worth merging.
(Note: the only conversation on the PR is an automated case-file comment from flare-autobot — no instructions to me, no human review yet.)
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Prose
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:228-234: the rustdoc "Slots for
pagespage records and, whenrow, all row pieces…" sits above the newfn free_slots(&self) -> usize, sofree_slotsis documented as takingpages/rowand returningNone;allocate(line 234) is left undocumented. - PR description, Evidence: "
8/9(main) vs7/9(this PR) at61.3K" reports a deterministic score drop with no conclusion (defect, recipe clamp, or noise), which AGENTS.md item 4 requires the author to explain. - PR description, end of Result: "Existing users pay per-pump demand indexing … at most one extra window split …" states unmeasured costs beside a measured table, contrary to AGENTS.md item 3 and the prose skill. Nits: 2 (benchmark table measured on a pre-head tree with the disclosure in parentheses; docs 2.4 "aligned 64-page windows" never says aligned to what) Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Simplicity
Verdict: clean Blocking:
- None. Should fix:
- None. Nits: 8 (each with a smaller version below) Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Eight simplicity nits, none behavioural: a host inbound read modelled as a one-element Vec<Segment> with an always-zero segment index (disk_store.rs:258,759-770,1285); PlanState::Done (1093-1098) that no branch distinguishes from Active — every read is != Pending; SharedWindow.path/expected (1073-1074) duplicating its SharedSegment (1024-1025) and cloned per window (1966-1967) plus three id fields duplicating their map keys; two parallel window planners after plan_windows dropped to one caller (672-695 vs 700-738, caller at 1283); three test-only counters in the always-compiled Resources with #[cfg_attr(... allow(dead_code))] (192-200) where selene/src/disk.rs:104-116 gates Faults outright; the triplicated needs_credit closure and doubled attach loop in pump_device_inbound (1847-1852 / 1876-1881, 1845-1861 / 1874-1903); and one 60-word doc sentence for three behaviours (docs/prefix-cache-offload.md:337-342).
Description vs code: "Existing users pay per-pump demand indexing when free slots exist" is not quite what the code does — build_pending_demand returns early when device_inbound.len() <= 1 (1651-1653), and pick_next_pending_plan takes the layout lock on every call (1691-1695); the single-fetch path is worth confirming.
Open question: the +2803/−913 is large but the host/device split is the minimum that keeps read_into unshared (read_into's behaviour is unchanged, 1268-1297, 875-996); the multi-pass pump shape carries per-pass ordering arguments (1842-1844, 1863-1868, 2119-2121), so I did not call the size churn under AGENTS.md's rejection criteria. Whether plan_aligned_windows can replace plan_windows for host reads (only test 6221-6253 asserts split points) is the one deletion I would ask the author about.
Conventions
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:700:
plan_aligned_windowsis a near line-for-line copy ofplan_windows(:672), withselene/src/memory.rs:1336 windows()a third copy of the same splitter; the file-boundary clamp is the only difference. - selene/src/disk_store.rs:1368 / :1578 / :1647–1677 / :1890 / :1996: the shared-window identity
(path, expected Header, first, count, row)is re-expressed five times with no shared key type, and the demand map nestsVec<(Header, usize)>scanned linearly per plan. - selene/src/disk_store.rs:1668 / :1710 / :1890:
PathBufis cloned per pending plan per pump, andfind_reusable_window(:1576) scans every window for every plan; the PR already addedpending_page_readsas the indexed precedent. Nits: 5 — test-fixture placement/4-tuple inGatedCopier(:8051), test-only counters compiled into release behindallow(dead_code)(:192–200) instead of thecfg(any(test, feature="test-support"))gating used at selene/src/disk.rs:309/:321/:437 and missing fromStoreStats(selene/src/store.rs:185),closecounting non-jobs as "disk transport jobs" (:2485), naming axis mixingHostInbound/DeviceInboundvsHostWindow/SharedWindow(:746/:759 vs :1070/:1117), and doc prose (:337–342, module doc :14–21) omitting the immutability/pin invariant that makes the coalescing valid. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Open: whether plan_windows and memory.rs::windows can converge on one alignable splitter; whether Header could expose a Hash/digest key to index windows; whether the new counters should reach /metrics via StoreStats. Not runnable here (no toolchain/GPU), so all of this is from code reading only.
Architecture
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:1829 (+1530, 3626-3628): each follower credits the whole window's
read_bytesto its own record, sostats.bytes_instays logical while physical reads fall up to 4.2x;inbound_rate— the basis ofhit().estimated_seconds(3587) — is inflated toward the coalescing factor. - selene/src/disk_store.rs:8-24: the module contract still promises "at most
WINDOWS_IN_FLIGHTwindows of one record staged" and "Nothing here waits", which the new shared-segment/shared-window protocol (2205-2255) no longer holds; a substantial new ownership lifecycle in shared cache code needs explicit maintainer design sign-off (AGENTS.md:188-206, design-review.md:64-68). - docs/prefix-cache-offload.md:337-342: states coalescing unconditionally (no caveat that released windows are re-read by later arrivals, no extra partial window when
skip_pages % 64 != 0) and still cites signatures that do not exist (write_from(key, metadata, buffers),read_into(key, buffers)). Nits: 2 — SM121 single-pass numbers predate the demand-index/close-count edits the PR itself lists as uncovered; coalescing counters (disk_opens,disk_window_reads,coalesced_windows, lines 192-200, 1213-1236) exist only undertest-support, so no production or qualification run can show the mechanism working or its metering. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Correctness
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:1829 (+1530, 3626, 3628, 3587): each follower credits the whole shared window's bytes, so
stats.bytes_inandinbound_rateare fed logical bytes over a coalesced wall time — the measured rate inflates by up to the fan-out, andworth_fetching(selene/src/store.rs:423-438) then under-prices fetches that will not be coalesced. - PR description "Evidence"/"Live SM121 checks": the PR's own accuracy check shows Qwen3.8-27B 61.3K, 9-fact retrieval
8/9on main vs7/9with this PR attemperature = 0; no cause is given and the coalescing tests only assert byte-exactness of the pages they generate, so a data-path regression in the new shared-window path is not excluded. Nits: 1 — selene/src/disk_store.rs:2485-2489Staged::closeabandoned count iscount.max(busy() as usize), so a drain held only byowners/shared_segments/shared_windowsreports "1 disk transport jobs did not complete" instead of the previousowners.len(). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
code review summary
Recommendation: Changes Requested
The approach belongs in the repo — a measured, served-workload win with no new flags, no format change, failure isolation preserved, and the shared-window lifetime work holds up. One result in the PR's own evidence must be settled first; the rest is metering, docs and duplication.
Blockers:
- Settle the 61.3K retrieval result or declare it inconclusive. The description reports 8/9 on main vs 7/9 at head on a temperature=0 retrieval prompt and draws no conclusion. Re-run several times on both revisions, report variance and the differing fact; if the gap holds, fix it — the narrow plausible site is
plan_aligned_windows' offset/row mapping for a follower attaching to a window it did not create.
Should fix:
inbound_rateis now measured on logical bytes and the error does not decay. Every follower credits the whole shared window to its own record (:1829), so the sample divides coalesced elapsed time into a ~4x byte count;hit()prices restores off it (:3587) andworth_fetchinggates on it (store.rs:423-438), andRateonly decays below its seed (levels.rs:69-76). Sample once per physical window; keepbytes_inlogical and documented; add a 1-vs-8-restore rate test.- Docs and rustdoc claim more than the mechanism. §2.4 (docs:337-342) needs the two limits the description discloses, the immutable+pinned invariant,
WINDOW_PAGESfile-boundary alignment, and the realwrite_from/read_intosignatures; the module doc still says "at mostWINDOWS_IN_FLIGHTwindows" and "Nothing here waits" (disk_store.rs:14-24); theallocaterustdoc now sits onfree_slots(:228-234). - Benchmark predates head; expected costs are stated as results. Re-run one simultaneous and one staggered TP1 trial at f9c9191 (or label the table's commit), and mark "existing users pay per-pump demand indexing…" as an expected bound that applies only to multi-fetch pumps (:1651-1653).
- One planner, one window key.
plan_aligned_windows(:700) isplan_windows(:672) plus one clamp; the sharing key(path, header, first, count, row)is hand-written five times (:1368, :1578, :1647, :1710, :1890/:1996). Name itWindowKeyand index it — that also removes the per-pumpPathBufclones and the O(windows×plans) scan. - De-duplicate the attach loop and record the design call. Pass 2 and Pass 4 repeat the credit predicate and attach loop (:1845-1861, :1874-1903) — extract
has_window_credit/attach_pending; and get recorded maintainer sign-off for putting a second inbound lifecycle insideStagedrather than in the disk thread that already owns the handle.
Nits:
4 nits — Staged::close counts leaked windows into "N disk transport jobs did not complete" (:2485-2489); test-only counters use allow(dead_code) instead of cfg(test) and live outside StoreStats (:192-200); dead state (PlanState::Done, single-element Vec<Segment>, duplicated window fields/ids) and a positional 4-tuple GatedCopier; naming-axis mixing plus a 60-word doc sentence.
Full evidence, per-angle detail and the list of what was checked and found sound are in the case file.
Pre Test Report
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches"
Decision: DO NOT refer to hardware testing yet. The change is charter-aligned and worth landing, but three substantive items must be resolved first, and any of them can change the code that would be exercised. Testing now would spend cn7 time on a tree that will be rewritten, and one of the required re-runs (the 61.3K accuracy check) is exactly what a test engineer would otherwise be asked to discover. A minimal plan is given below for use once the items are fixed — it is small (≈2–3 h on cn7).
Head f9c9191, 2 files (+2808/−914): selene/src/disk_store.rs, docs/prefix-cache-offload.md. Author: FujitsuPolycom. No human reviews yet; no CI. Security screen: all clear.
Why not yet — substantive items (each needs a code or claim change, not a nit)
-
Unaffected-looking but real: byte accounting conflates logical and physical bytes, and that feeds admission. Verified in code at head:
SharedWindow.read_bytesaccumulates the physical reply bytes once (selene/src/disk_store.rs:1530), but every follower adds the whole window to its own record (:1829record.bytes += win.read_bytes;), and that logical count becomes theOkpayload ofTransportEvent::Fetched(:2235), which drivesself.stats.bytes_in += bytesandself.inbound_rate.observe(*bytes, job.started.elapsed())(:3626,:3628).inbound_rateis not a statistic:DiskStore::hit()prices restores withbytes / self.inbound_rate.get()(:3587), and Helios gates admission onworth_fetchingagainst that estimate (helios/src/server/runtime.rs:2772,helios/src/runtime_core/../store.rs:423-438(not opened)). Under the concurrent bursts this PR targets, the observed rate inflates by roughly the fan-out, so a lone later request — which will not be coalesced — is under-priced and may be restored when prefill would have been cheaper. Converselystats.bytes_incannot show the 4× physical-read saving the PR claims, even thoughdocs/prefix-cache-offload.md:1501-1502tells operators to read bandwidth from store counters. Fix: observe the rate on physical window bytes (count each window once at completion), keepbytes_inas the logical restored-bytes counter, and document the distinction in §2.4/§4. This is a behaviour change the description does not mention, and testing it before it is fixed would only measure a number that is about to change definition. -
The PR's own end-to-end check regressed and is left unexplained.
8/9onmainvs7/9with this PR, Qwen3.8-27B TP1 at 61.3K,temperature = 0, 9-fact numerical retrieval (PR description, "Live SM121 checks"; DeepSeek TP4 is9/9at 23.1K and 47.1K, 30.1K is9/9on both, so the Qwen 61.3K point is a visible outlier). This is the only evidence that exercises the new shared-window fan-out on real model state, and it is the one that got worse. Either it is a real defect inplan_aligned_windows(:700-738) / follower attachment for non-64-alignedskip_pages, or the harness is noisy — the description must say which, and the author has the machine. Note the new tests assert byte-exactness only for the pages they generate;selene/src/disk_store.rs:8468-8570covers a follower attaching withskip_pages = 10(good), but nothing covers a follower attaching to a window another restore created after a partial trailing chunk with the row, which is the suspect region. Sending this to a test engineer would be outsourcing a correctness question the author can settle in one run. -
The performance evidence predates the code under review. The table was measured before the linear demand-index and close-count edits, both of which change the attach/scheduling path that produces the sharing; the description discloses this in a parenthesis only.
AGENTS.md:103-112anddocs/design-review.md(not opened) principle 16 require the claim to be tied to the artifact tested. A hardware test cannot validate a number attributable to a different tree — re-run at head first.
Secondary but worth fixing before the same pass, because they are cheap and touch the same paragraph (none of these alone would block testing): the module doc still promises "at most [WINDOWS_IN_FLIGHT] windows of one record staged at a time" and "Nothing here waits" (selene/src/disk_store.rs:14-24), which the new shared-segment/shared-window protocol with settle-before-Fetched no longer holds; docs/prefix-cache-offload.md:337-342 states coalescing unconditionally (no caveat that released windows are re-read by later arrivals, no extra partial window when skip_pages % 64 != 0) and keeps signatures that do not exist (write_from(key, metadata, buffers) vs the real write_from(id, header, temporary, path, pages, row, sums) at :1242, read_into(id, path, expected, first_page, pages, row) at :1268); and the rustdoc for allocate now sits above fn free_slots (:228-232), documenting the wrong function.
Architecture question for the maintainer (not a test question). Two of three lenses flag the same point: this replaces Staged's single inbound lifecycle with two lifecycles inside shared cache policy (five new lifecycle types, a five-state file machine, two refcounts per window, out-of-order plan completion) in an 8.8K-line file, and plan_aligned_windows (:700) is a near copy of plan_windows (:672) with a third elsewhere (selene/src/memory.rs:1336 (not opened)). Per AGENTS.md:188-206 that needs an explicit maintainer design decision, recorded with the alternative the PR does not discuss — doing the coalescing in the disk thread, which already owns the file handle. This is the one item that could change the implementation shape, and therefore anything a test would exercise. Also note the companion sequencing: #497 is not stacked on this PR (at pr/497 disk_store.rs still has pump_inbound/Destination), and #477/#486/#492 all keep the structures this PR deletes — so the shape of Staged will keep moving after merge.
Do not spend hardware time on these
- Multi-host RoCE TP2/TP4 rows of the author's table: no matching hardware (cn5 is 4× RTX PRO 6000 Blackwell amd64 single host; cn7 is a single GB10). Not testable here, and not the load-bearing claim.
- Windows IOCP serving, discrete PCIe GPUs: not available on either node.
- Re-testing DeepSeek TP4
1.00×: it is a reported null result with a stated cause (per-rank 52.8 MB reads finish faster than tokenization, so requests never overlap inStaged). Nothing to validate. - Anything about the 474-test suite passing: that is a CI/desk check, not hardware.
Expected value if a hardware test is performed
High, but only after items 1–3. The mechanism is real and the layer is right: the work is host-side I/O bookkeeping in Rust, no CUDA, no format change, no flag or per-model switch, sharing keyed on (path, expected Header) identity, and failure isolation preserved (fail_segment_users/fail_window, Fetched still routes record_read errors to index.drop_row at :3634). Slot release is single-owner (sweep_shared_windows, :1755-1771) and the new tests assert pool.free_slots() == pool.slot_count() and unpinned index nodes — the right properties. The bandwidth win (3.5–4.2× fewer physical NVMe bytes) is uniform across every row of the author's table; the latency win is concentrated on 27B TP1 (−16%/−20% median TTFT) and is ≈0% to −7% elsewhere. That is worth one short, well-targeted burst on cn7 and nothing more.
Proposed test plan (run only after items 1–3 are fixed; ≈2–3 h of cn7)
Target: cn7 (1× GB10, SM121) — the same GPU class as the author's evidence, with nvidia/Qwen3.8-27B-NVFP4 already present. Use a --prefix-cache-disk directory on the job's scratch; check it holds the warm records (author's 61.3K prefix is ~4.3 GB per branch set, 40G limit) before starting, since the job has only 16 GiB of scratch.
Step 0 — desk, not hardware (~15 min). Run the crate suites on the node without a GPU: cargo test --locked --release --manifest-path selene/Cargo.toml (not opened) --features test-support. This must include any new test for item 1 (rate observed on physical bytes, stable across 1 vs 8 concurrent restores of the same prefix). Fail here and stop: no further time is justified.
Step 1 — burst correctness and physical bytes (the point of the test, ~60 min). Warm one ~61K-token shared prefix plus 4 distinct child branches to disk, restart flare run so VRAM starts empty, then send 4 concurrent /v1/chat/completions follow-ups. Two arrival patterns: simultaneous, and +25 ms stagger. Measure:
- physical bytes actually read from the NVMe device for the restore window (device counters, e.g.
/proc/diskstatsdeltas, notflare_host_cache_bytes_in_total, which per item 1 stays logical) — expect ≈3.5–4× reduction vs.mainunder the same script; flare_host_cache_fetch_failed_total == 0,flare_host_cache_fetched_total == 4, and a nonzero reuse delta;- every answer byte-identical to the same request served with disk offload disabled. Compare all 4 outputs, not just one.
Step 2 — the accuracy question, folded into Step 1 (~20 min). Re-run the 9-fact numerical retrieval prompt at 61.3K, temperature = 0, cold-VRAM restart, 3 repetitions on each arm. If both arms are 9/9 on all three, the reported 7/9 is harness noise and item 2 closes as a description fix. If this PR still loses a fact, stop the whole test and escalate: that is a data-path defect, not a hardware qualification.
Step 3 — regressions that this PR can plausibly break (~40 min, cheap and specific).
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main. This is the path the PR says costs only per-pump demand indexing; it is also the path item 1's rate inflation would mis-price. CompositeStore/ caller-ownedread_intopath: run the existingtests/server/test_prefix_cache_offload.py(composite read/write, oversized prefix, corrupt-record fallback) against the built CLI. It asserts restore fallback on a damaged record and no partial state — which matters more now that one shared read error fails a whole cohort.- Idle and shutdown: one restore then
SIGTERM; the service must still exit cleanly. TheStaged::closeabandoned-count regression (:2485-2489,count.max(busy())wherebusy()also counts shared segments/windows) is diagnostics only, but a hang during drain now looks like a pre-existing hang, so record the message if shutdown is slow.
Step 4 — TTFT/throughput, only if Steps 1–3 pass (~30 min). Three trials per arm of the Step 1 burst, reporting burst median TTFT and physical bytes. Stop at three: the claimed effect is 16–20% and does not need tighter bounds to be useful, and the Flash-Next and DeepSeek rows add no decision value on this hardware.
Skip: multi-host, Windows, discrete-PCIe, DeepSeek TP4, and any repeat of the author's Flash-Next TP1/TP2 rows — the last is a ~0% TTFT effect and would cost more GPU time than it informs. Do not run the suite a second time on cn5 unless Step 1 shows an unexpected result on cn7 (cn5 provides a different GPU class, useful only as a disambiguator).
Bottom line
Right problem, right layer, real and large bandwidth win, tests that assert real properties rather than mocks. But it lands ~1,000 lines of concurrent lifecycle state in Selene's most delicate file on evidence measured on a different commit, with one unexplained accuracy regression in the PR's own checks, and with a metering change that silently perturbs the admission estimate for requests that are not coalesced. Fix those three, get the maintainer's design sign-off on the Staged double lifecycle, then run the plan above once on cn7. If Step 1 shows the 3.5–4× physical-read reduction at head and Step 2 comes back clean, this is clearly worth merging.
Full report Decision to Test: yes (56%): Testing will add considerable value Human Approval: Denied by D-Rock on Autobot, Nov 24, 2026 10:29 PM ET.
Approve Hardware Testing for 496
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches"
Decision: DO NOT refer to hardware testing yet. The change is charter-aligned and worth landing, but three substantive items must be resolved first, and any of them can change the code that would be exercised. Testing now would spend cn7 time on a tree that will be rewritten, and one of the required re-runs (the 61.3K accuracy check) is exactly what a test engineer would otherwise be asked to discover. A minimal plan is given below for use once the items are fixed — it is small (≈2–3 h on cn7).
Head
f9c9191, 2 files (+2808/−914):selene/src/disk_store.rs,docs/prefix-cache-offload.md. Author: FujitsuPolycom. No human reviews yet; no CI. Security screen: all clear.Why not yet — substantive items (each needs a code or claim change, not a nit)
Unaffected-looking but real: byte accounting conflates logical and physical bytes, and that feeds admission. Verified in code at head:
SharedWindow.read_bytesaccumulates the physical reply bytes once (selene/src/disk_store.rs:1530), but every follower adds the whole window to its own record (:1829record.bytes += win.read_bytes;), and that logical count becomes theOkpayload ofTransportEvent::Fetched(:2235), which drivesself.stats.bytes_in += bytesandself.inbound_rate.observe(*bytes, job.started.elapsed())(:3626,:3628).inbound_rateis not a statistic:DiskStore::hit()prices restores withbytes / self.inbound_rate.get()(:3587), and Helios gates admission onworth_fetchingagainst that estimate (helios/src/server/runtime.rs:2772,helios/src/runtime_core/../store.rs:423-438(not opened)). Under the concurrent bursts this PR targets, the observed rate inflates by roughly the fan-out, so a lone later request — which will not be coalesced — is under-priced and may be restored when prefill would have been cheaper. Converselystats.bytes_incannot show the 4× physical-read saving the PR claims, even thoughdocs/prefix-cache-offload.md:1501-1502tells operators to read bandwidth from store counters. Fix: observe the rate on physical window bytes (count each window once at completion), keepbytes_inas the logical restored-bytes counter, and document the distinction in §2.4/§4. This is a behaviour change the description does not mention, and testing it before it is fixed would only measure a number that is about to change definition.The PR's own end-to-end check regressed and is left unexplained.
8/9onmainvs7/9with this PR, Qwen3.8-27B TP1 at 61.3K,temperature = 0, 9-fact numerical retrieval (PR description, "Live SM121 checks"; DeepSeek TP4 is9/9at 23.1K and 47.1K, 30.1K is9/9on both, so the Qwen 61.3K point is a visible outlier). This is the only evidence that exercises the new shared-window fan-out on real model state, and it is the one that got worse. Either it is a real defect inplan_aligned_windows(:700-738) / follower attachment for non-64-alignedskip_pages, or the harness is noisy — the description must say which, and the author has the machine. Note the new tests assert byte-exactness only for the pages they generate;selene/src/disk_store.rs:8468-8570covers a follower attaching withskip_pages = 10(good), but nothing covers a follower attaching to a window another restore created after a partial trailing chunk with the row, which is the suspect region. Sending this to a test engineer would be outsourcing a correctness question the author can settle in one run.The performance evidence predates the code under review. The table was measured before the linear demand-index and close-count edits, both of which change the attach/scheduling path that produces the sharing; the description discloses this in a parenthesis only.
AGENTS.md:103-112anddocs/design-review.md(not opened) principle 16 require the claim to be tied to the artifact tested. A hardware test cannot validate a number attributable to a different tree — re-run at head first.Secondary but worth fixing before the same pass, because they are cheap and touch the same paragraph (none of these alone would block testing): the module doc still promises "at most [
WINDOWS_IN_FLIGHT] windows of one record staged at a time" and "Nothing here waits" (selene/src/disk_store.rs:14-24), which the new shared-segment/shared-window protocol with settle-before-Fetchedno longer holds;docs/prefix-cache-offload.md:337-342states coalescing unconditionally (no caveat that released windows are re-read by later arrivals, no extra partial window whenskip_pages % 64 != 0) and keeps signatures that do not exist (write_from(key, metadata, buffers)vs the realwrite_from(id, header, temporary, path, pages, row, sums)at:1242,read_into(id, path, expected, first_page, pages, row)at:1268); and the rustdoc forallocatenow sits abovefn free_slots(:228-232), documenting the wrong function.Architecture question for the maintainer (not a test question). Two of three lenses flag the same point: this replaces
Staged's single inbound lifecycle with two lifecycles inside shared cache policy (five new lifecycle types, a five-state file machine, two refcounts per window, out-of-order plan completion) in an 8.8K-line file, andplan_aligned_windows(:700) is a near copy ofplan_windows(:672) with a third elsewhere (selene/src/memory.rs:1336(not opened)). PerAGENTS.md:188-206that needs an explicit maintainer design decision, recorded with the alternative the PR does not discuss — doing the coalescing in the disk thread, which already owns the file handle. This is the one item that could change the implementation shape, and therefore anything a test would exercise. Also note the companion sequencing: #497 is not stacked on this PR (atpr/497disk_store.rsstill haspump_inbound/Destination), and #477/#486/#492 all keep the structures this PR deletes — so the shape ofStagedwill keep moving after merge.Do not spend hardware time on these
- Multi-host RoCE TP2/TP4 rows of the author's table: no matching hardware (cn5 is 4× RTX PRO 6000 Blackwell amd64 single host; cn7 is a single GB10). Not testable here, and not the load-bearing claim.
- Windows IOCP serving, discrete PCIe GPUs: not available on either node.
- Re-testing DeepSeek TP4
1.00×: it is a reported null result with a stated cause (per-rank 52.8 MB reads finish faster than tokenization, so requests never overlap inStaged). Nothing to validate.- Anything about the 474-test suite passing: that is a CI/desk check, not hardware.
Expected value if a hardware test is performed
High, but only after items 1–3. The mechanism is real and the layer is right: the work is host-side I/O bookkeeping in Rust, no CUDA, no format change, no flag or per-model switch, sharing keyed on
(path, expected Header)identity, and failure isolation preserved (fail_segment_users/fail_window,Fetchedstill routesrecord_readerrors toindex.drop_rowat:3634). Slot release is single-owner (sweep_shared_windows,:1755-1771) and the new tests assertpool.free_slots() == pool.slot_count()and unpinned index nodes — the right properties. The bandwidth win (3.5–4.2× fewer physical NVMe bytes) is uniform across every row of the author's table; the latency win is concentrated on 27B TP1 (−16%/−20% median TTFT) and is ≈0% to −7% elsewhere. That is worth one short, well-targeted burst on cn7 and nothing more.Proposed test plan (run only after items 1–3 are fixed; ≈2–3 h of cn7)
Target: cn7 (1× GB10, SM121) — the same GPU class as the author's evidence, with
nvidia/Qwen3.8-27B-NVFP4already present. Use a--prefix-cache-diskdirectory on the job's scratch; check it holds the warm records (author's 61.3K prefix is ~4.3 GB per branch set, 40G limit) before starting, since the job has only 16 GiB of scratch.Step 0 — desk, not hardware (~15 min). Run the crate suites on the node without a GPU:
cargo test --locked --release --manifest-path selene/Cargo.toml (not opened) --features test-support. This must include any new test for item 1 (rate observed on physical bytes, stable across 1 vs 8 concurrent restores of the same prefix). Fail here and stop: no further time is justified.Step 1 — burst correctness and physical bytes (the point of the test, ~60 min). Warm one ~61K-token shared prefix plus 4 distinct child branches to disk, restart
flare runso VRAM starts empty, then send 4 concurrent/v1/chat/completionsfollow-ups. Two arrival patterns: simultaneous, and+25 msstagger. Measure:
- physical bytes actually read from the NVMe device for the restore window (device counters, e.g.
/proc/diskstatsdeltas, notflare_host_cache_bytes_in_total, which per item 1 stays logical) — expect ≈3.5–4× reduction vs.mainunder the same script;flare_host_cache_fetch_failed_total == 0,flare_host_cache_fetched_total == 4, and a nonzero reuse delta;- every answer byte-identical to the same request served with disk offload disabled. Compare all 4 outputs, not just one.
Step 2 — the accuracy question, folded into Step 1 (~20 min). Re-run the 9-fact numerical retrieval prompt at 61.3K,
temperature = 0, cold-VRAM restart, 3 repetitions on each arm. If both arms are9/9on all three, the reported7/9is harness noise and item 2 closes as a description fix. If this PR still loses a fact, stop the whole test and escalate: that is a data-path defect, not a hardware qualification.Step 3 — regressions that this PR can plausibly break (~40 min, cheap and specific).
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main. This is the path the PR says costs only per-pump demand indexing; it is also the path item 1's rate inflation would mis-price.CompositeStore/ caller-ownedread_intopath: run the existingtests/server/test_prefix_cache_offload.py(composite read/write, oversized prefix, corrupt-record fallback) against the built CLI. It asserts restore fallback on a damaged record and no partial state — which matters more now that one shared read error fails a whole cohort.- Idle and shutdown: one restore then
SIGTERM; the service must still exit cleanly. TheStaged::closeabandoned-count regression (:2485-2489,count.max(busy())wherebusy()also counts shared segments/windows) is diagnostics only, but a hang during drain now looks like a pre-existing hang, so record the message if shutdown is slow.Step 4 — TTFT/throughput, only if Steps 1–3 pass (~30 min). Three trials per arm of the Step 1 burst, reporting burst median TTFT and physical bytes. Stop at three: the claimed effect is 16–20% and does not need tighter bounds to be useful, and the Flash-Next and DeepSeek rows add no decision value on this hardware.
Skip: multi-host, Windows, discrete-PCIe, DeepSeek TP4, and any repeat of the author's Flash-Next TP1/TP2 rows — the last is a ~0% TTFT effect and would cost more GPU time than it informs. Do not run the suite a second time on cn5 unless Step 1 shows an unexpected result on cn7 (cn5 provides a different GPU class, useful only as a disambiguator).
Bottom line
Right problem, right layer, real and large bandwidth win, tests that assert real properties rather than mocks. But it lands ~1,000 lines of concurrent lifecycle state in Selene's most delicate file on evidence measured on a different commit, with one unexplained accuracy regression in the PR's own checks, and with a metering change that silently perturbs the admission estimate for requests that are not coalesced. Fix those three, get the maintainer's design sign-off on the
Stageddouble lifecycle, then run the plan above once on cn7. If Step 1 shows the 3.5–4× physical-read reduction at head and Step 2 comes back clean, this is clearly worth merging.
screen malicious
Screen Result: All Clear
Evidence: I reviewed PR #496 ("Coalesce shared ancestor reads across concurrent Selene disk fetches", head 0c04b1e2, base main c0c4f798) in full: the diff for all three changed files — docs/prefix-cache-offload.md (+35/−2), selene/src/shard.rs (+10/−0), and all 188k characters of selene/src/disk_store.rs (+3313/−931), including the ~600 lines of new tests — plus the PR body and the entire conversation (review comments and the author's point-by-point response).
No instruction-shaped text exists in the changed code or docs. Searches of the changed files returned nothing for second-person or agent-directed phrasing ("you/your/please/assist"), LLM/agent references (agent, assistant, claude, autobot, "prompt injection"), override phrasing ("ignore previous", "disregard"), reviewer-facing banners (TODO, FIXME, "NOTE TO REVIEWER", MAINTAINER, IMPORTANT, "do not"), verdict-seeking text ("approve", "merge this", "no findings", "all clear", "safe to merge", "skip the tests"), URLs, shell/network commands (curl, wget, sudo, Command::new), base64 blobs, hidden #[ignore]/should_panic/allow(dead_code) suppressions, and zero-width or other format-control characters. The only non-ASCII character in the touched docs is a pre-existing en-dash in a capacity range at docs/prefix-cache-offload.md:94, outside the diff hunks. The docs diff is ordinary technical prose (§2.4 signatures/invariants, §4 metrics note).
The two strings that could look injection-adjacent are benign test fixtures: injected private transfer failure at selene/src/disk_store.rs:8134 is an error message inside the test-only GatedCopier fault injector, consumed by private_failure_isolation_preserves_sibling_sharing_ancestor, and unreachable!("window rate samples stay local to rank zero") at selene/src/shard.rs:477 is a real invariant guard matching the PR's documented rank-0-only forwarding of TransportEvent::InboundWindowSample (shard.rs:719-723 forwards, 1145-1149 skips on peers). Test temp paths use std::process::id()/std::env::temp_dir() (disk_store.rs:4139-4142), a pre-existing pattern; there is no shell-out or network access.
The only agent-directed comment in the conversation is the repository's automated flare-autobot case-file/review post linking autobot.eidonix.com with an #autobot:ignore opt-out line. It is not authored by the PR author (FujitsuPolycom), appears identically on many PRs in this repo (#486, #492, #495, #499, #500, #502, #504, #506), and contains review recommendations rather than instructions to an agent; I recorded it as an observation and did not act on it. There is no evidence of an attempt to induce unwanted agentic behavior, so the result is All Clear.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR; Discord: Dooner) Motivation: When several concurrent requests resume from branch checkpoints that share a disk-resident ancestor prefix, each one independently re-opens and re-reads the same ancestor record files, so the same bytes are fetched from NVMe several times over. This PR makes the staging layer notice that the work is identical, open the file and read each 64-page window once, and let every branch upload its GPU copy from that one shared staging window. Scale: +3,358 / −933 lines in 3 files Proposal:
- Split caller-owned host reads from device restores:
plan_windows(segments, align_to_window)— device fetches align toWINDOW_PAGES(64-page) file boundaries,read_intokeeps segment-relative packing. - One
Arc<Path>+Arc<Header>open perSegmentKeyand oneSharedWindowperWindowKey, found through an O(1)window_index: HashMap<WindowKey, SharedWindowId>; windows are reference-counted so slots stay pinned until every attached disk read and GPU upload finishes. - Separate
host_inboundanddevice_inboundqueues, withhas_window_credit/attach_pendingshared between the existing-window and new-window attach loops andbuild_pending_demandshort-circuiting whendevice_inbound.len() <= 1. - Emit one
TransportEvent::InboundWindowSampleper physical window read soDiskStore::inbound_ratestays physical bandwidth whileStoreStats.bytes_instays logical; rank 0 keeps the samples, peer ranks drop them (selene/src/shard.rs). - Rewrite
docs/prefix-cache-offload.md§2.4/§4 and the module doc with the real signatures, invariants, the two coalescing limits and failure-isolation scope. Touches: - selene/src/disk_store.rs
- selene/src/shard.rs
- docs/prefix-cache-offload.md Related items:
- #497 Reduce disk offload restore latency and integrated-memory intake overhead (open): independent same-author PR on the same region; whichever merges second must reconcile
pump_allpolicy andplan_windows' signature. - #504 add pure-CUDA GPU and CPU lossless KV compression (open, draft): rewrites the same
InboundRecord/Destination::HostPackedpath #496 deletes, and addsHeader.packed, which #496's hand-writtenHeaderIdentity::hashwould silently ignore. - #477 Compress host checkpoints at Selene write-back and decode them on restore (open): keeps the packed-host restore path #496 removes.
- #492 VRAM-to-DRAM CPU/GPU lossless KV compression (open): same
Destination::HostPacked/read_into_packeddependency. - #486 Compress Selene checkpoints at rest with predictor + Zstandard (open): same
InboundRecordpath. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496 Autobot comments: The "new event" this amendment covers is #496 itself moving for the first time: head f9c91915 → 0c04b1e2 (rebased onto c0c4f798), 2 files → 3 files, +2808/−914 → +3358/−933, and an autobot review (2026-11-24 21:23, Changes Requested) plus an author response (2026-11-25 02:41) where the PR previously had zero comments. The review endorses the approach ("belongs in the repo") but its one blocker was that the description's own 61.3K retrieval check showed 8/9 on main vs 7/9 here; that disclosure is now gone, replaced by a 5-seed parity run that matches per seed — I verified the mechanism it blames (helios rejectstemperature == 0and clamps into a positiveSamplingRange), so the old gap was sampling noise, not a coalescing bug, though the residual is 1 model/1 prompt/5 seeds and the "differing fact" the review asked to be named never is. Four of five should-fix items are met at head; theStaged::close"{abandoned} disk transport jobs did not complete" message survives unchanged withabandoned = store_jobs.max(internal)still mixing heterogeneous counters, and the §2.4 doc rewrite is one ~30-line unbroken paragraph plus a duplicate in §4. Two things the description does not mention:pump_all(disk_store.rs:2291-2312) still runs maintenance first, unbounded, so #496 ships no inbound-before-maintenance ordering — the description's ordering sentence describes post-rebase #497; and #496's hand-writtenHeaderIdentity::hash(:1014-1049) destructuresHeaderfield-by-field, so the moment any compression PR (#504) adds a compared field such aspacked, two headers differing only in that field collide into oneSegmentKey. Benchmarks are now re-measured at the head commit (4.22x/3.76x read reduction on 27B, TTFT −29.0%/−13.5%) and the single-restore cost is restated as an expected bound. Neighbourhood: #498/#499 merged, so this and #497 are the author's only open Selene PRs, and #504 is a new same-file competitor.
Value Proposition
PR #496 — Coalesce shared ancestor reads across concurrent Selene disk fetches
Verdict: worth merging, with changes
The previous round's blocker (the 61.3K parity discrepancy) is settled, the inbound_rate metering defect is fixed, the docs now describe the mechanism, the benchmarks were re-run at the head that will be merged, and the TTFT arithmetic checks out. What remains is a benchmark-consistency question, one flaky assertion, one release-mode panic path, and the sequencing with #497. Nothing argues against the change on the merits. It solves a real, measured, charter-aligned problem in the right layer.
Charter fit — good, and better than last round
- Goal, not a non-goal. Goal 4: "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene." This touches only
selene(disk_store.rs,shard.rs, one docs section). No new flag, no format change, no re-export, no per-model branch — so it satisfies "keep the runtime small and model-agnostic" and "no per-model special cases or flags." - The right layer. The duplication was inside
Staged::fetch, below the scheduler's per-key ticket attachment (docs/prefix-cache-offload.md:318-319already promises "an inbound for a key already in flight attaches the request as another waiter"). The PR closes exactly that gap and does not reach upward into Helios. - Evidence rule (#210). Now genuinely satisfied at the head: before/after on a served workload (
flare run,/v1/chat/completions, ingress-to-first-token TTFT), four topologies, cold-VRAM restart, and correctness evidence that a benchmark PR rarely carries (below).
The two PRs are complementary, not merely adjacent
#497 shrinks disk-only intake to intake_slots(layout, 1) — two staging windows — and explicitly documents that concurrent unique-prefix restores now serialize through them. #496 is what lets eight shared-ancestor restores share those same two windows instead of each demanding their own. Together they are "less RAM and less NVMe for the same burst"; separately, #497 alone would make shared-prefix bursts worse (more serialization) while #496 alone delivers its win on a larger pool. That is a coherent roadmap step and worth saying in the description.
Who benefits, and how much
Anyone running concurrent branching/agent traffic against a disk-resident shared prefix on SM121/DGX Spark with --prefix-cache-memory 0 --prefix-cache-disk — the configuration the docs default to for flare run (docs/core-design.md:1633).
Workload (author's GB10, head 0c04b1e2) |
Physical NVMe read | Median TTFT |
|---|---|---|
| 27B-NVFP4 TP1, simultaneous | 18,177.5 → 4,306.7 MB (−76.3 %, 4.22×) | 7,974.6 → 5,662.8 ms (−29.0 %) |
| 27B-NVFP4 TP1, +25 ms stagger | 18,194.2 → 4,843.6 MB (−73.4 %, 3.76×) | 6,883.6 → 5,951.9 ms (−13.5 %) |
| Flash-Next TP1, simultaneous | 7,944.9 → 1,981.1 MB (−75.1 %) | 3,327.5 → 3,225.0 ms (−3.1 %) |
| Flash-Next TP1, +25 ms stagger | 7,958.0 → 2,251.5 MB (−71.7 %) | 3,137.7 → 3,049.9 ms (−2.8 %) |
The arithmetic is internally consistent and now correct (the previous iteration's TTFT slips are gone): one 61,054-token prefix is 954 pages × ~4.19 MB ≈ 4.0 GB, so "after" at 4,306.7 MB is essentially one copy plus eight tiny tails, and the removed duplicate reads (~3 × 4 GB at the measured 6–7.7 GB/s) account for the 2.31 s TTFT drop.
Read honestly: the bandwidth win is uniform (≈75 %) and the latency win is concentrated where the single disk thread is the bottleneck (27B TP1, −29 % / −13.5 %); on Flash-Next, 75 % less NVMe buys −3 %, and the description now says so. Single-stream restores, read_into/CompositeStore spill reads, and pool serving do not benefit — but they do not regress either: the single-restore path returns early from build_pending_demand (disk_store.rs:1736), looks windows up in window_index in O(1) (1646), and shares attach_pending with Pass 4 (1711), so its only residual cost is the documented ≤1 extra partial window per segment when skip_pages % 64 != 0 (docs:354-358).
Is there a still simpler way? No
I re-checked the alternatives at this head and they remain dead ends: copier::Job::replication fans one verified share to several ranks, not one host window to several different GPU page ids across requests; keeping these ~4 GB prefixes in DRAM is precisely what --prefix-cache-memory 0 avoids on a 128 GB Spark; and scheduler-side dedup can't work because each branch needs its own page range in its own snapshot slot. The narrowest place the bytes can actually be shared is where this PR puts it.
What it still costs
Complexity, honestly stated. disk_store.rs goes from 6,976 lines on main to 9,358 at head (tests start at 2,827 → 3,937), i.e. ≈+1,110 production lines and ≈+1,270 test lines in the most delicate file in selene. The new machinery is SharedSegment/SharedWindow(+ids), HeaderIdentity/SegmentKey/WindowKey, SharedFileState (5 states), SharedWindowPhase, WindowFollower, DeviceActiveWindow, DeviceSegmentRef, DeviceInbound, and an eight-pass pump_device_inbound (1883) over a dozen helpers. The author has since collapsed the duplicated key construction into WindowKey (1059), unified plan_windows behind align_to_window (682), removed PlanState, and gated the counters — the shape is now reviewable, and it is commented pass by pass. It is still a second inbound lifecycle in a file that already had two pipelines.
Intentional risk surface. One shared record_read error fails every attached restore; a coalesced window pins its SlabPool slots until the slowest follower's upload finishes (WINDOWS_IN_FLIGHT = 2, shared/limits.rs:18); sibling-demand preference relaxes strict arrival ordering. All three are now documented at docs/prefix-cache-offload.md:337-366, which is what I asked for last round.
Metering definition change (new, worth one line). DiskStore::hit still prices estimated_seconds = record_bytes / inbound_rate (disk_store.rs:3615-3628), and inbound_rate now observes disk-thread window throughput — excluding queueing and the GPU upload — where main observed per-restore end-to-end (Fetched). The worth_fetching gate (store.rs:423-438) and restore_wait.defer (helios/src/server/runtime.rs:2796) therefore became slightly more permissive, and flare_host_cache_inbound_bytes_per_second (helios/src/server/metrics.rs:1310) changed meaning for users. Measured 6.07–7.71 GB/s sits in the same band as #497's 8.68 GB/s single-restore end-to-end figure, so the bias looks small — but note in the docs that CompositeStore keeps its own end-to-end disk_inbound_rate (composite.rs:897, 1000-1003), and that on multi-host the sample is rank-0-only (shard.rs:1148-1150 drops it on peers).
Evidence — strong now
- Parity settled. Five cold-VRAM repeats (
seed = 1234..1238,60,534tokens,top_logprobs = 5) produced identical FP32 top-5 logprobs and token ids onmainand head (6/9, 8/9, 7/9, 9/9, 4/9both), with the honest explanation that Flare has no greedy mode (helios/src/model.rs:230-236(not opened)) and that the original single-pass script used per-build prompt nonces. That was the right root-cause answer, not a swallow. - New misalignment test.
misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restoreruns restore B (skip_pages = 13) alone on an isolated store and then as a follower on a shared store, and asserts byte-equalSimulatedGpupages and row — the direct test for the only plausible correctness hazard in this design. - Failure isolation and leak tests (
private_failure_isolation_preserves_sibling_sharing_ancestor,shared_ancestor_failure_propagates_to_all_followers_without_leaks,staged_close_drains_active_coalesced_fetches_cleanly) assert poolfree_slots()and index pins, which is what would actually leak here. CompositeStoreis better covered than the "Not covered" line admits:composite.rs:1229routes non-resident chains intoDiskStore::fetch→Staged::fetch(the coalesced path), andhelios/src/offload/gpu_tests.rs:1275-1289buildsCompositeStore+DiskStoreover real CUDA transfers in the 21/21 SM121offload::suite the author ran. Worth correcting.- I re-verified the invariants I flagged earlier and they hold:
window_indexcannot be clobbered by a live entry (Pass 4 only creates a window whenattach_pendingfound none,1916-1948);record.bytes += win.read_bytescredits exactly one window per completed plan (1901) with the key including(segment, first, count, row), so logical byte totals match;Fetchedis deferred until the last user's segment settles (2244-2255), which is what makes the pin release at3656-3658safe;SegmentKeyusesArc<Path>/Arc<Header>andHeaderIdentityhashes exactlyHeader'sPartialEqfields (shared/record.rs:136-152), so equal headers can't be missed.
What must change before merge
- Reconcile the "8 child branches" label with the read totals. "After" = 4,306.7 MB is ~one copy (954 pages ≈ 4.0 GB) — correct and impressive. But "before" = 18,177.5 MB is ≈4.5 copies, not 8 (8 concurrent ~4 GB restores should be ≈32 GB), while
flare_host_cache_bytes_in_totalis stated as 8× single (~32 GB) at the same time. Simultaneous and staggered before-totals differ by 0.1 % (18,177.5 vs 18,194.2), which suggests a shared cause rather than arrival timing. Either the burst overlapped ~4–5 restores at read time or the physical gauge under-counts; say which. An honest 8-way figure would make 4.22× larger, so this is a credibility fix, not a threat to the win. - De-flake
staggered_arrival_attaches_out_of_order_to_in_flight_windows.assert_eq!(staged.disk_window_reads() + staged.coalesced_windows(), 10)atdisk_store.rs:8487contradicts its own comment (8481-8484: "at least W1 and W2 are guaranteed; W3 coalesces because both still need it"). Assert a bound (≥ 2coalesced, reads + coalesced ≥ 10) instead of an exact total that depends on disk-thread timing. This runs in CI (.github/workflows/native-serving.yml:51(not opened)). - Replace the
unreachable!inKind::of.shard.rs:476-478panics in release if any caller passes anInboundWindowSampleunfiltered. Both current sites filter first (shard.rs:722,1148), but a third call site is a serving crash. Make it adebug_assert!plus a benign default, or handle the variant inKind. - Add the two metering sentences to the docs (see above): the window rate excludes queueing and the GPU upload, and on multi-host it is rank-0 NVMe only. Also note that
TransportEventis public (selene::disk_store, not re-exported inlib.rs:44-56), so the new variant is a breaking change for any external exhaustive matcher — one line in What, and consider#[non_exhaustive]. - Sequence with #497 explicitly. Both PRs now say "merge in either order" but both edit
Staged::pump_all(disk_store.rs:2291) and #497 addsMAINTENANCE_DEFER_LIMIT. State the order and land the second one'spump_allas reviewed. - State the coverage boundary plainly in Evidence: discrete PCIe GPUs, Windows serving, 2-GPU
split_pools, and multi-host RoCE (the entireshard.rssurface of this PR) were not exercised live.mainis unaffected there, but the shard edits are untested beyond unit level.
Items 1–3 are small; 4–6 are text. None of them requires redesign, and 1 is likely a one-sentence correction.
Bottom line
Worth merging, with changes. By the charter's own tests: it addresses a measured, reproducible performance problem (#210) on the project's headline model and hardware; it sits in the one layer where the bytes can be shared; it adds no flag, no format, no per-model branch; its correctness evidence is unusually good for a performance PR and now includes byte-exact parity on the exact misalignment hazard and five-repeat FP32 parity against main; and it composes with the companion #497 rather than duplicating it. The cost is real — ≈1,100 production lines of concurrent reference-counted state in selene's most delicate file, a cohort-wide blast radius on a corrupt record, and a changed bandwidth metric — but it is paid once, it is documented, and the alternative is 4.5× redundant NVMe reads for the exact burst pattern (branching agents against a shared prefix) that Flare exists to serve. Fix items 1–3, tighten 4–6, and merge.
(Conversation on the PR is this repo's own automated case-file/review bot plus the author's response; the only instruction-like text in it are the bot's "to opt out" footers, which I did not act on. No human reviewer has signed off yet, and docs/core-design.md / the charter do not require maintainer sign-off for this class of change — but the two behavioral trade-offs now documented in §2.4 deserve an explicit maintainer ack.)
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Conventions
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:1014-1050:
HeaderIdentityhand-writesHashover 14Headerfields with a..rest-pattern, mirroringimpl PartialEq for Headerin selene/src/shared/record.rs:136-152 — the only hand-writtenHashin selene/src, and one where a newHeaderfield silently drops out of the hash instead of failing to compile. - selene/src/disk_store.rs:97-101 (with :3638, selene/src/shard.rs:476-478):
InboundWindowSampleis a rate sample inserted intoTransportEvent, an enum documented at :83 as "Completion the transport reports", forcing twounreachable!()s and two skip guards that must stay in sync, and makingCompositeStore(selene/src/composite.rs:1376, gate :1418-1424) re-run a maintenance pass per physical window read. - selene/src/disk_store.rs:1766-1777:
pick_next_pending_planrecomputesplan.count + row*row_slotsby hand instead of calling the existingLayout::record_slots(selene/src/geometry.rs:180-182) that the allocator it guards already uses (disk_store.rs:245), and takes the transfers mutex per candidate plan. Nits: 6 —memory.rs::windows()is now the last third copy of theWINDOW_PAGESsplitter (selene/src/memory.rs:1333-1367 vs disk_store.rs:679-727);close()'s.max()-of-map-sizesabandonedis reported as "disk transport jobs" (disk_store.rs:2513-2544); two differentsettled()predicates share a name (:662-664 vs :1106-1109); the same "unindex if still pointed at" body three times (:1525-1527, :1543-1545, :1837-1839) and the follower-detachretainclosure twice (:1813-1816, :1900-1904);GatedCopier::wrapreturns a positional 4-tuple with 3 of 5 call sites discarding by position (:8092-8122); the new §2.4 bullet is a 250-word paragraph carrying nine facts and restates thebytes_in/inbound_ratecontract already in §4 (docs/prefix-cache-offload.md:337-366 vs :1528-1531). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Simplicity
Verdict: clean Blocking:
- None. Should fix:
- None.
Nits: 7 — the 30-line §2.4 doc paragraph duplicating §4 (docs/prefix-cache-offload.md:337-366), the single-segment host inbound modelled as a
Vecwith an always-zero index and a redundantreads_left(selene/src/disk_store.rs:267, 658, 750, 1351),HeaderIdentity's hand-written 37-lineHash(disk_store.rs:1001-1050),Staged::close'sstore_jobs.max(internal)reported as a job count (disk_store.rs:2513-2528, 2541-2544), the twoidfields duplicating theirHashMapkeys (disk_store.rs:1083, 1131), a deaddemand.is_empty()guard (disk_store.rs:1781-1787), and the twodisk_read_countedflags kept only for a test counter (disk_store.rs:743, 1140). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Reviewed at head 0c04b1e2 (base c0c4f798) through lens D, simplicity: every new structure read in place plus its callers. No blocking or should-fix finding survives. My four asks from the previous round — PlanState::Done → started: Vec<bool>, the two window planners → one plan_windows(segments, align_to_window), test-only counters gated with #[cfg(any(test, feature = "test-support"))], and the duplicated attach/credit loops → has_window_credit/attach_pending — are all implemented at this commit, as is the removal of SharedWindow.path/expected and the description's demand-indexing overstatement. What remains is seven small deletions, each with a smaller version in the report; the docs duplication is the one worth fixing before merge because it is the paragraph a future reader will trust.
The +3313/−931 in selene/src/disk_store.rs is not churn under AGENTS.md 188-193: the host path must stay private and unshared because CompositeStore calls read_into with caller-owned registered buffers, the device path needs per-file and per-window reference state to keep uploads and failures independent, and each of the eight pump_device_inbound passes carries an ordering argument the others depend on. I ask for no different shape — only the deletions, and none of them change behaviour except the docs split and an optional one-line comment on the host-inbound Vec.
Checked and clean: read_into semantics unchanged (planning at 1349, caller-buffer slicing in HostWindow 907-917, close/unwind 865-881, 970-992); one release point for pooled slots (sweep_shared_windows 1824-1843, idempotent Resources::release 256-260); tests assert byte-exact SimulatedGpu pages and physical open/window counters at the real submit_disk sites, satisfying AGENTS.md 194-199; InboundWindowSample is emitted before stats.progress in DiskStore::apply (3631-3638), forwarded on rank 0 and skipped on peers. Open questions are only whether the two remaining redundancies are load-bearing for anything I could not see from the code.
Correctness
Verdict: clean Blocking:
- None. Should fix:
- None.
Nits: 2 —
selene/src/composite.rs:1376(CompositeStore::pollbumpsstats.progressforInboundWindowSample, whichDiskStore::applydeliberately does not, so the two counters diverge for coalesced restores);selene/src/disk_store.rs:2113-2116with:1599-1611(a shared window whoseReadRowis deferred for lack of disk queue space staysReadingwithdisk_referenced == 0, so it is neither sampled nor uploadable until a later pump — correct, but the invariant deserves a comment). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Reviewed PR #496 at head 0c04b1e2 through the correctness lens (callers, configurations, lifetimes, error handling, concurrency, inactive/edge paths, state transitions, compatibility with existing data). The three issues I raised on the previous revision are fixed in code at this head: physical vs logical accounting (TransportEvent::InboundWindowSample emitted once per completed physical shared window at disk_store.rs:1596-1620, DiskStore::apply feeds only inbound_rate from it at :3632-3635 while stats.bytes_in stays logical at :3669); Staged::close's abandoned count now store_jobs.max(internal) (:2513-2528), so it can no longer under-report versus owners.len(); and a misaligned-follower test now asserts byte-equal device pages and row against a private-store baseline.
I traced slot lifetime (release only when followers.is_empty() && disk_referenced == 0 && upload_referenced == 0), segment removal gated on active.is_empty(), the demand index (device_inbound.len() <= 1 short-circuit), failure isolation (private child/upload vs shared record_read), Fetched emission after disk close, and the host read_into path, which is unchanged so CompositeStore sees no behaviour change. The event variant's plumbing through Sharded::absorb_local/Peer::forward and CompositeStore::poll is correct; the Kind::of unreachable! arm is genuinely unreachable. The docs paragraph in docs/prefix-cache-offload.md (not opened) §2.4 and §4 matches the code. No record-format or header change, so existing checkpoint files load unchanged.
Not verified this turn: the #497 rebase of pump_all, the Windows IOCP path, multi-host RoCE, and 2-GPU split_pools — also listed as not covered by the author.
Architecture
Verdict: should-fix issues only
Blocking:
- None.
Should fix:
- selene/src/disk_store.rs:97-101 / selene/src/shard.rs:476-478: a store-local metering sample (
TransportEvent::InboundWindowSample, no job id) is carried on the transport event enum that is also the cross-rank wire event set, forcing anunreachable!()inKind::ofwhose invariant is hand-maintained at shard.rs:722-725 and :1148-1150; the existing helper at selene/src/shard/tests.rs:339 would panic if any fetch ran there. Keep the sample insideStaged(a drain method likein_flight()/pool()) or fold the physical counters intoStoreStats(selene/src/store.rs:227-244).
Nits: 1 (inbound_rate now measures pure disk-thread time — disk::Reply.elapsed set only around worker.execute, selene/src/disk.rs:447-454 — so hit().estimated_seconds at disk_store.rs:3615-3627 prices restores optimistically even for a single restore, and CompositeStore measures a different thing at composite.rs:994-1004). Plus one held process note: maintainer sign-off to record the design decision (a second reference-counted inbound lifecycle in Staged rather than in DiskThread), which AGENTS.md:204-206 and docs/design-review.md:64-68 (not opened) ask for.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Head 0c04b1e2, 3 files, +3358/−933, no checks at head. Scope is right: the change belongs in Selene's disk transport, is justified by a measured performance problem on a served workload (charter "What gets merged"; "Performance PRs need benchmarks showing an actual speedup over main on a served workload"), and crosses none of the rejection criteria — no CPU/non-NVIDIA path, no CUDA or model knowledge, no per-model branch, no new flag/env/recipe knob, no record Header or on-disk format change, no wire Kind change, and failure isolation (private vs shared errors) is preserved. Of the four should-fixes raised on the earlier revision, all are genuinely fixed at this head: rate now fed from physical window bytes (disk_store.rs:3632-3635) with stats.bytes_in still logical (:3669), module contract rewritten (:7-27), §2.4 now carries both coalescing limits and the real signatures (docs/prefix-cache-offload.md:337-366), and the coalescing counters are properly cfg-gated. What remains is the layering objection above — a statistic riding the wire protocol's event set — plus the metering-semantics nit.
Prose
Verdict: clean Blocking:
- None. Should fix:
- None.
Nits: 2 (PR description only: the
InboundWindowSamplescope claim is wider than the code, and two Flash-Next read-reduction ratios do not match the tabulated MB figures) Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Prose review of PR #496 ("Coalesce shared ancestor reads across concurrent Selene disk fetches", head 0c04b1e2, base main, 3 files: selene/src/disk_store.rs, selene/src/shard.rs, docs/prefix-cache-offload.md), judged against AGENTS.md §"Required prose review" and §"Required PR descriptions" (four-part why/what/result/evidence scheme, distinguish measurement from expectation, connect claims to the tested artifact, keep failures visible), .agents/skills/repo-prose/SKILL.md (not opened) (present-state specification, no hidden context) and docs/design-review.md (not opened) principle 16.
The description still has the four parts in order plus a "Discord: Dooner" line, and it is accurate where it makes checkable claims. The three should-fix items from the earlier pass at f9c9191 are all fixed at this head: the misplaced rustdoc is corrected (disk_store.rs:236 now documents free_slots; :241-243 is back on allocate), the previously unexplained 8/9-vs-7/9 single-pass difference is replaced by 5 cold-VRAM restart repeats with matched FP32 top-5 logprobs and token IDs, with the temperature-clamp explanation, and the "Existing users pay …" sentence is now explicitly labelled "As an expected bound". Benchmark provenance is fixed too: the table is now stated as comparing main (c0c4f798) against 0c04b1e2, the head actual, consistent with "Not covered". The docs change in section 2.4 is now present-tense, resolves "aligned to WINDOW_PAGES (64-page) boundaries in the record file", and states both coalescing limits, the pin/close invariant, the shared-versus-private error scope, and physical-vs-logical accounting (repeated in §4). Module doc, new type/state/pass comments, test names and the commit message all describe the code as it exists.
Two nits remain, both in the description and both derivable from the code/tables: (1) the What bullet's "Emit one … InboundWindowSample per completed physical window read" is narrower in code — only shared device-fetch staging windows emit one (disk_store.rs:1619, sole push site), so caller-owned read_into restores no longer feed DiskStore::inbound_rate; (2) two Flash-Next "Read Reduction" ratios (3.99x, 3.52x) do not equal the ratio of the tabulated MB means (4.01, 3.54), so the caption should say which derivation is used. Nothing here blocks merge.
Subtractive
Verdict: make it smaller first
The change: +3358 / −933 lines across 3 files (selene/src/disk_store.rs +3313/−931, docs/prefix-cache-offload.md +35/−2, selene/src/shard.rs +10/−0)
Could remove: about 215–230 lines, in 8 places
Biggest subtractions:
- selene/src/disk_store.rs:1732-1793 (+ :1711-1730, :1933-1942, :1991-1995): delete
build_pending_demand, thedemandparameter threaded throughattach_pendingand both decrement sites;pick_next_pending_plancollapses to the free-slot filter plus "first unstarted plan": about 80 lines. It only reorders which new window a leader starts; attach scanning coalesces regardless of order. - selene/src/disk_store.rs:8831-8906: fold
staged_close_drains_active_coalesced_fetches_cleanlyintoconcurrent_burst_coalesces_shared_ancestor_opens_and_window_reads(:8294-8384) as one fixture withclose_earlyin[false, true]; identical setup, pool, SimulatedGpu loop and per-page/row assertions: about 70 lines. - selene/src/disk_store.rs:1001-1056 (+ selene/src/shared/record.rs:154): delete
HeaderIdentityand its 47-line hand-writtenHash; putimpl Hash for Headerbeside thePartialEqit must agree with and deriveHashonSegmentKey/WindowKey: 50 lines gone, about 28 added, net 22 plus one fewer definition of Header identity. - selene/src/disk_store.rs:1897-1909 and 2144-2196: Pass 1 and Pass 5b walk the same
activelist; reap-and-upload in one loop where Pass 5b is now: about 12 lines and one re-lookup per upload. - selene/src/disk_store.rs:8215-8232:
poll_all_fetchesduplicatescrate::testing::poll_until(selene/src/testing.rs:25-37, already imported at :2829) at 6 call sites: about 10–16 lines.
Left behind: None. Destination, InPhase, InboundRecord::apply_transfer, InboundRecord::submit_upload and the old device branch are deleted in this same diff; the only pre-existing helper whose call sites change is plan_windows, and both call sites and both plan-shape tests are updated (disk_store.rs:1349, :2435, :6262, :8235).
Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Pre Test Report
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches" (round 2, head 0c04b1e2)
Decision: REFER to hardware testing, with a deliberately small plan (≈2–2.5 h of cn7 GPU time), after a Step 0 desk gate.
Last round I said do not test yet. All three blockers from that report are now settled at this head, and the three lenses that were negative on substance have flipped to clean (Correctness: clean; Simplicity: clean; Prose: clean; Architecture: no blocking finding). What remains is one internal-API layering objection, one silent-drift hazard, two duplications and a pile of nits — none of which changes a byte of the path a hardware test would exercise, and none of which any reviewer asks to be re-measured. Two lenses independently endorse the approach ("belongs in the repo", "worth merging, with changes").
Head 0c04b1e2 (base main c0c4f798), 3 files, +3358/−933: selene/src/disk_store.rs, selene/src/shard.rs (not opened), docs/prefix-cache-offload.md. Author FujitsuPolycom. One author response in the thread, no human maintainer sign-off, no CI at head. Security screen: all clear (test-fixture strings such as injected private transfer failure and the unreachable!("window rate samples stay local to rank zero") guard are benign; the only agent-directed text in the thread is this repo's own flare-autobot footer, which I did not act on).
The three prior blockers, re-verified at this head
- Logical vs physical byte accounting feeding admission — fixed.
TransportEvent::InboundWindowSample { bytes, elapsed }is emitted once per completed physical shared window (inapply_shared_disk), andDiskStore::applyshort-circuits it intoself.inbound_rate.observe(bytes, elapsed)beforestats.progress += 1(disk_store.rs:3632-3635); theFetchedarm no longer samples the rate and only doesself.stats.bytes_in += bytes(:3669), sobytes_instays logical.hit()'sestimated_seconds(:3625) is now priced from physical bandwidth. A dedicated test,coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical, asserts rate stability and logicalbytes_inacross 1 vs 8 restore concurrency. The split is documented (docs/prefix-cache-offload.md:362-366and:1528-1531). - The 61.3K 8/9-vs-7/9 accuracy regression — resolved, not swallowed. The author showed Flare has no greedy decoding (temperature 0 is clamped into a positive sampling range) and that the original script used per-build prompt nonces; five cold-VRAM repeats (
seed = 1234..1238, 60,534 tokens,top_logprobs = 5) produced identical FP32 top-5 logprobs and token IDs on both arms (6/9, 8/9, 7/9, 9/9, 4/9 each). The suspect hazard is now directly covered bymisaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore, which byte-compares askip_pages = 13follower against a private-store baseline across a partial ancestor tail ([64..71)) and a partial leaf chunk carryingrow = true— the exact pair I asked for. - Benchmarks predating the tree — fixed. The table is keyed
main c0c4f798vs0c04b1e2, the head under review: 18,177.5 → 4,306.7 MB (4.22×) and TTFT 7,974.6 → 5,662.8 ms (−29.0%) simultaneous; 18,194.2 → 4,843.6 MB (3.76×) and 6,883.6 → 5,951.9 ms (−13.5%) staggered; Flash-Next 7,944.9 → 1,981.1 MB with only −3.1% TTFT. Un-rerun multi-host rows moved to "Not covered"; the single-restore cost is now labelled an expected bound withbuild_pending_demand'sdevice_inbound.len() <= 1fast path named.
What still stands, and why none of it blocks the test
- Should fix (layering, not behaviour): the metering sample rides
TransportEvent, the enum that is also the cross-rank wire event set, forcingunreachable!()inKind::of(shard.rs:477(not opened)) upheld by two hand-written guards (shard.rs:722-725(not opened),:1148-1150).selene::disk_storeispub mod(lib.rs:25), so this is also a public-API addition. A thirdKind::ofcaller would panic in release; both current paths filter first, and no hardware test reaches a third caller. The existing helper atshard/tests.rs:339mapsKind::ofover aSharded's events and survives only because those tests issue no fetch. - Should fix (metering semantics, worth sanity-checking in the test):
inbound_ratenow measures pure disk-thread time (disk::Reply.elapsedaroundworker.executeonly — oneO_DIRECTread plusxxh3, no queueing, no GPU upload), so restore estimates are slightly optimistic — the mirror image of the previous inflation.CompositeStorestill measures its own end-to-end rate, so the two stores now measure different quantities under one name. The author's live figures (6.07 GB/s single vs 7.71 GB/s 8-way) sit in the same band as #497's 8.68 GB/s end-to-end number, i.e. the bias looks small. Direction is provable from code; magnitude is not. - Should fix (silent drift):
HeaderIdentityhand-writesHashover fourteenHeaderfields with a..rest pattern (disk_store.rs:1014-1050), mirroringPartialEq1,200 lines away inshared/record.rs:136-152(not opened). I re-checked the field lists: they agree today, so coalescing is correct at this head. The hazard is future — the pending compression PRs (#504 addsHeader.packed) would silently drop a field from the hash. Not testable on hardware. - Should fix (duplication):
pick_next_pending_planrestatesLayout::record_slots(disk_store.rs:1766-1777) instead of calling the helper (geometry.rs:180-182) that the allocator it guards already uses. Cosmetic. - Known-fragile assertion:
staggered_arrival_attaches_out_of_order_to_in_flight_windowsasserts an exact total,disk_window_reads() + coalesced_windows() == 10(disk_store.rs:8487). The Value lens flags it as a load-dependent flake; it reads as a total-window invariant rather than a timing count. Run it once in Step 0 and note the result — if it flakes that is a test bug, not a product bug, and does not justify hardware time. - The one reviewer proposal that could change a tested number: the Subtractive lens wants
build_pending_demand+ thedemandplumbing deleted (~80 lines). Its own open question is whether the staggered-arrival figure (3.76× vs 4.22×) survives. Do not test that variant. Test0c04b1e2as merged, and report simultaneous and staggered separately so a later deletion has a baseline. - Process note for the maintainer, not a test question: the design call — a second reference-counted inbound lifecycle inside
Stagedrather than inDiskThread— is now argued in the PR's Why section (staging slots must stay pinned until every follower's asynchronousCopierupload finishes, whichDiskThreadcannot see) but has no recorded maintainer sign-off (AGENTS.md:204-206(not opened)). Also: #497 is not stacked on this PR (pr/497still haspump_inbound/Destination), and #496's ownpump_allstill submits maintenance first (disk_store.rs:2291-2312) —pump_allwill keep moving after merge. Neither affects what I would test.
Expected value of the hardware test
High, but sharply bounded. The mechanism is host-side Rust I/O bookkeeping: no CUDA, no record-format or Header change, no new flag/env/recipe knob, no per-model branch, sharing keyed on (path, expected Header) identity, failure isolation preserved (private child/upload errors fail one restore; shared open/read errors fail the cohort and route through is_record_read() → drop_row). Unit tests assert the right properties — byte-exact SimulatedGpu pages and rows, pool.free_slots() == pool.slot_count(), no pinned index nodes.
Two things only a run settles:
- Does the ~4× physical-read reduction and the −29% burst TTFT reproduce at head on GB10? This is the load-bearing claim.
- Is the admission-rate change harmless? Single-stream restore TTFT/bytes must stay at parity with
main; the metering nit predicts a small optimism, not a cliff.
The description's own inconsistency (8 branches claimed, but "before" 18.18 GB is ≈4.5 copies of a ~4.0 GB prefix, not 8, while bytes_in is stated as 8× single) is answered for free by testing 4 branches.
Do not spend hardware time on
- Flash-Next rows (−3.1%/−2.8% TTFT for 75% fewer reads): no decision turns on it; it costs another warm-up cycle on a second model.
- DeepSeek TP4
1.00×: reported null with a stated cause (per-rank 52.8 MB reads finish before tokenization, so requests never overlap inStaged). Nothing to validate. - Multi-host RoCE, Windows IOCP, discrete PCIe, 2-GPU
split_pools: no matching hardware (cn5 is not connected; cn7 is a single GB10). Theshard.rs(not opened) edits are unit-covered; live multi-host is out of scope for both nodes. - cn5: never connected; and even then, a different GPU class useful only as a disambiguator if cn7 surprises.
- Re-running the crate suite more than once, or otherwise using GPUs to check "tests pass" — desk work.
- The deleted-demand-index variant — do not test code that is not in this PR.
Minimal test plan — cn7, ≈2–2.5 h of GPU time (≈4 h wall clock)
Target cn7: 1× GB10 (SM121, the same class as the author's evidence). Job gets 10 CPUs / 60 GiB RAM / 16 GiB scratch. Use nvidia/Qwen3.8-27B-NVFP4 (matches the load-bearing row). The model list shows all three checkpoints at 0 GiB — confirm the NP4 weights are actually cached before starting, or a cold download will dominate the run.
Two setup traps to avoid (both verified in the docs):
- Disk limit.
docs/prefix-cache-offload.md:839-842: the limit defaults to one tenth of free space at startup. On a 16 GiB scratch that is ~1.6 GB, while a ~61K-token Qwen3.8-27B TP1 prefix is ≈954 pages × ~4.19 MB ≈ 4.0 GB of parent record. Left at default, the warm prefix is evicted and the burst restores from prefill — the test would silently measure nothing. Pass--prefix-cache-disk-limit 8Gexplicitly and confirm the startup line reports it. Child branch records are tails only, so 4 branches fit alongside the parent in 16 GiB. - Metric semantics.
flare_host_cache_bytes_in_totalis logical by design (that is the whole point of the PR) andflare_host_cache_inbound_bytes_per_secondnow reports DiskStore's disk-thread-only rate. Physical NVMe traffic must come from the device, not the store.
Step 0 — desk, on the node, no GPU (≈20 min). Stop if red.
cargo test -p selene --features test-support at 0c04b1e2; expect ≈476 passing. Watch specifically: coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical, misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore, and the == 10 assertion in staggered_arrival_attaches_out_of_order_to_in_flight_windows. Also build main (c0c4f798) once for the A/B arm.
Step 1 — the burst, A/B, simultaneous (≈60 min GPU).
Start flare run with --prefix-cache-memory 0 --prefix-cache-disk <scratch dir> --prefix-cache-disk-limit 8G. Warm one ~61K-token shared prefix plus 4 distinct child branches to disk; restart so VRAM is cold. Send 4 concurrent /v1/chat/completions follow-ups. Repeat the identical script on main. Three trials per arm, interleaved (main, head, main, head…) to cancel drift. Measure:
- Physical NVMe bytes for the restore window from
/proc/diskstats(or/sys/block/<dev>/statsectors-read deltas) on the device backing the cache directory. Expect ≈4× reduction (author's 4-way equivalent: ~4 copies ≈16 GB before vs ~4 GB after). - Burst median TTFT (ingress-to-first-token, same definition as the table). Expect ≈−20% to −30% on 27B-NVFP4 TP1.
flare_host_cache_fetched_total == 4,flare_host_cache_fetch_failed_total == 0,flare_host_cache_reused_tokens_totalwell above the prefix size,flare_host_cache_slots_in_usereturning to 0 after drain (inbound_in_flight == 0). All names verified inhelios/src/server/metrics.rs:1087-1310.
Three trials is enough: a 25–30% effect needs no tighter bound to be actionable.
Step 2 — correctness of the coalesced path (≈20 min, folded into Step 1's runs).
- All 4 branches' full generated text byte-identical to the same requests served with disk offload disabled. All four, not one.
- One staggered burst (submit branch 1, wait for first token, then submit the rest), 1 trial, no TTFT claim: confirm no hang, no
fetch_failed, coalescing still engages. - 3 repeats of the 61.3K 9-fact retrieval probe on both arms, cold-VRAM restart. The author's 5-seed parity run predicts agreement; a consistent head-only loss is stop-and-escalate, not a qualification result.
Step 3 — regressions this PR can plausibly break (≈30 min).
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main. This is the path the metering nit predicts could be mis-priced and the path the "expected bound" is about. read_into/ corrupt-record path:tests/server/test_prefix_cache_offload.py— note it is not a drop-in CLI check::26-31requiresFLARE_RUN_CUDA_TESTS=1,CUDA_VISIBLE_DEVICES, andFLARE_OFFLOAD_TEST_CORE=<core .safetensors>, plus a built release CLI and--basetempon a direct-I/O filesystem (docs/prefix-cache-offload.md:1438-1447). It launches its own servers and already asserts exactly the properties I want (fetched>0,fetch_failed==0,reused_tokens>32000at:160-173; corrupt-record fallback at:185-186). Pre-check those env vars in Step 0; if no runtime core is available on cn7, substitute a hand-driven corrupt-record HTTP check rather than skipping the regression entirely — it matters more now that one shared read error fails a whole cohort.- Idle and shutdown: one restore, then
SIGTERM; clean exit. If drain is slow, capture the"N disk transport jobs did not complete"message — its count is known to mix unrelated quantities, so record rather than act on it.
Stop conditions. No read reduction in Step 1 → mechanism failure, stop and report. Any differing output in Step 2 → correctness defect, stop and report (and say which configuration diverged, since the private-baseline test should have caught it). Single-stream regression beyond noise in Step 3 → report as the under-stated cost.
Budget: 20 min desk + 60 min burst A/B + 20 min correctness + 30 min regressions + 20 min slack ≈ 2–2.5 h cn7 GPU time, one node, one model, no multi-host.
Bottom line
The change solves a real, measured, charter-aligned bandwidth problem in the correct layer. At this head its evidence is attributable to the commit that would ship, its accuracy question is answered with a five-seed parity run plus a dedicated misalignment test, and its metering error is corrected. Residual issues — a statistic riding the wire-event enum, a hand-written Hash that will rot when Header gains a field, two duplications, a stale doc paragraph, and a maintainer sign-off that has not been recorded — are worth fixing before merge but change nothing a hardware test measures. Refer it, run the plan above once on cn7, and the merge decision rests on Step 1's physical-read delta and Step 2's output parity.
code review summary
Recommendation: Changes Requested
Non-blocking: no blocker remains, but five should-fix items (one layering, one maintainability, one arithmetic, one docs, one process sign-off) are worth landing before or with the merge.
Blockers:
None.
Should fix:
- Take the rate sample off the cross-rank completion enum.
TransportEvent::InboundWindowSample(disk_store.rs:97-101) carries noJobIdyet joins the enum documented as "Completion the transport reports to the disk store" (:83), forcingunreachable!()inKind::of(shard.rs:476-478) upheld by two hand-written guards (shard.rs:722-725, :1148-1150) and makingCompositeStore::pollbumpstats.progress— and so re-runspill_parked+disk.maintain()— once per physical window (composite.rs:1376, gate :1418-1428). Carry it out of band (aStageddrain method or a field onFetched). - Move
HeaderIdentity's hand-writtenHashnext to the equality it tracks. It hashes 14 fields through a..pattern (disk_store.rs:1014-1050,..at :1030) againstHeader's exhaustivePartialEqin another module (shared/record.rs:136-152); a newHeaderfield silently drops out of the hash and coalescing stops with no test failure. GiveHeaderaHashimpl (or hash onlyPrefixKey) and add ana == b ⇒ hash(a) == hash(b)test. - Call
Layout::record_slotsinstead of restating it. The admission guard inpick_next_pending_planrecomputespages + row_slotsby hand (disk_store.rs:1767-1777) while the allocator it predicts usesrecord_slots(geometry.rs:180-182, disk_store.rs:245). One-line change, hoisted besidefree. - Split the §2.4 bullet and stop stating the metrics contract twice. docs/prefix-cache-offload.md:337-366 is one ~250-word paragraph carrying ~12 behaviours, and the
bytes_in/inbound_ratestatement repeats at :1528-1531. Mechanism prose in §2.4, limits/failure scope as bullets, metrics only in §4. - Get the design decision recorded. The Staged-vs-DiskThread argument in Why is sound; ask a maintainer to record the choice to put a second inbound lifecycle inside
Staged(AGENTS.md:204-206 (not opened)). No code change.
Nits:
5 nits
Full report, with citations, severity rationale, what was resolved since the last head f9c9191, the verified-sound list and open questions, follows in the report body. Evidence for every finding is in the case file (https://autobot.eidonix.com/api/v1/cases/774e16ea-5f84-4ff8-9166-74ab6876cc37.html). No toolchain, GPU or test run was available to this review: every finding is established from source at head 0c04b1e2.
Full report · Notes Decision to Test: yes (68%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing. Human Approval: Approved by D-Rock on Autobot, Nov 25, 2026 12:38 AM ET.
Approve Hardware Testing for 496
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches" (round 2, head
0c04b1e2)Decision: REFER to hardware testing, with a deliberately small plan (≈2–2.5 h of cn7 GPU time), after a Step 0 desk gate.
Last round I said do not test yet. All three blockers from that report are now settled at this head, and the three lenses that were negative on substance have flipped to clean (Correctness: clean; Simplicity: clean; Prose: clean; Architecture: no blocking finding). What remains is one internal-API layering objection, one silent-drift hazard, two duplications and a pile of nits — none of which changes a byte of the path a hardware test would exercise, and none of which any reviewer asks to be re-measured. Two lenses independently endorse the approach ("belongs in the repo", "worth merging, with changes").
Head
0c04b1e2(basemainc0c4f798), 3 files, +3358/−933:selene/src/disk_store.rs,selene/src/shard.rs(not opened),docs/prefix-cache-offload.md. Author FujitsuPolycom. One author response in the thread, no human maintainer sign-off, no CI at head. Security screen: all clear (test-fixture strings such asinjected private transfer failureand theunreachable!("window rate samples stay local to rank zero")guard are benign; the only agent-directed text in the thread is this repo's ownflare-autobotfooter, which I did not act on).The three prior blockers, re-verified at this head
- Logical vs physical byte accounting feeding admission — fixed.
TransportEvent::InboundWindowSample { bytes, elapsed }is emitted once per completed physical shared window (inapply_shared_disk), andDiskStore::applyshort-circuits it intoself.inbound_rate.observe(bytes, elapsed)beforestats.progress += 1(disk_store.rs:3632-3635); theFetchedarm no longer samples the rate and only doesself.stats.bytes_in += bytes(:3669), sobytes_instays logical.hit()'sestimated_seconds(:3625) is now priced from physical bandwidth. A dedicated test,coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical, asserts rate stability and logicalbytes_inacross 1 vs 8 restore concurrency. The split is documented (docs/prefix-cache-offload.md:362-366and:1528-1531).- The 61.3K 8/9-vs-7/9 accuracy regression — resolved, not swallowed. The author showed Flare has no greedy decoding (temperature 0 is clamped into a positive sampling range) and that the original script used per-build prompt nonces; five cold-VRAM repeats (
seed = 1234..1238, 60,534 tokens,top_logprobs = 5) produced identical FP32 top-5 logprobs and token IDs on both arms (6/9, 8/9, 7/9, 9/9, 4/9 each). The suspect hazard is now directly covered bymisaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore, which byte-compares askip_pages = 13follower against a private-store baseline across a partial ancestor tail ([64..71)) and a partial leaf chunk carryingrow = true— the exact pair I asked for.- Benchmarks predating the tree — fixed. The table is keyed
main c0c4f798vs0c04b1e2, the head under review: 18,177.5 → 4,306.7 MB (4.22×) and TTFT 7,974.6 → 5,662.8 ms (−29.0%) simultaneous; 18,194.2 → 4,843.6 MB (3.76×) and 6,883.6 → 5,951.9 ms (−13.5%) staggered; Flash-Next 7,944.9 → 1,981.1 MB with only −3.1% TTFT. Un-rerun multi-host rows moved to "Not covered"; the single-restore cost is now labelled an expected bound withbuild_pending_demand'sdevice_inbound.len() <= 1fast path named.What still stands, and why none of it blocks the test
- Should fix (layering, not behaviour): the metering sample rides
TransportEvent, the enum that is also the cross-rank wire event set, forcingunreachable!()inKind::of(shard.rs:477(not opened)) upheld by two hand-written guards (shard.rs:722-725(not opened),:1148-1150).selene::disk_storeispub mod(lib.rs:25), so this is also a public-API addition. A thirdKind::ofcaller would panic in release; both current paths filter first, and no hardware test reaches a third caller. The existing helper atshard/tests.rs:339mapsKind::ofover aSharded's events and survives only because those tests issue no fetch.- Should fix (metering semantics, worth sanity-checking in the test):
inbound_ratenow measures pure disk-thread time (disk::Reply.elapsedaroundworker.executeonly — oneO_DIRECTread plusxxh3, no queueing, no GPU upload), so restore estimates are slightly optimistic — the mirror image of the previous inflation.CompositeStorestill measures its own end-to-end rate, so the two stores now measure different quantities under one name. The author's live figures (6.07 GB/s single vs 7.71 GB/s 8-way) sit in the same band as #497's 8.68 GB/s end-to-end number, i.e. the bias looks small. Direction is provable from code; magnitude is not.- Should fix (silent drift):
HeaderIdentityhand-writesHashover fourteenHeaderfields with a..rest pattern (disk_store.rs:1014-1050), mirroringPartialEq1,200 lines away inshared/record.rs:136-152(not opened). I re-checked the field lists: they agree today, so coalescing is correct at this head. The hazard is future — the pending compression PRs (#504 addsHeader.packed) would silently drop a field from the hash. Not testable on hardware.- Should fix (duplication):
pick_next_pending_planrestatesLayout::record_slots(disk_store.rs:1766-1777) instead of calling the helper (geometry.rs:180-182) that the allocator it guards already uses. Cosmetic.- Known-fragile assertion:
staggered_arrival_attaches_out_of_order_to_in_flight_windowsasserts an exact total,disk_window_reads() + coalesced_windows() == 10(disk_store.rs:8487). The Value lens flags it as a load-dependent flake; it reads as a total-window invariant rather than a timing count. Run it once in Step 0 and note the result — if it flakes that is a test bug, not a product bug, and does not justify hardware time.- The one reviewer proposal that could change a tested number: the Subtractive lens wants
build_pending_demand+ thedemandplumbing deleted (~80 lines). Its own open question is whether the staggered-arrival figure (3.76× vs 4.22×) survives. Do not test that variant. Test0c04b1e2as merged, and report simultaneous and staggered separately so a later deletion has a baseline.- Process note for the maintainer, not a test question: the design call — a second reference-counted inbound lifecycle inside
Stagedrather than inDiskThread— is now argued in the PR's Why section (staging slots must stay pinned until every follower's asynchronousCopierupload finishes, whichDiskThreadcannot see) but has no recorded maintainer sign-off (AGENTS.md:204-206(not opened)). Also: #497 is not stacked on this PR (pr/497still haspump_inbound/Destination), and #496's ownpump_allstill submits maintenance first (disk_store.rs:2291-2312) —pump_allwill keep moving after merge. Neither affects what I would test.Expected value of the hardware test
High, but sharply bounded. The mechanism is host-side Rust I/O bookkeeping: no CUDA, no record-format or
Headerchange, no new flag/env/recipe knob, no per-model branch, sharing keyed on(path, expected Header)identity, failure isolation preserved (private child/upload errors fail one restore; shared open/read errors fail the cohort and route throughis_record_read()→drop_row). Unit tests assert the right properties — byte-exactSimulatedGpupages and rows,pool.free_slots() == pool.slot_count(), no pinned index nodes.Two things only a run settles:
- Does the ~4× physical-read reduction and the −29% burst TTFT reproduce at head on GB10? This is the load-bearing claim.
- Is the admission-rate change harmless? Single-stream restore TTFT/bytes must stay at parity with
main; the metering nit predicts a small optimism, not a cliff.The description's own inconsistency (8 branches claimed, but "before" 18.18 GB is ≈4.5 copies of a ~4.0 GB prefix, not 8, while
bytes_inis stated as 8× single) is answered for free by testing 4 branches.Do not spend hardware time on
- Flash-Next rows (−3.1%/−2.8% TTFT for 75% fewer reads): no decision turns on it; it costs another warm-up cycle on a second model.
- DeepSeek TP4
1.00×: reported null with a stated cause (per-rank 52.8 MB reads finish before tokenization, so requests never overlap inStaged). Nothing to validate.- Multi-host RoCE, Windows IOCP, discrete PCIe, 2-GPU
split_pools: no matching hardware (cn5 is not connected; cn7 is a single GB10). Theshard.rs(not opened) edits are unit-covered; live multi-host is out of scope for both nodes.- cn5: never connected; and even then, a different GPU class useful only as a disambiguator if cn7 surprises.
- Re-running the crate suite more than once, or otherwise using GPUs to check "tests pass" — desk work.
- The deleted-demand-index variant — do not test code that is not in this PR.
Minimal test plan — cn7, ≈2–2.5 h of GPU time (≈4 h wall clock)
Target cn7: 1× GB10 (SM121, the same class as the author's evidence). Job gets 10 CPUs / 60 GiB RAM / 16 GiB scratch. Use
nvidia/Qwen3.8-27B-NVFP4(matches the load-bearing row). The model list shows all three checkpoints at 0 GiB — confirm the NP4 weights are actually cached before starting, or a cold download will dominate the run.Two setup traps to avoid (both verified in the docs):
- Disk limit.
docs/prefix-cache-offload.md:839-842: the limit defaults to one tenth of free space at startup. On a 16 GiB scratch that is ~1.6 GB, while a ~61K-token Qwen3.8-27B TP1 prefix is ≈954 pages × ~4.19 MB ≈ 4.0 GB of parent record. Left at default, the warm prefix is evicted and the burst restores from prefill — the test would silently measure nothing. Pass--prefix-cache-disk-limit 8Gexplicitly and confirm the startup line reports it. Child branch records are tails only, so 4 branches fit alongside the parent in 16 GiB.- Metric semantics.
flare_host_cache_bytes_in_totalis logical by design (that is the whole point of the PR) andflare_host_cache_inbound_bytes_per_secondnow reports DiskStore's disk-thread-only rate. Physical NVMe traffic must come from the device, not the store.Step 0 — desk, on the node, no GPU (≈20 min). Stop if red.
cargo test -p selene --features test-supportat0c04b1e2; expect ≈476 passing. Watch specifically:coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical,misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore, and the== 10assertion instaggered_arrival_attaches_out_of_order_to_in_flight_windows. Also buildmain(c0c4f798) once for the A/B arm.Step 1 — the burst, A/B, simultaneous (≈60 min GPU). Start
flare runwith--prefix-cache-memory 0 --prefix-cache-disk <scratch dir> --prefix-cache-disk-limit 8G. Warm one ~61K-token shared prefix plus 4 distinct child branches to disk; restart so VRAM is cold. Send 4 concurrent/v1/chat/completionsfollow-ups. Repeat the identical script onmain. Three trials per arm, interleaved (main, head, main, head…) to cancel drift. Measure:
- Physical NVMe bytes for the restore window from
/proc/diskstats(or/sys/block/<dev>/statsectors-read deltas) on the device backing the cache directory. Expect ≈4× reduction (author's 4-way equivalent: ~4 copies ≈16 GB before vs ~4 GB after).- Burst median TTFT (ingress-to-first-token, same definition as the table). Expect ≈−20% to −30% on 27B-NVFP4 TP1.
flare_host_cache_fetched_total == 4,flare_host_cache_fetch_failed_total == 0,flare_host_cache_reused_tokens_totalwell above the prefix size,flare_host_cache_slots_in_usereturning to 0 after drain (inbound_in_flight == 0). All names verified inhelios/src/server/metrics.rs:1087-1310.Three trials is enough: a 25–30% effect needs no tighter bound to be actionable.
Step 2 — correctness of the coalesced path (≈20 min, folded into Step 1's runs).
- All 4 branches' full generated text byte-identical to the same requests served with disk offload disabled. All four, not one.
- One staggered burst (submit branch 1, wait for first token, then submit the rest), 1 trial, no TTFT claim: confirm no hang, no
fetch_failed, coalescing still engages.- 3 repeats of the 61.3K 9-fact retrieval probe on both arms, cold-VRAM restart. The author's 5-seed parity run predicts agreement; a consistent head-only loss is stop-and-escalate, not a qualification result.
Step 3 — regressions this PR can plausibly break (≈30 min).
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main. This is the path the metering nit predicts could be mis-priced and the path the "expected bound" is about.read_into/ corrupt-record path:tests/server/test_prefix_cache_offload.py— note it is not a drop-in CLI check::26-31requiresFLARE_RUN_CUDA_TESTS=1,CUDA_VISIBLE_DEVICES, andFLARE_OFFLOAD_TEST_CORE=<core .safetensors>, plus a built release CLI and--basetempon a direct-I/O filesystem (docs/prefix-cache-offload.md:1438-1447). It launches its own servers and already asserts exactly the properties I want (fetched>0,fetch_failed==0,reused_tokens>32000at:160-173; corrupt-record fallback at:185-186). Pre-check those env vars in Step 0; if no runtime core is available on cn7, substitute a hand-driven corrupt-record HTTP check rather than skipping the regression entirely — it matters more now that one shared read error fails a whole cohort.- Idle and shutdown: one restore, then
SIGTERM; clean exit. If drain is slow, capture the"N disk transport jobs did not complete"message — its count is known to mix unrelated quantities, so record rather than act on it.Stop conditions. No read reduction in Step 1 → mechanism failure, stop and report. Any differing output in Step 2 → correctness defect, stop and report (and say which configuration diverged, since the private-baseline test should have caught it). Single-stream regression beyond noise in Step 3 → report as the under-stated cost.
Budget: 20 min desk + 60 min burst A/B + 20 min correctness + 30 min regressions + 20 min slack ≈ 2–2.5 h cn7 GPU time, one node, one model, no multi-host.
Bottom line
The change solves a real, measured, charter-aligned bandwidth problem in the correct layer. At this head its evidence is attributable to the commit that would ship, its accuracy question is answered with a five-seed parity run plus a dedicated misalignment test, and its metering error is corrected. Residual issues — a statistic riding the wire-event enum, a hand-written
Hashthat will rot whenHeadergains a field, two duplications, a stale doc paragraph, and a maintainer sign-off that has not been recorded — are worth fixing before merge but change nothing a hardware test measures. Refer it, run the plan above once on cn7, and the merge decision rests on Step 1's physical-read delta and Step 2's output parity.
screen malicious
Screen Result: All Clear
Evidence:
Screening of PR #496 ("Coalesce shared ancestor reads across concurrent Selene disk fetches", head 0c04b1e, base main, 3 files, +3358/−933) found no prompt injection, no agent-directed instructions, no hidden or unrelated code, and no attempt to steer agentic behavior.
Scope reviewed. All three changed files were read in full: selene/src/disk_store.rs (the whole ~188 KB diff, in slices), selene/src/shard.rs (+10/−0, three hunks adding TransportEvent::InboundWindowSample handling), and docs/prefix-cache-offload.md (+35/−2, two prose hunks). The full conversation was also read: three comments — two from the repo's automation account flare-autobot and one substantive author reply from FujitsuPolycom addressing the review points.
What the content actually is. An ordinary Rust refactor: new SharedSegment / SharedWindow / WindowKey / HeaderIdentity / DeviceInbound types, a pass-based pump_device_inbound, a new TransportEvent::InboundWindowSample, test-support-gated diagnostic counters, and ~13 new coalescing unit tests with plain English names and comments. The docs change is technical prose about staging windows, immutability and metrics. Nothing outside the description's stated scope was touched (no scripts, CI config, lockfiles or binaries).
Checks that came back clean. No injection markers ("ignore previous", "system prompt", "disregard", "jailbreak", "exfiltrate", "autobot", "claude", "anthropic", "openai", http(s)://) in the changed files; no second-person or agent-directed language ("you", "please", "reviewer", "approve", "merge", "LGTM", "skip the test", "disable") beyond benign code prose ("younger sibling", "must not be reused or released"); no execution/network/credential primitives added (std::process, Command::new, HTTP clients, base64, include_str!/include_bytes!, concat! obfuscation, .ssh, authorized_keys, chmod, setuid, LD_PRELOAD) — the only hits are pre-existing test helpers and unrelated CA-bundle paths already in selene/src/pool/net.rs (not opened); no zero-width, bidi-override or BOM code points; no long base64-like blobs.
One item worth flagging, though not malicious. The comment thread contains third-party review-bot boilerplate ("A case file has been opened for 496 … should be read by agents working on this code base") linking to autobot.eidonix.com URLs, with an #autobot:ignore opt-out. This is repository review automation rather than content authored to direct agents in this PR, and I did not fetch the external links. Other agents working this PR should treat those URLs as untrusted external material, not instructions.
Limits. External links were not fetched; the code was not built or run (this is a content/intent screen, not a functional review); the sweeps were scoped to the changed files. PR state at screening: open, no CI checks on head, no human reviews yet. Residual risk is low but not zero — a payload hidden in the un-fetched external case-file URLs, or semantics buried in ~188 KB of legitimate Rust, would not have been caught by text sweeps alone, though a full read of the diff surfaced nothing.
The only substantive issues are code-quality points already raised in review (unreachable!() arms for the new event; hand-written HeaderIdentity Hash; a duplicated docs metrics statement). No security findings.
Verdict: All Clear.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR; Discord: Dooner)
Motivation: When several concurrent requests resume from the same on-disk prefix checkpoint, each one today opens the record file and reads the same ancestor pages again, so the disk does four to eight times more physical reading than it needs to. This PR makes those concurrent restores share one open file and one set of staging windows when their reads line up on 64-page file boundaries, so the bytes are read off disk once and reused.
Scale: +3358 / −933 lines in 3 files (head 0c04b1e2; selene/src/disk_store.rs +3313/−931, docs/prefix-cache-offload.md +35/−2, new selene/src/shard.rs +10/−0)
Proposal:
- Split the single inbound path into a host-owned
HostInboundpipeline and a deviceDeviceInboundpipeline with sharedSegmentKey/WindowKeybookkeeping (SharedSegment,SharedWindow). - Align device staging windows to absolute
WINDOW_PAGESboundaries so restores with different GPU-resident prefix lengths produce identical suffix windows and attach to one another. - Replace the per-record pump with a five-pass scheduler (
pump_device_inbound) driven by a cross-fetch demand index, plus a per-window bandwidth sample (InboundWindowSample) soinbound_ratestays physical whilebytes_instays logical. - Preserve failure isolation: a shared Open failure fails its users, a private child or upload error fails only that restore.
- Rewrite the §2.4
Stageddocumentation and add seven coalescing tests plustest-support-gated counters (disk_opens,disk_window_reads,coalesced_windows). Touches: selene/src/disk_store.rs(Staged: new inbound lifecycle, shared segments/windows, scheduler,HeaderIdentity)selene/src/shard.rs(addsunreachable!/skip guards forInboundWindowSample)docs/prefix-cache-offload.md(§2.4Stageddescription) Related items:- #497 Reduce disk offload restore latency and integrated-memory intake overhead (open): stacked companion, reviewed Ready To Merge, no
Destination/InboundRecord/two-argplan_windows, so either merge order still holds. - #504 selene, helios, ignition, heliopause: add pure-CUDA GPU and CPU lossless KV compression (merged): now on main and adds
Header.packedtoPartialEqplus a thirdHostPackeddestination — the rebase surface. - #477 / #486 / #492 (closed): earlier compression PRs, superseded by #504; drop from the related list.
- #498 / #499 (merged): author's other Selene PRs, different code paths, not relevant.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Autobot comments: The new event is a second autobot review at 2026-11-25 05:23 on the unchanged head
0c04b1e2, and it materially improves the outlook: Blockers: None — the run-238 blocker on the 61.3K retrieval check is formally closed and the author's parity argument was accepted. Five should-fix items replace it, all verified accurate against source, and only the design-sign-off item survives from round one — which matters becauseAGENTS.md:204-206says "a routine PR approval is not that decision", so merging cannot retroactively supply the maintainer sign-off. Two things I verified that the review does not say: the hash defect it flags is already live on post-#504 main (two records differing only inpackednow compare unequal yet hash identically in #496'sHeaderIdentity, colliding into oneWindowKeywith no test guarding hash/eq agreement), and the round-1 metering fix introduced aprogress-counter asymmetry that re-runs a maintenance pass per physical staging window during exactly the burst this PR optimises. #496 is no longer a clean 3-file merge: it needs a real rebase plus one unstated design decision about whether a contiguous packed payload participates in window coalescing.
Value Proposition
PR #496 — Coalesce shared ancestor reads across concurrent Selene disk fetches
Verdict: worth merging, with changes
Nothing new landed on the branch (head is still 0c04b1e2; files: docs/prefix-cache-offload.md +35/−2, selene/src/disk_store.rs +3,313/−931, selene/src/shard.rs +10/−0). The change clears the charter's bar on all four tests it sets for a performance PR, and the prior round's blocker (61.3K retrieval parity) is settled. What is left is a short list of should-fix items — two of real substance, the rest docs and process. I update the previous report: one of the bot's five items is overstated, and two panic/consistency sites it did not mention need the same treatment.
Charter fit
- Goal, not a non-goal. Goal 4: "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene." This touches only
seleneplus one docs section. No new flag, no format change, no re-export (selene/src/lib.rs:44-56untouched), no per-model branch — so it passes "keep the runtime small and model-agnostic" and "no per-model special cases or flags." - Right problem, right layer (
AGENTS.md:165-169). The waste was insideStaged::fetch, below the scheduler's per-key ticket attachment thatdocs/prefix-cache-offload.md:318-319already promises ("an inbound for a key already in flight attaches the request as another waiter"). The PR closes exactly that gap and does not reach up into Helios. TheStaged-vs-DiskThreadargument in Why is correct on the code:DiskThreadsees only file offsets and raw host addresses and is done when direct I/O andxxh3finish, whereas a shared staging slot must stay pinned inSlabPooluntil every attached follower's asynchronousCopierupload completes (WINDOWS_IN_FLIGHT = 2,disk_store.rs:63/shared/limits.rs:18). - Evidence rule (#210,
AGENTS.md:165-166). Satisfied at the head: before/after on a served workload (flare run,/v1/chat/completions, ingress-to-first-token TTFT), four topologies, cold-VRAM restart, plus correctness evidence (five-repeat FP32 parity againstmain, byte-exact misalignment test) that a performance PR rarely carries. - Maintainer decision (
AGENTS.md:201-206). The one process gap: putting a second inbound lifecycle insideStagedis an architectural placement call. The rationale is written in Why, butAGENTS.md:204-206wants the design choice recorded by a maintainer ("a commit acknowledgment or routine PR approval is not that decision"). Ask for that explicitly; it is a one-line ack, not a code change.
Who benefits, how much
Anyone running concurrent branching/agent traffic at a disk-resident shared prefix on SM121/DGX Spark with --prefix-cache-memory 0 --prefix-cache-disk — precisely the mode selene/src/offload.rs:600-641 builds as a bare DiskStore.
Author's GB10, head 0c04b1e2 |
Physical NVMe read | Median TTFT |
|---|---|---|
| 27B-NVFP4 TP1, simultaneous | 18,177.5 → 4,306.7 MB (−76.3 %, 4.22×) | 7,974.6 → 5,662.8 ms (−29.0 %) |
| 27B-NVFP4 TP1, +25 ms stagger | 18,194.2 → 4,843.6 MB (−73.4 %, 3.76×) | 6,883.6 → 5,951.9 ms (−13.5 %) |
| Flash-Next TP1, simultaneous | 7,944.9 → 1,981.1 MB (−75.1 %) | 3,327.5 → 3,225.0 ms (−3.1 %) |
| Flash-Next TP1, +25 ms stagger | 7,958.0 → 2,251.5 MB (−71.7 %) | 3,137.7 → 3,049.9 ms (−2.8 %) |
The TTFT percentages all recompute correctly, and the arithmetic is coherent: one 61,054-token prefix is 954 pages × ~4.19 MB ≈ 4.0 GB, so "after" at 4,306.7 MB is essentially one copy plus eight ~256-token tails, and the removed duplicate reads at the measured 6–7.7 GB/s account for the 2.31 s drop. The bandwidth win is uniform (~75 %); the latency win is concentrated where the single disk thread is the bottleneck (27B TP1), and the description now says Flash-Next only gains 3 %.
No-regression path, verified in the code: build_pending_demand returns early when device_inbound.len() <= 1 (disk_store.rs:1736), window_index is an O(1) HashMap lookup (1646-1663), attach_pending is shared with Pass 4 (1711), and plan_windows(..., align_to_window) only aligns for device restores (682-727). The single documented cost — at most one extra partial window per segment when skip_pages % 64 != 0 — is in docs:354-358.
Is there a simpler way? No
Re-checked at this head: copier::Job::replication fans one verified share to several ranks, not one host window to several GPU page ranges across requests; keeping a 4 GB prefix in DRAM is what --prefix-cache-memory 0 exists to avoid on a 128 GB Spark; and scheduler-side dedup cannot work because each branch needs its own pages in its own snapshot slot. The bytes can only be shared where this PR shares them. It also does not duplicate #497: #497 shrinks disk-only intake to intake_slots(layout, 1) — two staging windows — and documents that concurrent unique-prefix restores serialize through them; #496 is what lets eight shared-ancestor restores share those two windows. #497 alone would make shared-prefix bursts worse; #496 alone wins on a larger pool.
What it costs
- Complexity.
disk_store.rs6,976 → 9,358 lines (tests 2,827 → 3,937): ≈+1,110 production, ≈+1,270 test lines in the most delicate file inselene. New machinery:SharedSegment/SharedWindow,HeaderIdentity/SegmentKey/WindowKey,SharedFileState(5 states),SharedWindowPhase,WindowFollower,DeviceActiveWindow,DeviceSegmentRef,DeviceInbound, and an eight-passpump_device_inbound(1883) over a dozen helpers. The author has since collapsed key construction intoWindowKey(1059), unifiedplan_windowsbehindalign_to_window, removedPlanState, and gated the counters, so it is reviewable and commented pass by pass — but it is a second inbound lifecycle in a file that already had two. - Risk surface. One shared
record_readerror fails every attached restore; a coalesced window pins its slots until the slowest follower uploads; sibling-demand preference relaxes strict arrival order. All three are now documented atdocs/prefix-cache-offload.md:337-366. - Metering definition change.
DiskStore::hitpricesestimated_seconds = record_bytes / inbound_rate(disk_store.rs:3615-3628), andinbound_ratenow observes disk-thread window throughput — excluding queueing and the GPU upload — wheremainobserved per-restore end-to-end. That makesworth_fetching(store.rs:423-438) andrestore_wait.defer(helios/src/server/runtime.rs) marginally more permissive, and changes whatflare_host_cache_inbound_bytes_per_second(helios/src/server/metrics.rs:1310) means.CompositeStorekeeps its own end-to-enddisk_inbound_rate(composite.rs:358), and on multi-host the sample is rank-0-only (shard.rs:1148-1150drops it on peers). Measured 6.07–7.71 GB/s sits in the same band as #497's end-to-end 8.68 GB/s, so the bias looks small — but it must be in the docs.
Evidence — strong
- Parity settled the right way. Five cold-VRAM repeats (
seed = 1234..1238,60,534tokens,top_logprobs = 5) gave identical FP32 top-5 logprobs and token ids onmainand head (6/9, 8/9, 7/9, 9/9, 4/9both), with the honest root cause (Flare has no greedy mode; the first script used per-build prompt nonces) rather than a swallowed difference. - The one plausible correctness hazard has a direct test:
misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore(disk_store.rs:8767+) runs askip_pages = 13follower alone and then as a follower and asserts byte-equalSimulatedGpupages and row. - Leak/failure tests assert pool
free_slots()and index pins (private_failure_isolation_preserves_sibling_sharing_ancestor,shared_ancestor_failure_propagates_to_all_followers_without_leaks,staged_close_drains_active_coalesced_fetches_cleanly). - Invariants I re-verified at this head:
window_indexcannot be clobbered by a live entry (Pass 4 creates a window only whenattach_pending/find_reusable_windowfound none,1646-1748);record.bytes += win.read_bytescredits exactly one window per completed plan (1901) with(segment, first, count, row)in the key, so logical totals match;Fetchedis deferred until the last user's segment close settles (2244-2255), which is what makes the pin release at3656-3658safe;HeaderIdentity::equsesArc::ptr_eqthenHeaderequality, so equal headers cannot be missed (1006-1010). CompositeStoreis better covered than the Not covered line says:composite.rs:1229routes non-resident chains intoDiskStore::fetch→Staged::fetch, andhelios/src/offload/gpu_tests.rs:1275-1289(not opened) buildsCompositeStore+DiskStoreover real CUDA transfers in the 21/21 SM121offload::suite the author ran. Correct that line.
Should fix before merge
- Get the rate sample out of
TransportEvent(the strongest item).InboundWindowSample(disk_store.rs:97-101) carries noJobIdyet sits in the enum documented as "Completion the transport reports to the disk store" (:83). It forces twounreachable!()s, not one:shard.rs:476-478(Kind::of) anddisk_store.rs:3638(DiskStore::apply's match, guarded only by the earlyif letreturn at3632), held up by the filters atshard.rs:722-725and1148-1150. A third call site is a release-mode serving crash; aStageddrain method or a field onFetchedremoves both.- Correction to the bot: the
CompositeStore::pollside effect it cites (composite.rs:1376stats.progress += 1, re-runningspill_parked+disk.maintain()at:1418-1428) cannot happen in the benchmarked configuration. With--prefix-cache-memory 0 --prefix-cache-disk,captureis false (offload.rs:587) andoffload.rs:632-641returns a bareDiskStore. It does bite warm-plus-disk configs, where ~954 windows would each trigger maintenance instead of ~8. Say so; do not let the wrong config justify the right fix.
- Correction to the bot: the
- Close the
HeaderIdentityhash drift — but not the way the bot suggests. It hashes 14 fields through a..pattern (disk_store.rs:1014-1050,..at:1030) againstHeader's exhaustivePartialEqin another module (shared/record.rs:136-152); a newHeaderfield silently drops out of the hash and coalescing quietly stops. DerivingHashonHeaderis wrong —versionis deliberately excluded from equality (shared/record.rs:118-119). Instead spell the ignored fields explicitly (version: _) so adding a field is a compile error, and add ana == b ⇒ hash(a) == hash(b)test. - De-flake
staggered_arrival_attaches_out_of_order_to_in_flight_windows.assert_eq!(staged.disk_window_reads() + staged.coalesced_windows(), 10)atdisk_store.rs:8487contradicts its own comment (8481-8484: "at least W1 and W2 are guaranteed"). Assert bounds (coalesced ≥ 2,reads + coalesced ≥ 10) instead of an exact total that depends on disk-thread timing; this runs in CI. - Document the metering semantics once. State that
inbound_rateexcludes queueing and the GPU upload, that on multi-host it is rank-0 NVMe only (shard.rs:1148-1150), and thatCompositeStorekeeps an end-to-enddisk_inbound_rate. Merge the duplicate statement (docs:362-366vs:1528-1531) and split the 250-word §2.4 paragraph into mechanism + limits/failure-scope bullets — the bot's item 4 is right on maintainability. - Note the public-API surface.
TransportEventis public viaselene::disk_store(not re-exported inlib.rs:44-56); adding a variant is a breaking change for any external exhaustive matcher. One line in What, and consider#[non_exhaustive]. - Reconcile the "8 child branches" label with the read totals. "After" = 4,306.7 MB is ~one copy — correct and impressive. But "before" = 18,177.5 MB is ≈4.5 copies, not 8 (8 concurrent ~4 GB restores would be ≈32 GB), while
flare_host_cache_bytes_in_totalis claimed to be 8× single (~32 GB) in the same breath; and simultaneous vs staggered before-totals agree to 0.1 % (18,177.5 vs 18,194.2), which points to a shared cause rather than arrival timing. Either the burst overlapped ~4–5 restores at read time or the physical gauge under-counts — say which. An honest 8-way figure makes 4.22× larger, so this is credibility, not a threat. - Sequence and reconcile with #497 in writing. Both now say "merge in either order" while both edit
Staged::pump_all(disk_store.rs:2291) and #497 addsMAINTENANCE_DEFER_LIMITplus inbound-first ordering. Note also that #497 shrinks integrated disk-only intake to two windows, which is exactly the pool this PR needs to be shared — state the order and land the second one'spump_allas reviewed. - State the coverage boundary in Evidence: multi-host RoCE (the entire
shard.rssurface of this PR), 2-GPUsplit_pools, discrete PCIe GPUs, Windows serving, and livePooledStoreGPU serving were not exercised live.mainis unaffected there, and #497 has the same boundary, but the shard edits are untested beyond unit level.
Items 1–3 are small code changes; 4–8 are text plus one maintainer ack. None requires redesign. The Layout::record_slots item the bot raised last (disk_store.rs:1777 vs geometry.rs:180-182) is cosmetic — record_slots(pages, row) is literally pages + usize::from(row) * row_slots — worth doing while touching the function, not a reason to hold the merge.
Bottom line
Worth merging, with changes. By the charter's own tests: it fixes a measured, reproducible performance problem (#210) on the project's headline model and hardware; it lives in the one layer where the bytes can be shared and adds no flag, format, re-export, or per-model branch; its correctness evidence is unusually good for a performance PR and now covers the exact misalignment hazard plus five-repeat FP32 parity against main; and it composes with #497 rather than duplicating it. The cost is real — ≈1,100 production lines of reference-counted concurrent state in selene's most delicate file, a cohort-wide blast radius on a corrupt record, and a changed bandwidth metric — but it is paid once, it is documented, and the alternative is 4.5× redundant NVMe reads for the exact burst shape (branching agents on a shared prefix) Flare exists to serve. Fix item 1 (both unreachable!s), 2 and 3, tighten 4–8, get the maintainer ack, and merge.
(Conversation on the PR is this repo's own automated case-file bot plus the author's responses; the only instruction-like text are the bot's "to opt out" footers, which I did not act on. No human reviewer has signed off yet.)
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- docs/prefix-cache-offload.md:337-366: one 30-line paragraph carries ~12 separate behaviours and its last three sentences repeat §4 at :1528-1531 almost verbatim; split into a short mechanism paragraph plus bullets (the style already used at :333-336) and keep the metrics statement only in §4.
- selene/src/disk_store.rs:1767-1777:
pick_next_pending_planrestates the allocator's slot rule by hand (plan.count + usize::from(plan.row) * row_slots) instead of callingLayout::record_slots(geometry.rs:180-182, already used at disk_store.rs:245); bind the transfer lock and callrecord_slotsso admission cannot drift from allocation. - selene/src/disk_store.rs:1001-1050: the 37-line hand-written
Hash for HeaderIdentityrestatesHeader'sPartialEqfield list (selene/src/shared/record.rs:136-152) becauseversionis excluded from equality; hash onlyself.0.key(unique per record) so a newHeaderfield cannot silently break coalescing. - selene/src/disk_store.rs:2513-2528, 2541-2544:
Staged::closereportsstore_jobs.max(internal)as "N disk transport jobs did not complete", whereinternalis a max over owners, maintenance, shared segments and shared windows; count store records plus maintenance jobs (or reportbusy()as a boolean), since the number reported is not a job count. Nits: 4 (single-segmentHostInboundmodelled as aVecplus a redundantreads_left;SharedSegment.id/SharedWindow.idduplicating their map keys; deaddemand.is_empty()guard at :1781-1787; twodisk_read_countedflags that exist only so a test counter counts windows rather than jobs). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Conventions
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:1014-1050: the only hand-written
Hashinselene/srcmirrorsHeader'sPartialEqowned 1,200 lines away inshared/record.rs:136-152; the..at :1030 already dropsmain's newpackedfield, and nothing tests hash/eq agreement. - selene/src/disk_store.rs:97-101: a disk rate sample (
TransportEvent::InboundWindowSample) is added to the enum documented as completions (:83), forcingunreachable!()at shard.rs:476-478 plus two hand-written skip guards (shard.rs:722-725, :1148-1150), and makesCompositeStore::pollcount it as progress (composite.rs:1376) ahead of the maintenance gate (:1418-1429); the crate's precedent for rate signalling is a counter, not an enum variant (Budget::progress, input.rs:80-81, :146-148). - selene/src/disk_store.rs:1767-1777:
pick_next_pending_planrecomputesplan.count + row*row_slotsby hand and takes thetransferslock per candidate instead of callingLayout::record_slots(geometry.rs:180-182), the helper the allocator it guards already uses (disk_store.rs:245). Nits: 6 (last surviving thirdWINDOW_PAGESsplitter in memory.rs:1336-1367;Staged::close's.max()chain reported as "disk transport jobs"; twosettled()predicates; three repeated unindex blocks and two repeated follower-detach closures; positionalGatedCopier4-tuple; ~250-word §2.4 bullet repeating the metrics contract from §4). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Correctness
Verdict: clean Blocking:
- None. Should fix:
- None. Nits: 2 Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Reviewed PR #496 at head 0c04b1e2 (3 files, +3358/−933) through the correctness lens: every caller, lifecycle, error path, concurrency transition and data-compatibility surface of the two new shared-window read paths in selene/src/disk_store.rs and the event plumbing in selene/src/shard.rs. No blocking or should-fix correctness defect. The three issues raised on the previous revision are fixed in code at this head: per-physical-window InboundWindowSample metering with logical bytes_in (disk_store.rs:1596-1620, :3631-3635, :3669), the Staged::close abandoned count (:2513-2528), and the misaligned-follower parity test.
Soundness checks that came out clean: shared windows free only when followers.is_empty() && disk_referenced == 0 && upload_referenced == 0 (:1755-1771), with disk_referenced incremented at every submission (:2100, :2128) and decremented at :1594, so no reply can arrive for a freed window; segment disk::Close waits on active.is_empty() (:2213-2230); failure isolation correctly separates per-restore errors (record.fail, :1563-1565) from shared record_read errors that fail all attached restores after drain (:1509-1519, :1475-1487); HeaderIdentity's hand-written Hash (:1014-1050) covers every field of Header::PartialEq (shared/record.rs:136-152) with version non-semantic in both, so no SegmentKey/WindowKey aliasing and no on-disk format change.
Two nits, both verified in code this turn. N1: composite.rs:1376 increments stats.progress for InboundWindowSample before dispatch, while DiskStore::apply early-returns for it (disk_store.rs:3632-3636); via the maintenance_progress gate at composite.rs:1418-1429 this re-runs spill_parked + disk.maintain() once per physical window — safe but defeats the throttle. N2: disk_store.rs:2113-2116 can leave a window Reading with row_submitted == false and disk_referenced == 0 when the disk queue is full, so it is neither sampled (:1599-1611) nor uploadable until a later pump; correct, but the liveness invariant is undocumented.
Not verified: the #497 merge-order reconciliation of Staged::pump_all, Windows IOCP serving, multi-host RoCE, 2-GPU split_pools, discrete PCIe GPUs, and live CompositeStore/PooledStore GPU serving. No toolchain, GPU or test run was available; every statement is from source at 0c04b1e2.
Prose
Verdict: should-fix issues only Blocking:
- None. Should fix:
- docs/prefix-cache-offload.md:333-366: one ~250-word bullet carries four topics with no hierarchy (mechanism, invariants, limits/failure scope, metrics), violating AGENTS.md:116-121; the
bytes_in/inbound_ratecontract is also stated verbatim twice (:362-366 and :1528-1531), so the two copies can drift. Should fix: - (only the one above)
Nits: 3 — the description scopes
InboundWindowSampleto every physical window read although only shared device-fetchwindows emit one (disk_store.rs:1617-1620); two Flash-Next read-reduction ratios (3.99x, 3.52x) do not equal the ratio of the tabulated MB means (4.010, 3.535); and the description never states the arrival-order relaxation the docs now admit (docs:350-354). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Detail: the description satisfies the mandated four-part scheme (AGENTS.md:72-112, docs/design-review.md:137-150) at head 0c04b1e2: why/why-this-layer (including the Staged vs DiskThread lifetime argument), what changed with explicit before/after, results clearly separated from the "expected bound", and evidence naming baselines, commits, configuration, uncovered cases (Not covered) and the Discord: Dooner line. All three should-fix items from the earlier head f9c9191 are confirmed fixed: the rustdoc is back on Resources::allocate with its own line on free_slots (disk_store.rs:236-243), the old 8/9-vs-7/9 difference is explained by five cold-VRAM repeats with identical FP32 top-5 logprobs plus the Helios temperature clamp, and the single-restore cost is labelled an expectation matching plan_windows(..., align_to_window = true) (:702-724) and the device_inbound.len() <= 1 short-circuit (:1734-1738). The changed code prose — module doc :14-27, the SharedFileState/SharedSegment/SharedWindow/DeviceInbound/HeaderIdentity comments, the pump_device_inbound pass comments, and the new test names — describes the code as it exists in present tense with no chronology or journey narration, and the commit message is a single imperative subject with a four-part body.
Open questions: the Flash-Next ratio discrepancy can only be settled from the author's raw per-trial records (it is consistent with a mean of per-trial ratios where the 27B rows are means over two repeats). The live SM121 numbers, the Windows/IOCP count and the multi-host gaps cannot be checked from source; the description's Not covered list is consistent with the setup it names. No instruction-like content appeared in the PR body, comments or docs.
Architecture
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:97-101:
TransportEvent::InboundWindowSampleis a job-id-less store-local metering sample placed in the cross-rank transport event enum, forcingunreachable!()inKind::of(selene/src/shard.rs:476-478) upheld by two hand-written guards (:722-725, :1148-1150), panicking the existingKind::of-over-events helper (selene/src/shard/tests.rs:339) if a fetch ran there, and counting asprogressinCompositeStore::poll(selene/src/composite.rs:1376) to re-armspill_parked+disk.maintain()(:1418-1428). - selene/src/disk_store.rs:1014-1050:
HeaderIdentity's hand-writtenHashrestatesHeader's exhaustivePartialEq(selene/src/shared/record.rs:136-152) behind a..pattern, so a newHeaderfield silently drops out of the hash and coalescing stops with no test failure; derive/centralise the hash and add ana == b ⇒ hash(a) == hash(b)test. - selene/src/disk_store.rs:1767-1777: the admission guard recomputes
pages + row_slotsby hand instead of theLayout::record_slots(pages, row)(selene/src/geometry.rs:180-182) the allocator it predicts uses (disk_store.rs:245). - docs/prefix-cache-offload.md:337-366: one ~250-word bullet carries ~12 distinct behaviours (open-handle sharing, alignment, credit semantics, demand scheduling, re-read limit, extra partial window, failure isolation split, metrics split) and repeats the metrics contract at :1528-1531; split mechanism from limits/failure scope and state metrics once in §4.
- AGENTS.md:201-206: the invariant-level design decision (a second reference-counted inbound lifecycle inside
Stagedrather thanDiskThread; disk_store.rs:1082-1214, :1683-1755) needs an explicit maintainer sign-off recorded on the PR, not settled by routine approval. Nits: 1 —inbound_ratenow measures pure disk-thread time (disk::Reply.elapsed, selene/src/disk.rs:448-450), sohit().estimated_seconds(disk_store.rs:3625) prices restores optimistically whileCompositeStoremeasures a different quantity under the same name (composite.rs:994-1004). Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Subtractive
Verdict: make it smaller first The change: +3358 / -933 lines across 3 files (selene/src/disk_store.rs +3313/-931, selene/src/shard.rs +10/-0, docs/prefix-cache-offload.md +35/-2); roughly +900 of disk_store.rs is the new test module (:8234-9357), so production code is ~+2400/-930. Could remove: about 370-410 lines, in 10 places (≈11-12% of the change and ≈42% of the new test lines). Biggest subtractions:
- selene/src/disk_store.rs:8306-8329, 8403-8420, 8527-8544, 8647-8668, 8767-8783, 8843-8863, 8931-8947, 8982-8998, 9180-9199, 9230-9252: ten copies of the same 14-17-line
DiskStore::new(..Staged::new(Some(pool.clone()), ..))block plus the same twoSlabPoollines and three copies of the samerecordsvec; two helpers (staged_store,scanned_tree, ~24 lines) replace them: about 90-110 lines. - selene/src/disk_store.rs:1732-1793 (
build_pending_demand+ demand-awarepick_next_pending_plan), thedemandparameter onattach_pending:1711-1730 and the decrement sites :1939, :1991-1995: the whole table only reorders which new window a leader starts (coalescing is done byfind_best_existing_window_for:1665-1681) and is provably empty for every single-restore caller (:1736); nothing replaces it,pick_next_pending_plancollapses to first-unstarted-with-free-slots: about 65-80 lines. - selene/src/disk_store.rs:8830-8906
staged_close_drains_active_coalesced_fetches_cleanlyduplicatesconcurrent_burst_coalesces_shared_ancestor_opens_and_window_reads:8293-8384 (same fixture, same counters, same page/row loops, differing only in whenclose()runs): one test withfor close_early in [false, true]: about 70 lines. - selene/src/disk_store.rs:9110-9160: the 51-line pass-through
ObservedTransport(DiskTransportdelegating all eight methods toStaged) exists only so the test can logInboundWindowSampleand then recompute aRatethe store already reports (:9324-9328 vs :9346-9350); assert onstaged.disk_window_reads()(:9310) and hoist the existing 5% comparison: about 60-75 lines. - selene/src/disk_store.rs:1001-1050:
HeaderIdentityre-statesHeader's identity as a 47-line hand-writtenHash(paired withPartialEqat selene/src/shared/record.rs:136-152) behind a..pattern that hides a missed field; move theHashbeside thePartialEq, deriveHashonSegmentKey(:1052-1056): ~50 added, net ~22. Left behind: None.Destination,InPhase,InboundRecord::apply_transfer,InboundRecord::submit_uploadand the old device branch are deleted in this same diff, and all fourplan_windowscall sites are updated (:1349, :2435, :6262, :8235). Five nits remain inside the change: :1897-1909 vs :2144-2196 (~12), :8215-8232 vs selene/src/testing.rs:25-37 (~10-16), :265/:1360 single-elementVec<Segment>(~8), docs/prefix-cache-offload.md:362-366 vs :1528-1531 (~5), the dead.max(self.shared_windows.len())at :2522-2528 (~2). The shared segment/window state machine, the reference counts pinningSlabPoolslots and theInboundWindowSampleplumbing are load-bearing for the measured 3.5-4.2x read reduction and must stay. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
code review summary
Autobot Review
Full Review for Agents.
Recommendation: Ready To Merge
No new commits since the last review — 0c04b1e2 is still head, so the previous "Changes Requested" post is superseded, not overtaken by new code. Re-weighing those items: none can make a released build wrong, so none is treated as a merge gate. This belongs in the repo — a measured win on a served workload (27B simultaneous 18,177.5 → 4,306.7 MB physical reads, TTFT 7,974.6 → 5,662.8 ms), in the right layer (Selene's disk tier), with no new flag, no per-model branch, no on-disk format and no wire change. Every earlier blocker is resolved: parity settled by 5 cold-VRAM repeats (identical FP32 top-5 logprobs and token IDs), inbound_rate physical with bytes_in logical (live 6.07 GB/s single vs 7.71 GB/s 8-way), benchmarks re-measured at this head, one plan_windows plus WindowKey.
Blockers:
- None.
Should fix:
- Take the rank-local rate sample off the cross-rank completion enum.
TransportEvent::InboundWindowSample(disk_store.rs:97-101) is the one variant of six with noJobId, in an enum documented as "Completion the transport reports to the disk store" (:83). It forces twounreachable!()s (shard.rs:476-478, disk_store.rs:3638) upheld by hand-written guards (shard.rs:722-725, :1148-1150), and makesCompositeStore::pollbumpstats.progress— re-runningspill_parked+disk.maintain()— once per physical window (composite.rs:1376, gate :1420-1428). → Carry it out of band (aStageddrain method or a field onFetched) and keep it out of the composite progress count. - Move
HeaderIdentity's hand-writtenHashbeside the equality it tracks. It hashesHeader's fields through a..pattern (disk_store.rs:1014-1050) againstPartialEqdefined in another module (shared/record.rs:136-152), with no test pinning agreement. Precisely: a mismatch here fails safe — a coarser hash costs bucket collisions inwindow_index, never wrong results — butmainhas already added apackedfield toHeader's equality that this branch omits, so the drift is live. → ImplementHashforHeaderin record.rs and letSegmentKey/WindowKeyderive; add ana == b ⇒ hash(a) == hash(b)test. - Call
Layout::record_slotsinstead of restating it. The admission guard recomputespages + row_slotsby hand (disk_store.rs:1777) while the allocator it predicts usesrecord_slots(geometry.rs:180-182, disk_store.rs:245). → One line, hoisted besidefree; a guard must use the allocator's own arithmetic. - Split the §2.4 bullet and state the metrics contract once. docs/prefix-cache-offload.md:337-366 is one ~250-word paragraph carrying ~12 behaviours, burying the two limits a reviewer needs; the
bytes_in/inbound_ratecontract repeats at :1528-1531. → Mechanism in §2.4, limits and failure scope as short bullets, metrics only in §4. - Record the design decision (process, no code change). The Staged-vs-DiskThread argument in Why is sound, but a second inbound lifecycle inside
Stagedis an invariant-level choice that AGENTS.md:201-206 (not opened) says a maintainer must record explicitly — a PR Why is not that record. → Ask a maintainer to sign off.
Nits:
10 nits — inbound_rate now prices restores optimistically and CompositeStore measures another quantity under the name; Staged::close reports a non-job count as a job count (:2522-2544); memory.rs:1336-1367 is now the last copy of the WINDOW_PAGES splitter this PR unified; two settled() predicates plus three repeated unindex blocks and two identical detach closures; one-element HostInbound vec with an always-zero owner index; SharedSegment.id/SharedWindow.id duplicating their map keys; a dead demand.is_empty() guard (:1781-1787); test-only residue (disk_read_counted flags, GatedCopier 4-tuple); ~90-110 lines of duplicated test setup, the ObservedTransport wrapper and the duplicated close-drain test; and four description/docs wording items (sample scope, Flash-Next 3.99x/3.52x vs 4.010/3.535, undisclosed arrival-order relaxation, "no re-export or format change").
Full report — per-finding requests, resolutions since the last head, the verified-sound list and open questions — is in the case file. No toolchain, GPU or test run was available: every finding is established from source at 0c04b1e2, and the head carries no CI checks. Nothing in the PR or docs attempted to direct the reviewer.
Pre Test Report
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches" (round 3, head 0c04b1e2)
Decision: DO NOT refer to hardware testing yet. The branch has not moved since round 2 (head still 0c04b1e2, one commit, no CI, no human review), so every code finding stands — but main moved under it in a way that turns this from a rebase chore into a semantic port of the shipped compressed-disk restore path. A hardware run today would either exercise a tree that cannot merge, or exercise code whose behaviour is about to be rewritten on the exact restore path a test would target. The minimal plan for the run after the rebase is at the end (≈2–2.5 h cn7).
Why not yet — the new, substantive item (this overrides round 2's "refer")
#496 deletes the disk path that merged PR #504 depends on (verified line by line).
- Merged
#504(716df00f, 2026-11-25 18:22) put the v4 packed (compressed) checkpoint path intoselene/src/disk_store.rs:enum Destination(main:949,HostPacked:961),struct InboundRecord(:1043,packed_buf:1036),completed_packed_reads(:1481),pub fn write_packed(:1555),pub fn read_into_packed(:1576),pub fn take_packed_read(:1619),Source::HostPacked(:273), and theReadPackeddisk job with its single contiguous pages+row read (:1298-1330) and payload-driven upload (:1375-1400). selene/src/composite.rsonmaincallswrite_packed(:565),read_into_packed(:871) andtake_packed_read(:1042, consumed at :1039-1062) — i.e. zero-copy compressed disk spill and restore.- At
pr/496, searching all ofselene/src: no matches forwrite_packed,read_into_packed,take_packed_read,HostPacked,Destination, orInboundRecord. #496'sSourcehas onlyDevice/Host(pr/496:274); its inbound lifecycles areHostInbound/DeviceInbound. Headeronmainnow haspub packed: Option<Arc<packed::Layout>>(mainshared/record.rs:127) and it is compared inHeader::PartialEq(main:144-160). #496'sHeaderIdentity::hash(pr/496:1014-1050,..rest at :1030) hashes 14 fields and omitspacked.
Porting means: give HostInbound/DeviceInbound a packed destination and a completed-payload slot (today's Destination::HostPacked + completed_packed_reads semantics); teach WindowPlan/plan_windows that a packed window is one contiguous ReadPacked over pages+row rather than per-window page/row jobs; decide whether packed records participate in window coalescing at all (a page-granular shared staging window cannot serve a contiguous compressed payload unchanged); and reconcile docs/prefix-cache-offload.md §2.4, which #504 also rewrote (+89/−6). All of that lands on the restore path a cn7 test would measure.
Benchmark baseline is stale too. The A/B in the description is main c0c4f798 vs 0c04b1e2; c0c4f798 predates #504, so both arms lack today's Header.packed and the compressed spill path. Any like-for-like A/B must rebuild the baseline from current main.
Correction to the case file. Its explore note says the omitted packed field means two records "differing only in packed … collide into one WindowKey". That is wrong: HeaderIdentity::eq (pr/496:1006-1010) compares the full Header, so a == b ⇒ hash(a) == hash(b) holds and unequal headers are separated inside the bucket. It is a hash-coarseness/perf hazard plus a maintenance trap (a future PartialEq field silently drops out of the hash), not a collision defect. It should not be cited as a correctness bug.
Settled at this head (do not re-litigate)
- Physical vs logical accounting — fixed. One
TransportEvent::InboundWindowSample { bytes, elapsed }per completed physical shared window;DiskStore::applyshort-circuits it intoinbound_rate.observebeforestats.progress += 1(pr/496:3632-3635);Fetchedonly addsstats.bytes_in(:3669);hit()'sestimated_seconds(:3625) is priced from physical bandwidth. - 61.3K 8/9-vs-7/9 retrieval gap — closed. Five cold-VRAM repeats (
seed 1234..1238, 60,534 tokens) matched per seed on both arms; honest root cause (no greedy mode, temperature clamped into a positive sampling range, per-build prompt nonces); the suspect hazard is covered bymisaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore. - Evidence at the reviewed head (at the time): 18,177.5 → 4,306.7 MB (4.22×) / TTFT 7,974.6 → 5,662.8 ms (−29.0%) simultaneous; 18,194.2 → 4,843.6 MB (3.76×) / −13.5% staggered; Flash-Next 7,944.9 → 1,981.1 MB with only −3.1% TTFT. Un-rerun multi-host rows correctly moved to "Not covered".
- Security screen: all clear — no injection, hidden content or agent-directed code in the diff; the only instruction-like text in the thread is this repo's own automation footer, which I did not act on.
Still open, worth fixing before the same pass (none testable on hardware)
- Rate sample rides the cross-rank event enum.
TransportEvent::InboundWindowSample(pr/496:97-101) carries noJobIdin an enum documented as "Completion the transport reports" (:83); it forcesunreachable!()inKind::of(shard.rs:476-478) upheld by two hand-written guards (shard.rs:722-725, :1148-1150), andCompositeStore::pollbumpsstats.progressfor it (composite.rs:1376) ahead of the maintenance gate (:1418-1428), re-arming spill+maintain per physical window. Move it to aStageddrain method or a field onFetched. HeaderIdentity's hand-writtenHashmirrorsPartialEqowned 1,200 lines away in another module. ImplementHashbeside the equality (or hashPrefixKey+ a discriminator) and add ana == b ⇒ hash(a) == hash(b)test. Now doubly relevant:packedalready exists onmain.pick_next_pending_planrestatesLayout::record_slots(pr/496:1767-1777 vsgeometry.rs(not opened):180-182) and takes the transfers lock per candidate; hoist the lock and call the helper.- §2.4 doc bullet (docs:333-366) packs ~12 behaviours into one paragraph and repeats the metrics contract from §4 (:1528-1531).
- Maintainer sign-off on a second reference-counted inbound lifecycle inside
Stagedrather thanDiskThreadis still unrecorded — process item, not a test item, but a merge precondition perAGENTS.md(not opened):201-206. - Test fragility:
staggered_arrival_attaches_out_of_order_to_in_flight_windowsasserts an exact totaldisk_window_reads() + coalesced_windows() == 10(pr/496:8487) while its own comment only guarantees a bound.
Expected value of a hardware test — high, but only after the rebase
The mechanism is worth validating on GB10: host-side Rust I/O bookkeeping, no CUDA, no record-format or Header change, no flag/env/recipe knob, no per-model branch, sharing keyed on (path, expected Header), failure isolation preserved (private child/upload errors fail one restore; shared open/read errors fail the cohort and route to drop_row), single-owner slot release. Unit tests assert real properties — byte-exact SimulatedGpu pages/rows, pool.free_slots() == pool.slot_count(), no pinned index nodes. Two things only a run settles: (a) does the ≈4× physical-read reduction and the −29% burst TTFT reproduce at the merged head on GB10; (b) is the now-optimistic admission rate harmless — single-stream restore TTFT/bytes must stay at parity with main.
Minimal test plan — cn7, ≈2–2.5 h GPU (run only after the #504 port and the fixes above)
Target: cn7 (1× GB10, SM121 — same class as the author's evidence), nvidia/Qwen3.8-27B-NVFP4. Job: 10 CPUs / 60 GiB RAM / 16 GiB scratch.
Two setup traps (verified in the docs):
- Disk limit.
docs/prefix-cache-offload.md:839-842: defaults to one tenth of free space ≈ 1.6 GB on a 16 GiB scratch, while a ~61K-token TP1 prefix is ≈954 pages × ~4.19 MB ≈ 4.0 GB. Left at default the warm prefix is evicted and the burst restores from prefill — you would measure nothing. Pass--prefix-cache-disk-limit 8Gand confirm the startup line reports it. - Metric semantics.
flare_host_cache_bytes_in_totalis logical by design andflare_host_cache_inbound_bytes_per_secondis now the disk-thread-only rate. Physical NVMe traffic must come from the device (/proc/diskstatssectors-read deltas on the cache directory's device), not from the store.
Step 0 — desk, no GPU (~20 min). Stop if red. cargo test -p selene --features test-support at the rebased head; watch coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical, misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore, the == 10 staggered assertion, and — new since #504 — packed_disk_round_trip_restart_mixed_profiles_and_compaction and packed_composite_spills_v4_and_promotes_across_restart. Also build current main once for the A/B arm.
Step 1 — the burst, A/B, simultaneous (~60 min GPU). flare run --prefix-cache-memory 0 --prefix-cache-disk <scratch> --prefix-cache-disk-limit 8G. Warm one ~61K-token shared prefix plus 4 distinct child branches — 4, not 8: the description's own before-total of 18.18 GB is ≈4.5 copies of a ~4.0 GB prefix, so a 4-way burst matches the evidence and answers that inconsistency for free. Restart so VRAM is cold; send 4 concurrent /v1/chat/completions follow-ups; repeat the identical script on current main. Three trials per arm, interleaved. Measure: physical NVMe bytes (expect ≈4× reduction); burst median TTFT (expect −20% to −30%); flare_host_cache_fetched_total == 4, _fetch_failed_total == 0, _reused_tokens_total above the prefix size, _inbound_in_flight == 0 after drain.
Step 2 — correctness of the coalesced path (~20 min, folded in). All 4 branches' generated text byte-identical to the same requests served with disk offload disabled — all four, not one. One staggered burst (submit branch 1, wait for first token, then the rest): no hang, no fetch_failed, coalescing engages. Three repeats of the 61.3K 9-fact retrieval probe on both arms; a consistent head-only loss is stop-and-escalate.
Step 3 — regressions this PR can plausibly break (~30 min).
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main— the path the admission-rate change mis-prices. read_into/ corrupt-record path:tests/server/test_prefix_cache_offload.py(not opened), which is not a drop-in CLI check — it needsFLARE_RUN_CUDA_TESTS=1,CUDA_VISIBLE_DEVICES,FLARE_OFFLOAD_TEST_CORE=<core .safetensors>, a release binary and--basetempon a direct-I/O filesystem (docs/prefix-cache-offload.md:1438-1447; assertions at:160-173, corrupt-record fallback:185-186). Pre-check those in Step 0; if no runtime core is available, substitute a hand-driven corrupt-record HTTP check rather than skipping it — one shared read error now fails a whole cohort.- Idle/shutdown: one restore then
SIGTERM; clean exit. Record (do not act on) the"N disk transport jobs did not complete"message if drain is slow — that count mixes unrelated quantities.
Skip: multi-host RoCE, Windows IOCP, discrete PCIe, 2-GPU split_pools (no matching hardware; shard.rs edits are unit-covered); DeepSeek TP4 (1.00× null with a stated cause); the Flash-Next rows (−3% TTFT for 75% fewer reads — no decision turns on it, another warm-up cycle); cn5; and all compressed-mode live testing — per #504's own material limitations nothing in this repository declares codec_layout, so cores serve compression off, and the ported packed path is only exercisable by the crate/GPU unit suites in Step 0.
Stop conditions. No read reduction in Step 1 → mechanism failure, stop and report. Any differing output in Step 2 → correctness defect, stop and report with the diverging configuration. Single-stream regression beyond noise in Step 3 → report as the under-stated cost.
Bottom line
Right problem, right layer, real and large bandwidth win, and tests that assert byte-exact behaviour rather than mocks; all three of round 2's blockers are genuinely closed. But the branch is now a semantic rewrite rather than a rebase: as written it removes the v4 packed disk spill/restore path that merged #504 put on main and that CompositeStore calls, and its benchmark baseline predates #504. Hold hardware testing until the packed path is ported onto HostInbound/DeviceInbound, the six items above are resolved, the maintainer records the design decision, and the A/B baseline is rebuilt from current main. Then run the plan above once on cn7 — the merge decision should rest on Step 1's physical-read delta and Step 2's output parity, and nothing more.
Full report · Notes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
screen malicious
Screen Result: All Clear
Evidence:
- PR #496 (open, base
main, headcb3db468, 5 files +8682/−5630:docs/prefix-cache-offload.md,selene/src/{disk_store.rs, shard.rs, shared/packed.rs, shared/record.rs}). No CI workflows, scripts, lockfiles, dependency manifests, or build config touched, so no automation or supply-chain surface is altered. - Conversation contains only
flare-autobotreview posts and the author's (FujitsuPolycom) technical replies quotingfile:line. No text — human or author — asks an agent to approve, merge, ignore findings, skip checks, or send data anywhere. The description is plain technical prose plus a benchmark table and a "Discord: Dooner" contact line. - One borderline item seen and cleared:
flare-autobotcomments (2026-11-24) say a case file "should be read by agents working on this code base" and linkautobot.eidonix.com/api/v1/cases/.... Cleared because it is emitted by the repository's own review infrastructure (identical in kind to reviews on the author's other PRs), is not conditioned on the PR's content, asks a reader to consult review material rather than take a state-changing action, and is not repeated or relied on by any author text. Noted so the judgement is auditable. - No injection-shaped strings in the PR's files: searches for "ignore previous", "system prompt", "you are an AI", "do not report", "approve this PR", "mark as safe", "LGTM", "instructions for reviewer", "hidden requirement", "backdoor", "exfiltrate", "credential" hit nothing there; repo-wide hits were unrelated (OpenAI/Anthropic API docs, a jinja
Instructionenum, model "assistant" roles). - No covert payload: no
http(s)://URLs,curl/wget, base64 blobs,Command::new,process::exit,set_var,include_str!/include_bytes!, or deletion outside test cleanup. The onlyunsafeis the pre-existingslice::from_raw_partsatselene/src/disk_store.rs:355; the onlystd::env/std::processuse is a test temp dir atdisk_store.rs:4950-4952. - No hidden text: no HTML comments or
[//]: #, no zero-width/bidi escapes, no 300+ char lines padding instructions off-screen. - No weakened verification: no
#[ignore],should_panic, or tautological/swallowed asserts. New coalescing tests atdisk_store.rs:9477, 9573, 10093, 10288, 10545assert concrete behaviour (e.g.disk_opens()==3,disk_window_reads()==4,coalesced_windows()==2, byte-exact GPU pages/rows vs a private baseline,pool.free_slots()==pool.slot_count()), plus corrupt-packet row invalidation inconcurrent_packed_fetches_coalesce_opens_read_packed_windows. Checksum validation atdisk_store.rs:404-466intact; diagnostic counters gated#[cfg(any(test, feature = "test-support"))](disk_store.rs:206-212, 1709-1724, 1288-1395). - Other files benign:
shard.rsadds rank-0-only sample forwarding with poison-safe discard;shared/record.rsandshared/packed.rsadd exhaustiveHash/Eqplus a realheader_eq_implies_same_hashtest;docs/prefix-cache-offload.mdis accurate mechanism prose (real signatures, pin invariants, coalescing limits, physicalinbound_ratevs logicalbytes_in) with no reader instructions. - Open items: the external
autobot.eidonix.comcase-file links were not followed — the clearance rests on provenance, phrasing, and lack of author amplification, not on the destination's contents. No human reviews exist on the PR yet, so there is no maintainer commentary to cross-check.
Full report · Notes decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR; Discord: Dooner) Motivation: When several concurrent requests restore different checkpoint branches that share a disk-resident ancestor prefix, each restore currently opens the same ancestor record files and re-reads the same 64-page windows from disk, paying the open, read and checksum cost once per branch. This PR makes those concurrent restores share one open file handle and one staged window, so the shared ancestor is read from NVMe once instead of up to eight times, which the author measures as a ~4x cut in physical NVMe reads. Scale: +8682 / −5630 lines in 5 files (after the 2026-11-26 rebase; the earlier head was +3358/−933 in 3 files) Proposal:
- Split inbound reads into a private host path (caller-owned
read_into/read_into_packed) and a shared GPU restore path that keys one open file and one window onSegmentKey/WindowKeyand shares them across concurrentDeviceInboundfetches. - Reference-count shared windows and segments, with per-restore two-window credit, demand-ordered window selection across sibling restores, and the last user waiting for the disk-thread close before reporting
Fetched. - Port #504's v4
packedrecords into the same coalescing path (ReadPackedwindows that allocate zero SlabPool slots) while keeping #504's public surface (write_packed,read_into_packed,HostDestination::Packed, codec profiles). - Move the physical
inbound_ratesample out of band (DiskTransport::drain_inbound_samples) sobytes_instays logical,progressstays un-inflated andTransportEventkeeps onlyJobId-carrying variants. - Put
HashforHeader/packed::Layoutbeside theirPartialEqwith exhaustive destructures, callLayout::record_slotsin the admission guard, and rewrite docs §2.4/§4 (mechanism, limits, single metrics contract). Touches: selene/src/disk_store.rs(+8470/−5627): the whole inbound lifecycle, window/segment sharing, coalescing planner and close accounting.selene/src/shared/record.rsandshared/packed.rs(+119/−1, +44/−0):Eq/HashforHeader,Layout,PackedOffer,PackedUnit,RankSizes— shared identity types, so a mistake here affects every record user.docs/prefix-cache-offload.md(+38/−2) andselene/src/shard.rs(+11/−0): the stated limits and the multi-host forwarding of rate samples. Related items:- #497 Reduce disk offload restore latency and integrated-memory intake overhead (open): companion PR at
cf9d4c14; both descriptions now say merge #497 first, then rebase #496, sopump_allkeepsMAINTENANCE_DEFER_LIMIT = 8. - #504 selene, selene-manager, helios, ignition, heliopause: add pure-CUDA GPU and CPU lossless KV compression (merged): its
packedrecords andHeader.packedequality field are what #496 had to port and hash consistently. - #477 / #486 / #492 (closed): older same-file compression work, superseded by #504 — drop them from the related list.
- The post-#504 merges the author rebased onto (#523, #524, #527, #538, #543, #545, #546 and others): none touch
Staged,DeviceInboundor window coalescing. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496 Autobot comments: The last review saying "Ready To Merge" judged the previous head0c04b1e2and explicitly relied on there being no new commits, so it is stale and not an endorsement ofcb3db468; there are no CI checks at the new head. All five round-2 should-fix items are genuinely fixed in source, but the only surviving item is procedural:AGENTS.md:201-207says an invariant-level design change needs an explicit maintainer decision and that routine PR approval is not one, and the author's own closing line asks for exactly that sign-off. The benchmark table is still measured at0c04b1e2vsc0c4f798, not at the new head, and the author's "Not covered" list now contains that re-run itself. My own new finding: the requested exhaustiveHashmakes everyWindowKeyprobe walk the whole packed unit directory (~16+ KiB of profile bytes for a TP4 record), on the rank-0 restore pump this PR exists to speed up, and no test covers hashing cost.
Value Proposition
PR #496 — Coalesce shared ancestor reads across concurrent Selene disk fetches
Verdict: worth merging, with changes
Head cb3db468 (rebased onto main 6d74db3a, post-#504) is a genuine step forward: every code item I raised last round is now fixed, plus a whole new v4 packed coalescing path. What remains is one narrow metering gap, one unwritten doc line, one sequencing task, and one evidence gap that matters for the charter's own rule rather than for the code.
Files: docs/prefix-cache-offload.md +38/−2, selene/src/disk_store.rs +8,470/−5,627, selene/src/shard.rs +11, selene/src/shared/packed.rs +44, selene/src/shared/record.rs +119. No selene/src/lib.rs (not opened) change.
Charter fit
- Goal, not a non-goal. Goal 4: "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene." Scope is
seleneplus one docs section: no new flag, no record-format change, no re-export, no per-model branch. Passes "keep the runtime small and model-agnostic" and "no per-model special cases or flags." - Right problem, right layer (
AGENTS.md:165-169). The waste was insideStaged::fetch, below the per-key ticket attachmentdocs/prefix-cache-offload.md:427already promises. TheStaged-vs-DiskThreadargument in Why holds on the code:DiskThreadis done when direct I/O andxxh3finish, whereas a shared staging slot must stay pinned until every follower'sCopierupload completes (WINDOWS_IN_FLIGHT = 2,disk_store.rs:64). - Evidence rule (#210). Partly — see gap 4 below.
What this head fixed (verified in source, not just claimed)
- Rate sample off the completion enum.
TransportEvent::InboundWindowSampleis gone; the enum is five variants, all carrying aJobId(disk_store.rs:84-106). Bothunreachable!()s are gone — the onlyunreachable!left in the file is pre-existing (:891,:5128test). Replacement is a defaulted trait methoddrain_inbound_samples(:149-150), so my earlier public-API-breaking concern is moot.Stagedbuffers(bytes, elapsed)per completed shared window (:2148-2150), drained byDiskStore::observe_inbound_samples(:3649-3655) frompoll_transport/poll/close; rank 0 forwards (shard.rs:1005-1013), peers discard (shard.rs:1213-1214).CompositeStore::pollnow bumpsstats.progressonly for real completions (composite.rs:1473-1474), asserted atdisk_store.rs:10517-10518. Headerhash drift. Exhaustive destructure besidePartialEqin the same file,version: _excluded,packedincluded (shared/record.rs:165-202) — a newHeaderfield is now a compile error.HeaderIdentity::hashdelegates (disk_store.rs:1452-1456);packed::LayoutgotEq+ exhaustiveHashoverLayout/PackedOffer/PackedUnit(shared/packed.rs:99-141);RankSizesderivesHash.header_eq_implies_same_hashcovers version-excluded equality, a differingcreated, and equal vs differingpacked.Layout::record_slots. Called directly with one hoisted transfers lock, skipped entirely for packed (:2307-2320).- Docs and
Staged::close. §2.4 split into mechanism / invariants / limits-and-failure-scope bullets covering raw and v4 packed (docs:427-450); the metrics contract lives only in §4 (docs:1612-1617) with §2.4 cross-referencing it. Close reportsabandoned_jobsandleaked_sharedseparately (:3183-3225). - Two prior findings withdrawn. The staggered-test "flake" is not one —
disk_window_reads() + coalesced_windows() == 10(:9672) is a conservation identity (each logical window is either created once, guarded bydisk_read_counted, or attached inattach_existing_window:2246); only the already-boundedcoalesced >= 2is timing dependent. My 4.5-copy benchmark objection is also withdrawn: the author's 2,274 MB single-restore figure makes "before" exactly 8.0 copies.
New since last round: v4 packed coalescing
SharedWindow.packed_buf: Option<Arc<Vec<u8>>> (:1096, :1546) is retained until every follower's decode finishes; one shared ReadPacked per aligned window (:2674-2698); packed windows take zero SlabPool slots (:2527-2539, :2320). Only packed-content errors escalate to all followers (apply_device_transfer :2174-2181); transient upload errors fail one record. concurrent_packed_fetches_coalesce_opens_and_read_packed_windows (:10545-10855) runs 4 branches over a 1-slot pool and asserts 5 opens, 7 ReadPacked reads, 9 coalesced attachments, byte-exact GpuMemory pages and rows, zero leaked slots/pins, plus a corrupt-packet case asserting is_record_read() propagation and row drop.
Who benefits, how much
Concurrent branching traffic on a disk-resident shared prefix with --prefix-cache-memory 0 --prefix-cache-disk on SM121/GB10. Author's numbers: 27B-NVFP4 TP1 simultaneous 18,177.5 → 4,306.7 MB physical reads (−76.3 %, 4.22×), TTFT 7,974.6 → 5,662.8 ms (−29.0 %); staggered −73.4 % / −13.5 %; Flash-Next −75.1 % / −3.1 % and −71.7 % / −2.8 %. Arithmetic checks: after/before = 1.89 and 2.13 copies of a 2,274 MB restore — roughly two physical passes, consistent with the documented "a released window is re-read" limit (docs:443-445); honest headroom, not a defect. It composes with #497: #497 shrinks disk-only intake to two windows, and #496 is what lets eight shared-ancestor restores share them.
What it costs
disk_store.rs production 3,523 → 4,746 (+1,223, +35 %) and tests 4,489 → 6,110 (+1,621): a second inbound lifecycle (SharedSegment, 5-state SharedFileState, SharedWindowPhase, WindowFollower, DeviceActiveWindow, HeaderIdentity/SegmentKey/WindowKey, an 8-pass pump_device_inbound) in the most delicate file in selene. Risk surface: one shared record_read error fails every attached restore; a coalesced window pins slots until the slowest follower uploads; sibling-demand preference relaxes arrival order. All three are now documented. No simpler path exists — copier::Job::replication fans to ranks not GPU page ranges; keeping 4 GB resident defeats --prefix-cache-memory 0; scheduler dedup can't work because each branch needs its own snapshot slot.
Should fix before merge
- Scope the rate sample to device restores, or sample host reads too. Samples are pushed only in
apply_shared_disk(disk_store.rs:2148-2150);HostInbound— theread_into/read_into_packedcaller-buffer pathCompositeStoreuses (composite.rs:884-889) — never pushes one, whereasmainobserved on every inbound (main:3221).CompositeStore's owndisk_inbound_rate(composite.rs:1064) keeps user-facing pricing measured, so this is narrow — but docs §4 ("samples rank-0 physical disk-thread window reads") reads as covering all reads. - Document the deliberate leak.
Staged::closedoesstd::mem::forget(win.packed_buf.take())when transfer close fails (:3206-3212). Correct, one comment line. - Sequence #497 with
pump_device_inboundin mind. #496'spump_all(:2957-2978) is maintenance-drain → outbound → host_inbound → device_inbound: no regression againstmain(main:1781-1801). But #497 (pr/497:66,:1787-1825) reorders host inbound first and addsMAINTENANCE_DEFER_LIMIT = 8; landing it second must also prioritizepump_device_inbound, or the reorder helps only host reads and not the device restores that carry TTFT. - Re-measure at the merged form. All four rows are from
0c04b1e2(pre-#504, compression off); the head is a +8,470/−5,627 rebase with a new v4 packed path. The "identical raw path when compression is off" argument is plausible and mostly borne out by inspection, but #210 asks for a measured speedup on a served workload. One simultaneous and one staggered TP1 trial atcb3db468closes it. - Get the maintainer design sign-off (
AGENTS.md:201-206: "a commit acknowledgment or routine PR approval is not that decision"). A second inbound lifecycle insideStagedis an invariant-level placement choice; the author has now asked for it. One-line ack, no code. - State the coverage boundary: multi-host RoCE (the entire
shard.rssurface), 2-GPUsplit_pools, discrete PCIe GPUs, Windows serving, live compressioncpu/gpuserving, and live warm-plus-disk orPooledStoreHTTP serving were not exercised.
Bottom line
Worth merging, with changes. It fixes a measured, reproducible performance problem on the project's headline model and hardware; it lives in the one layer where the bytes can be shared; it adds no flag, format, re-export, or per-model branch; its correctness evidence is unusually strong for a performance PR (five-repeat FP32 parity against main, byte-exact misalignment test, byte-exact packed coalescing, leak and failure-isolation assertions on pool free_slots() and index pins); and it composes with #497 rather than duplicating it. The cost — ≈1,200 production lines of reference-counted concurrent state in selene's most delicate file, a cohort-wide blast radius on a corrupt record, and a redefined bandwidth metric — is real but paid once and now documented. Items 1–2 are a few lines, 3–6 are text plus one ack; nothing requires redesign.
No instruction-like content appeared in the PR, docs, or comments other than the review bot's "to opt out" footers, which I did not act on.
Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Prose
Verdict: clean Blocking:
- None. Should fix:
- None.
Nits: 1 — the PR description never says that coalescing relaxes strict arrival order across concurrent restores, though the docs now admit it (docs/prefix-cache-offload.md:435-438) and the code implements it (
build_pending_demand/pick_next_pending_plan); AGENTS.md:95-102 wants material limitations attached to a measured result. Fix with one clause in What or Result. Weak, because every request in the 8-way burst is measured. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Prose review of PR #496 at head cb3db468 (rebased onto main 6d74db3a), 5 files: docs/prefix-cache-offload.md (+38/−2) and four selene/src files. No blocking or should-fix prose defects.
Earlier findings are resolved at this head: the misplaced Resources::allocate rustdoc, the over-broad "per completed physical window read" sampling claim (sole push site disk_store.rs:2148-2150), the two Flash-Next read-reduction ratios (now 4.01x / 3.53x, matching 7944.9/1981.1 and 7958.0/2251.5), and the docs §2.4 structure problem (now a Staged parent bullet at :414-423 with mechanism :424-431, invariants :432-438 and "Limits and failure scope" :439-448, with the bytes_in/inbound_rate contract stated once in §4 :1612-1617, matching AGENTS.md:116-121).
Verified accurate against code: docs call signatures vs write_from/read_into/write_packed/read_into_packed; out-of-band sample drain path (drain_inbound_samples, Sharded forwards local only shard.rs:1005-1012, peers discard :1213-1214, no TransportEvent variant); Hash/PartialEq lockstep for Header (record.rs:144-202, version omitted), RankSizes derive (:96) and exhaustive packed::Layout Eq/Hash (packed.rs:99-141); HeaderIdentity ptr-eq fast path (disk_store.rs:1444-1456); failure-isolation claims (:2040-2080, :2145, :2174-2181); disk_settled before Fetched (:2910-2918); Staged::close reporting abandoned jobs and leaked shared entries separately (:3192-3225). MAINTENANCE_DEFER_LIMIT genuinely lives only in #497, and the description states this correctly as recommended merge order. Comments are present-tense with no chronology, no TODO/FIXME or PR-number references; nothing in the body, comments or docs tried to direct the reviewer.
Not verifiable here (consistent with the description's own "Not covered"): live GB10 benchmark numbers, Windows IOCP counts, and the post-rebase SM121 A/B. Head cb3db468 has no CI checks.
Correctness
Verdict: clean Blocking:
- None. Should fix:
- None.
Nits: 3 (docs wording "64-page file boundaries" only fits raw v1–v3; deferred
ReadRowwindow sits unsampled/unuploadable until a later pump — invariant undocumented;hit()prices physical bandwidth against logical bytes, so coalesced-burst admission is optimistic) Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Reviewed at head cb3db468 (rebased onto main 6d74db3a; 5 files, +8682/−5630) through the correctness lens: every changed file read in context plus its callers (disk.rs, composite.rs, copier.rs, codec_copy.rs, levels.rs, selene.proto). The three should-fix items I raised against the previous head are fixed in code: the TransportEvent::InboundWindowSample variant is gone and rate samples travel out of band via DiskTransport::drain_inbound_samples (forwarded on rank 0, discarded on peers), so CompositeStore counts only real completions; Staged::close reports abandoned jobs and leaked shared entries separately; Layout::record_slots is the single source for the admission guard and the allocator.
Remaining behaviour checks pass on inspection: shared windows free only when no follower, disk reference or upload reference remain; a segment closes only after disk_settled(), and the last user holds Fetched until then, so no disk read outlives the caller's pin; a Closing/Closed handle is never revived and stale window_index entries cannot be inherited; ReadRow FIFO matching is exact because one disk worker runs jobs in order; private upload errors fail one restore while shared open/read and packed-content errors fail all attached restores after drain and drop only the corrupt endpoint's row. Hash for Header and Eq/Hash for packed::Layout are exhaustive destructures hashing exactly the PartialEq fields (only the non-semantic version omitted), with a test pinning agreement, so keys cannot alias two records; no record format or re-export change, so existing v1–v4 .ckpt files load unchanged. The v4 packed window path takes zero pool slots, retains packed_buf past every follower's decode/upload fence, and mirrors the private read_into_packed byte range; single-restore callers skip demand indexing and pay only the documented alignment cost.
Not verified for lack of a build/GPU: the #497 merge-order reconciliation of Staged::pump_all, live SM121 --lossless-kv-compression serving, multi-host RoCE, split_pools, discrete PCIe GPUs and Windows IOCP serving. No injected instructions were found in the PR text.
Subtractive
Verdict: make it smaller first
The change: +8682 / −5630 lines (5 files: selene/src/disk_store.rs +8470/−5627, shared/packed.rs +44, shared/record.rs +119/−1, shard.rs +11, docs/prefix-cache-offload.md +38/−2); part of record.rs/packed.rs (not opened) is main's #504 v4 packed support re-ported across the rebase, not new coalescing logic.
Could remove: about 360–400 lines, in 10 places (~25% of the ~1.5k-line new test module).
Biggest subtractions:
selene/src/disk_store.rs:9499,9593,9716,9839,9954,10034,10169,10370,10423: nine copies of the sameDiskStore::new(… Staged::new(SlabPool …))fixture plus the same scanned-records vec; two helpers (staged_store,scanned_tree) replace them: about 100–115 lines.selene/src/disk_store.rs:2271-2294, 2296-2331, 2250-2269, 2464-2482: the per-pump demand table and demand-aware picker, whose only effect is which new window a leader starts (coalescing is done byfind_best_existing_window_for; the table is empty for a single restore); a plainposition()over the free-slot filter replaces them: about 65–80 lines.selene/src/disk_store.rs:10014-10090: close-drain test duplicates:9476-9570; one test withfor close_early in [false, true]replaces it: about 70–75 lines.selene/src/disk_store.rs:10290-10347plus:10499-10535: 58-lineObservedTransportwrapper and the rate it lets the test recompute from the same samples the store was fed; delete both and keep the existingbefore_followers5% comparison: about 55–65 lines.selene/src/disk_store.rs:1440-1456:HeaderIdentitywrapper (manualPartialEq/Eq/Hashforwarding toHeader, now that this PR putHashonHeaderatshared/record.rs:165-202) — useArc<Header>inSegmentKey: about 20 lines. Then nits:poll_all_fetchesvscrate::testing::poll_until(~14), always-one-elementHostInbound.segments(~12), double walk of the active list (~12),Staged::closefour-way max (~10), duplicated docs paragraph (~5). Left behind: None.Destination,InPhase,InboundRecord::apply_transfer/submit_upload, the old device inbound branch andTransportEvent::InboundWindowSampleare all deleted in this same diff; everyplan_windowscall site is updated. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Simplicity
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:2650-2667 and :1333-1345: the v4 packed window byte span (
start_rel/end_rel/lengthfrompacked::Layout) is hand-written in two new places on top of a third copy at selene/src/pool/pins.rs:338-351; extractpacked::Layout::window_span(first, count, row) -> (u64, usize)and call it from all three. Nits: 5 —HostInboundis still a single-elementVec<Segment>plus areads_leftcounter thatdone == plans.len()already implies (:1108-1119, :276, :1004, :1820, :1859, :1255 vs :1270); the test-onlydisk_read_countedflags exist only sodisk_window_readscounts windows not jobs (:1101, :1552, sixcfgblocks); an unreachabledemand.get_or_insert_withat :2479;abandoned_jobsstill maxes unrelated populations at :3192-3194; and the ~57-lineObservedTransporttest wrapper (:10290-10347) that acfg(test)inbound_samples()accessor besidedisk_window_reads(:1714-1718) would replace. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Architecture
Verdict: should-fix issues only Blocking:
- None. Should fix:
- selene/src/disk_store.rs:1472-1560: a second reference-counted inbound lifecycle inside
Staged(SharedSegment/SharedWindow/DeviceInbound, credit-gated attach) is an invariant-level design change; AGENTS.md:201-206 requires an explicit maintainer decision on the PR, and none is recorded — only the author's request for sign-off. Should fix (second, lower confidence): - selene/src/disk_store.rs:4403:
hit().estimated_secondsis priced frominbound_rate, whose samples'elapsedcovers only disk-thread execution (selene/src/disk.rs:479-481), whileCompositeStoreuses the same-named quantity end-to-end (selene/src/composite.rs:374) — admission (selene/src/store.rs:427-438) is optimistic even for one restore. Nits: 1 —DiskTransport::drain_inbound_sampleshas a default no-op body (selene/src/disk_store.rs:148-150), so any future or unimplementedDirecttransport silently loses the metering. Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Conventions
Verdict: clean Blocking:
- None. Should fix:
- None. Nits: 2 Link: https://github.com/NVIDIA/hyperflare-inference/pull/496
Review of PR #496 at head cb3db468 (rebased onto main 6d74db3a) through the conventions-and-duplication lens. Nothing was compiled or run — no toolchain or GPU — so all statements come from source at this head, re-verified this round.
Every earlier lens-C finding is resolved and verified in code, not taken from the author's reply:
Header'sHashnow sits beside itsPartialEqwith an exhaustive destructure omitting only encodingversion(selene/src/shared/record.rs:144–202),RankSizesderivesHash(:96),packed::LayouthasEq/Hashwith exhaustive destructures overLayout/PackedOffer/PackedUnit(shared/packed.rs:99–141),HeaderIdentitydelegates with theArc::ptr_eqfast path retained (disk_store.rs:1440–1456), andheader_eq_implies_same_hash(record.rs:2228–2303) enforces agreement.- The rate sample left
TransportEvent, which is back to six completion variants (disk_store.rs:84–106); samples drain out of band (Staged :1662–1663, :3165–3167; Sharded shard.rs:1005–1012; observe :3649–3655), so no consumer special-cases andCompositeStoreprogress counting is unaffected. pick_next_pending_planhoists the transfers lock and usesLayout::record_slots(disk_store.rs:2299–2331 vs geometry.rs:209–211), no longer per-candidate.GatedCopier::wrapreturns a named handle struct (:9252–9282).- Docs: §2.4 split into mechanism / invariant / limits (docs/prefix-cache-offload.md:424–448) with the bytes_in/inbound_rate contract stated once at :1612–1617.
Two nits remain, both cosmetic:
- memory.rs:1834–1867 is now the last hand-written
WINDOW_PAGESsplitter beside the unifiedplan_windows(disk_store.rs:1025–1073); a cross-reference comment or one shared helper would do.packed::Layout::windowsis deliberately different and should not be merged. - disk_store.rs:3188–3218 separates abandoned jobs from leaked staging, but
abandoned_jobsis a.max()over three heterogeneous collections (jobs, owners, maintenance) still labelled "disk transport jobs"; the twosettled()predicates also share a name.
Also checked and sound: no duplicated coalescing machinery (none exists on main, shard::Sharded has only plain fetch); error marking reuses error.rs:56–69; key types derive Hash/Eq like every precedent; packed-window arithmetic derives from the pre-existing Layout pair in pool/pins.rs:338–351; description matches code, with untested surfaces listed. Open: a maintainer should explicitly acknowledge the architectural decision to put a second inbound lifecycle in Staged (AGENTS.md:201–207); a test cannot settle that. Nothing in the PR text attempted to direct the reviewer.
Pre Test Report
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches" (round 4, head cb3db468)
Decision: REFER to hardware testing, on cn7 only, with a small plan (≈2.5–3 h of GPU time) behind a desk gate that must first confirm a prepared core exists. Last round I said do not test yet, because merged #504 had added a v4 packed disk path inside exactly the structures this PR deletes. That blocker is gone at this head and I verified it in code, not from the author's reply. All five lenses now return no blocking finding (Correctness clean, Conventions clean, Prose clean, Simplicity one cosmetic should-fix, Architecture one process-only should-fix). What remains is: a load-bearing benchmark measured on a different commit, one admission-pricing change that only a run can size, and a maintainer sign-off that is a merge gate but is not expected to change behaviour.
Head cb3db468 (rebased onto main 6d74db3a), 5 files, +8682/−5630: selene/src/disk_store.rs, selene/src/shard.rs (not opened), selene/src/shared/packed.rs (not opened), selene/src/shared/record.rs, docs/prefix-cache-offload.md. Author FujitsuPolycom (CONTRIBUTOR, Discord: Dooner). No CI at head; no human review. Security screen: all clear.
What changed since round 3, verified at this head
- The
#504collision is resolved — the packed path is ported, not deleted.write_packed(disk_store.rs:1766),read_into_packed(:1787),take_packed_read(:1830),HostDestination::Packed(:979, used:1303) andSource::HostPacked(:297) all exist again, anddisk.rs:988(not opened) still has the packed write. The packed path was then extended to coalesce: one shareddisk::Job::ReadPackedper aligned window (:2674-2679) with the byte span computed frompacked::Layout(:2650-2667), andwin.packed_buf = reply.payloadretained on the shared window (:2123-2124) until every follower's decode and upload finishes. Covered byconcurrent_packed_fetches_coalesce_opens_and_read_packed_windows(:10545). Round 3's "semantic rewrite, not a rebase" verdict no longer applies. - The rate sample is out of the cross-rank event enum.
TransportEvent::InboundWindowSampleis gone, along with bothunreachable!()arms.Stagedbuffers(bytes, elapsed)ininbound_samples(:1663, pushed once per physical window at:2149from:2136-2141) and the trait drains it out of band (drain_inbound_samples, default no-op:150,Stagedimpl:3165-3167, forwarded on rank 0 and discarded on peers inshard.rs:1005-1012(not opened)/:1214).DiskStore::applydoes an unconditionalstats.progress += 1(:4410) and theFetchedOk arm now only adds logicalstats.bytes_in(:4442) — soCompositeStoreprogress is no longer inflated once per physical window. - The admission guard uses the allocator's own arithmetic:
layout.record_slots(plan.count, plan.row)under a single hoisted transfers lock (:2306-2320), with packed segments correctly exempted (:2314-2319). Staged::closeseparates abandoned jobs (:3192-3194) from leaked shared staging (:3195) with distinct messages (:3214-3225).- Hashing is now exhaustive:
Hash for Headersits besidePartialEqwith an exhaustive destructure omitting only the non-semanticversion(shared/record.rs:165-202), so adding aHeaderfield is a compile error rather than a silent coalescing failure;header_eq_implies_same_hash(record.rs:2229) pins agreement. - Docs §2.4 is three nested bullets (
docs:424-448) with the metrics contract stated once in §4 (:1612-1617). The round-2 docs finding is resolved.
What still stands, and why none of it blocks the run
- Architecture should-fix (process, no code): a second reference-counted inbound lifecycle inside
Stagedrather thanDiskThreadis an invariant-level placement call, andAGENTS.md:201-206(not opened) says a maintainer must record it — the author's Why argument and this report are not that record. This is the one item that could invalidate a run, because the alternative placement would rewrite the code under test. Every lens judges the argument sound (a shared window'sSlabPoolslots andpacked_bufmust stay pinned until each follower's asynchronousCopierupload completes, whichDiskThreadcannot observe), so I expect a one-line ack. Sequence it before the run. - Simplicity should-fix (cosmetic): the v4 packed window byte span is hand-written in two new places (
:2650-2667,:1333-1345) on top of a pre-existing third (pool/pins.rs:338-351). A divergence would be a wrong-offset read, but all three agree today; this is a "bites on a futureLayoutedit" item and does not change what a test would measure. - Metering, lower confidence:
hit().estimated_seconds = bytes / inbound_rate(:4403) now prices from a disk-thread-execution-only rate (excluding slot queueing, decoders and the H2D copy), so restore admission is optimistic — the mirror image of the inflation fixed last round.CompositeStorekeeps a same-named end-to-end quantity. Direction is provable from code; magnitude is exactly what Step 3's single-stream parity check sizes. The author's live figures (6.07 GB/s single vs 7.71 GB/s 8-way) sit near #497's 8.68 GB/s end-to-end, so I expect a small bias, not a cliff. - Cosmetic, ignore:
Staged::close'sabandoned_jobsis still a.max()over heterogeneous collections labelled "disk transport jobs" (:3192-3194,:3216);docs:425-426says packed windows align to "file boundaries" when for v4 alignment is in page-index space (:1052-1056);memory.rsis the last hand-writtenWINDOW_PAGESsplitter; duplicated test fixtures and theObservedTransporttest wrapper (~360–400 removable lines). None of these change a byte of the tested path. pump_allshape will move again:MAINTENANCE_DEFER_LIMITdoes not exist at this head (repo-wide search: no matches) andpump_all(:2957-2978) drains maintenance → outbound → host_inbound → device_inbound, i.e. the same maintenance-first order asmain. The description's ordering sentence describes the post-#497shape. No regression here, but the tester is exercisingmain's ordering, not the shipping one — say so in the result.
Expected value of the hardware test — high but sharply bounded
The mechanism is real and in the right layer: host-side Rust I/O bookkeeping, no CUDA, no record-format change, no new flag, no per-model branch, sharing keyed on (path, expected Header) identity. Failure isolation is preserved (a private child or follower-upload error fails one restore; a shared open/read/packed-content error fails the cohort and drops only the corrupt endpoint's row, :4449-4455). Unit tests assert real properties — byte-exact SimulatedGpu pages and rows, pool.free_slots() == pool.slot_count(), no pinned index nodes.
Three things only a run settles, and they are precisely why this is worth referring:
- The load-bearing number is stale. The whole table (
18,177.5 → 4,306.7 MB, 4.22×, TTFT7,974.6 → 5,662.8 ms) was measured at0c04b1e2against pre-#504main(c0c4f798). The head is a +8,470/−5,627 rebase that also added a new v4 packed window path. The "identical raw path when compression is off" argument is plausible and mostly borne out by inspection, but a hardware test cannot validate a number attributable to another tree. This is the first thing the run buys. - Admission pricing changed silently (see above) — single-stream restore TTFT and physical bytes at parity with
mainis the check that makes it harmless. - The ported packed interface boundary can be checked cheaply: requesting
--lossless-kv-compression cpu|gpuagainst a core exported without a codec layout must fail at startup with a clear message (helios/src/runtime_core/memory.rs:638-646). One command, no GPU time, validates that the port did not regress the#504surface.
Feasibility gates — check these before booking anything
These are the ways this run silently wastes an afternoon. I verified each against the repository.
- Top risk: is there a prepared core?
flare run COREneeds an exported core, not a checkpoint. The hardware list showsnvidia/Qwen3.8-27B-NVFP4— a checkpoint. Cores are prepared byignition exportfrom the externallocal-inference-lab/hyperflare-recipesrepository (this repo has noignition/recipes/;tests/preparation/test_core_boundary.py:41(not opened) assertshyperflare_recipesdoes not exist here). Step 0 must confirmflare models listshows a TP1 Qwen3.8-27B core in the cache. If it does not, the run needs a full preparation pass — far beyond the budget — and the plan must stop rather than substitute a different model, because the TTFT claim is specific to this model and TP1. - Disk limit would silently void the test.
docs/prefix-cache-offload.md:923-924: the limit defaults to one tenth of free space at startup. On cn7's 16 GiB scratch that is ~1.6 GB, while the warm prefix is 2,274 MB (472 pages × 128 tokens/page + 101 MB row — the author's own arithmetic, which is internally consistent: 8 × 2.27 GB = the table's 18.18 GB "before"). Left at default the prefix is evicted and the burst re-prefills, measuring nothing. Pass--prefix-cache-disk-limit 8Gand confirm the startup line reports it. bytes_inis logical by design — that is the point of the PR. Physical NVMe traffic must come from/proc/diskstats(or/sys/block/<dev>/statsectors-read deltas) on the device backing the cache directory. Verified metric names at head:flare_host_cache_fetched_total(metrics.rs:1198),flare_host_cache_fetch_failed_total(:1203),flare_host_cache_inbound_in_flight(:1321),flare_host_cache_inbound_waiting(:1326),flare_host_cache_inbound_bytes_per_second(:1371). There is noslots_in_usemetric at this head — do not assert on one.- Set the right "after" expectation. For an 8-way burst expect ~4–5× reduction (≈4.3 GB), not 8× (≈2.27 GB): a window released before a later restore attaches is re-read, and there are 8 child tails. That is the documented limit (
docs:439-443), not a failure. A tester who expects 2.27 GB will wrongly report a defect. - Model weights are listed at 0 GiB. Confirm they are actually cached before starting, or a 27B download dominates the run.
Do not spend hardware time on
- Live compressed (
cpu/gpu) serving. Not testable here and not worth attempting:codec_layoutis produced only byignition/preparation/contract.py:117(not opened), no recipe in this repository declares one (recipes are external), so cores serve compressionoff. The packed coalescing is covered byconcurrent_packed_fetches_coalesce_opens_and_read_packed_windows— a unit test, which is the right instrument. Check only the startup rejection described above. - Multi-host RoCE (the entire
shard.rs(not opened) surface), Windows IOCP serving, discrete PCIe GPUs, 2-GPUsplit_pools— no matching hardware. cn7 is a single GB10; cn5 is 4× RTX PRO 6000 but has no Qwen3.8-27B and is a different GPU class. - cn5 entirely, unless cn7 surprises — it would be a disambiguator only.
- Flash-Next rows (−3.1%/−2.8% TTFT for 75% fewer reads) and DeepSeek TP4
1.00×(a reported null with a stated cause). No decision turns on either; each costs another warm-up cycle. - The deleted-demand-index variant. The Subtractive lens proposes removing
build_pending_demand; do not test code that is not in this PR. Do report simultaneous and staggered separately so a later deletion has a baseline. - Re-running the crate suite more than once, or using GPUs to prove "tests pass".
Minimal test plan — cn7, ≈2.5–3 h GPU (≈4–5 h wall clock)
Target: cn7, nvidia/Qwen3.8-27B-NVFP4, TP1 — the same GPU class and model as the author's evidence. 10 CPUs / 60 GiB RAM / 16 GiB scratch.
Step 0 — desk, no GPU (~30 min). Stop if red.
- Confirm a prepared TP1 Qwen3.8-27B core exists (
flare models list) and the checkpoint weights are cached. If not, stop. cargo test -p selene --features test-supportatcb3db468. Watch specifically:concurrent_packed_fetches_coalesce_opens_and_read_packed_windows,coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical,misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore,packed_disk_round_trip_restart_mixed_profiles_and_compaction,header_eq_implies_same_hash. Note the result ofstaggered_arrival_attaches_out_of_order_to_in_flight_windows— if it flakes that is a test bug, not a product bug, and does not justify GPU time.- Build
main(6d74db3a) once for the A/B arm — the currentmain, notc0c4f798, since the baseline must include#504. - One startup check:
flare runwith--lossless-kv-compression cpuagainst a non-codec core must fail with a clear message.
Step 1 — the burst, A/B, simultaneous (~75 min GPU). The point of the test.
flare run --prefix-cache-memory 0 --prefix-cache-disk <scratch> --prefix-cache-disk-limit 8G. Warm one ~61K-token shared prefix plus 4 distinct child branches to disk; restart so VRAM is cold; send 4 concurrent /v1/chat/completions follow-ups. Same script on current main. Three trials per arm, interleaved (head, main, head, main…) to cancel drift. Measure:
- physical NVMe bytes from
/proc/diskstatsdeltas — expect ≈4× reduction vsmain; - burst median TTFT — expect ≈−20% to −30% on 27B TP1;
flare_host_cache_fetched_total == 4,_fetch_failed_total == 0, reuse well above the prefix size,_inbound_in_flight == 0and_inbound_waiting == 0after drain.
Three trials is enough; a 25–30% effect needs no tighter bound to be actionable.
Step 2 — correctness of the coalesced path (~20 min, folded into Step 1's runs).
- All 4 branches: compare against the same requests served with disk offload disabled, same seed, cold VRAM, and against
mainunder the identical script. Note that byte-identical text is not a valid assertion in general — Flare rejects greedy decoding (helios/src/model.rs:230-233:temperature=0is unsupported) and clamps into a positive sampling range, which is exactly what made last round's8/9vs7/9reading an artifact. So assert on the error-free, logprob-level signals the author used:fetch_failed_total == 0, identical FP32 top-5 logprobs and token IDs at first position betweenmainand head for a fixed seed. A consistent head-only divergence is stop-and-escalate. - One staggered burst (submit branch 1, wait for first token, then the rest), 1 trial, no TTFT claim: no hang, no
fetch_failed, coalescing still engages.
Step 3 — the regressions this PR can plausibly break (~30 min).
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main. This is the path the admission-rate change mis-prices and the path the "expected bound" is about — it is the highest-value regression check in the plan. - Corrupt-record /
read_intopath:tests/server/test_prefix_cache_offload.py(not opened) is not a drop-in CLI check (needsFLARE_RUN_CUDA_TESTS=1,CUDA_VISIBLE_DEVICES,FLARE_OFFLOAD_TEST_CORE, a release binary, direct-I/O basetemp). If no runtime core is available, substitute a hand-driven corrupt-record HTTP check — it matters more now that one shared read error fails a whole cohort. - Idle and shutdown: one restore then
SIGTERM; clean exit. Record (do not act on) any "N disk transport jobs did not complete" message — its count mixes unrelated quantities.
Stop conditions. No read reduction in Step 1 → mechanism failure, stop and report. A consistent logprob divergence in Step 2 → data-path defect, stop and report with the diverging configuration. Single-stream regression beyond noise in Step 3 → report it as the under-stated cost of the PR.
Bottom line
Right problem, right layer, real and large bandwidth win, and tests that assert byte-exact behaviour rather than mocks. Round 3's blocker is genuinely cleared: the v4 packed path is ported and now coalesces, the physical rate sample is out of the wire-event enum, the admission guard uses the allocator's own arithmetic, and hashing can no longer drift silently. The three substantive items are one recorded maintainer decision that is not expected to change behaviour, one cosmetic triplication, and one metering bias whose direction is known and whose magnitude the plan measures. Refer it, run the plan once on cn7, and rest the merge decision on Step 1's physical-read delta and Step 3's single-stream parity — nothing more.
code review summary
Recommendation: Ready To Merge
All prior blocker and should-fix items are resolved in code at cb3db468; coalescing sits in the right layer with no flag, per-model branch, record-format or wire change. What remains is one recorded maintainer decision, one rate-naming/unit mismatch, and a purely subtractive cleanup worth ~360–400 lines.
- Blockers: 0
- Should fix: 2
- Subtractive suggestions: 5
- Nits: 12
Full report · Notes Decision to Test: yes (71%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing.
Discord Test Request
Discord post (ready to paste)
## Recommendation: Test
Medium-high confidence — every claim in the plan was checked against the code at `cb3db468`, but the size of the win was measured on an older commit, so only a run settles it.
## Hardware Required
- cn7 (single GB10, TP1) — same GPU class as the author's benchmark
- Qwen3.8-27B-NVFP4 with a **prepared core** (not just a checkpoint) plus cached weights — stop if `flare models list` shows no TP1 core
- 16 GiB scratch with `--prefix-cache-disk-limit 8G`; the default (~1.6 GB, a tenth of free space) would evict the 2.27 GB prefix and measure nothing
## Justification
- Real, large win on a served workload: ~4.3× fewer physical NVMe reads (18.2 GB → 4.3 GB) and burst TTFT −29% for 4 concurrent branches of one shared prefix.
- Right layer (host-side Rust I/O bookkeeping, no CUDA, no format change, no new flag) — but the benchmark table predates this rebase and one admission-pricing change can only be sized by a run.
## Estimated Time to Complete
~2.5–3 h GPU time (~4–5 h wall clock) on cn7, behind a ~30 min desk gate that must first confirm a prepared core exists.
-----
What I verified before writing it
Code state at head cb3db468 (all confirmed by search, not taken from the author's reply):
- The
#504v4 packed path is ported, not deleted:write_packed(selene/src/disk_store.rs:1766(not opened)),read_into_packed(:1787),take_packed_read(:1830),Source::HostPacked(:1777, also:538,:640),HostDestination::Packed(:1303),disk.rs:988(not opened). So round 3's blocker is genuinely gone. - The rate sample is out of the cross-rank event enum:
inbound_samples: Vec<(u64, Duration)>(:1663), one push at:2149, trait default no-opdrain_inbound_samples(:150),Stagedimpl (:3165-3166), forwarded on rank 0 / discarded on peers (selene/src/shard.rs:1005-1012(not opened),:1214), drained viaobserve_inbound_samples(:3649-3662). MAINTENANCE_DEFER_LIMITreally does not exist at this head (repo-wide search: zero matches), sopump_allis stillmain's ordering — the post-run note "the tester is exercisingmain's ordering" is correct and worth telling the tester.- Every named test exists at head and covers what the plan says:
concurrent_packed_fetches_coalesce_opens_and_read_packed_windows(:10545),coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical(:10288),misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore(:10093),staggered_arrival_attaches_out_of_order_to_in_flight_windows(:9573),header_eq_implies_same_hash(selene/src/shared/record.rs:2229(not opened)). - Feasibility gates check out in the docs: disk limit defaults to one tenth of free space at startup (
docs/prefix-cache-offload.md:923-924), and the "a window released before a later restore attaches is re-read" limit that justifies expecting ≈4–5× rather than 8× is stated atdocs:439-443. §2.4 is indeed three nested bullets (:424-448) with the metrics contract deferred to §4 (:447-448).
One correction to the pre-test report: it says "there is no slots_in_use metric at this head — do not assert on one." That is wrong. flare_host_cache_slots_in_use exists at head (helios/src/server/metrics.rs:1331 (not opened), documented in docs/api.md:383 (not opened) and docs/prefix-cache-offload.md:946, :1299). Nothing in the plan depends on it, so the post and the run are unaffected, but drop that sentence before handing the plan to a tester. The five metric names the plan does use (fetched_total, fetch_failed_total, inbound_in_flight, inbound_waiting, inbound_bytes_per_second) all appear in the tree.
Leads I could not follow from the repository
These come from outside this repo and I had no way to confirm them statically: cn7 / cn5 hardware specs (no cn7 or cn5 string anywhere in the tree), whether flare models list actually shows a prepared TP1 Qwen3.8-27B core, whether the checkpoint weights are really cached despite the "0 GiB" hardware listing, and the cn7 16 GiB scratch figure. Those are exactly why the post puts "prepared core" in the Hardware Required bullets and why the plan's Step 0 desk gate (≈30 min, no GPU) must run before any GPU time is booked — if the core is missing, the run needs a full ignition export pass and must stop rather than substitute a model, because the TTFT claim is specific to this model at TP1.
Recommendation
Post it as written. The referral is "Test on cn7 only," and the two things the run actually buys are (1) a physical-read delta measured at this head instead of 0c04b1e2, and (2) single-stream restore parity that sizes the optimistic admission-pricing change. One process item should be sequenced before the run: the maintainer sign-off that AGENTS.md:201-206 (not opened) requires for placing a second inbound lifecycle inside Staged — a different placement would rewrite the code under test.
Full report Human Approval: Do you approve this test? → No answer in time.
Discord post (ready to paste)
## Recommendation: Test Medium-high confidence — every claim in the plan was checked against the code at `cb3db468`, but the size of the win was measured on an older commit, so only a run settles it. ## Hardware Required - cn7 (single GB10, TP1) — same GPU class as the author's benchmark - Qwen3.8-27B-NVFP4 with a **prepared core** (not just a checkpoint) plus cached weights — stop if `flare models list` shows no TP1 core - 16 GiB scratch with `--prefix-cache-disk-limit 8G`; the default (~1.6 GB, a tenth of free space) would evict the 2.27 GB prefix and measure nothing ## Justification - Real, large win on a served workload: ~4.3× fewer physical NVMe reads (18.2 GB → 4.3 GB) and burst TTFT −29% for 4 concurrent branches of one shared prefix. - Right layer (host-side Rust I/O bookkeeping, no CUDA, no format change, no new flag) — but the benchmark table predates this rebase and one admission-pricing change can only be sized by a run. ## Estimated Time to Complete ~2.5–3 h GPU time (~4–5 h wall clock) on cn7, behind a ~30 min desk gate that must first confirm a prepared core exists. -----What I verified before writing it
Code state at head
cb3db468(all confirmed by search, not taken from the author's reply):
- The
#504v4 packed path is ported, not deleted:write_packed(selene/src/disk_store.rs:1766(not opened)),read_into_packed(:1787),take_packed_read(:1830),Source::HostPacked(:1777, also:538,:640),HostDestination::Packed(:1303),disk.rs:988(not opened). So round 3's blocker is genuinely gone.- The rate sample is out of the cross-rank event enum:
inbound_samples: Vec<(u64, Duration)>(:1663), one push at:2149, trait default no-opdrain_inbound_samples(:150),Stagedimpl (:3165-3166), forwarded on rank 0 / discarded on peers (selene/src/shard.rs:1005-1012(not opened),:1214), drained viaobserve_inbound_samples(:3649-3662).MAINTENANCE_DEFER_LIMITreally does not exist at this head (repo-wide search: zero matches), sopump_allis stillmain's ordering — the post-run note "the tester is exercisingmain's ordering" is correct and worth telling the tester.- Every named test exists at head and covers what the plan says:
concurrent_packed_fetches_coalesce_opens_and_read_packed_windows(:10545),coalesced_restores_keep_inbound_rate_physical_and_bytes_in_logical(:10288),misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore(:10093),staggered_arrival_attaches_out_of_order_to_in_flight_windows(:9573),header_eq_implies_same_hash(selene/src/shared/record.rs:2229(not opened)).- Feasibility gates check out in the docs: disk limit defaults to one tenth of free space at startup (
docs/prefix-cache-offload.md:923-924), and the "a window released before a later restore attaches is re-read" limit that justifies expecting ≈4–5× rather than 8× is stated atdocs:439-443. §2.4 is indeed three nested bullets (:424-448) with the metrics contract deferred to §4 (:447-448).One correction to the pre-test report: it says "there is no
slots_in_usemetric at this head — do not assert on one." That is wrong.flare_host_cache_slots_in_useexists at head (helios/src/server/metrics.rs:1331(not opened), documented indocs/api.md:383(not opened) anddocs/prefix-cache-offload.md:946,:1299). Nothing in the plan depends on it, so the post and the run are unaffected, but drop that sentence before handing the plan to a tester. The five metric names the plan does use (fetched_total,fetch_failed_total,inbound_in_flight,inbound_waiting,inbound_bytes_per_second) all appear in the tree.Leads I could not follow from the repository
These come from outside this repo and I had no way to confirm them statically: cn7 / cn5 hardware specs (no
cn7orcn5string anywhere in the tree), whetherflare models listactually shows a prepared TP1 Qwen3.8-27B core, whether the checkpoint weights are really cached despite the "0 GiB" hardware listing, and the cn7 16 GiB scratch figure. Those are exactly why the post puts "prepared core" in the Hardware Required bullets and why the plan's Step 0 desk gate (≈30 min, no GPU) must run before any GPU time is booked — if the core is missing, the run needs a fullignition exportpass and must stop rather than substitute a model, because the TTFT claim is specific to this model at TP1.Recommendation
Post it as written. The referral is "Test on cn7 only," and the two things the run actually buys are (1) a physical-read delta measured at this head instead of
0c04b1e2, and (2) single-stream restore parity that sizes the optimistic admission-pricing change. One process item should be sequenced before the run: the maintainer sign-off thatAGENTS.md:201-206(not opened) requires for placing a second inbound lifecycle insideStaged— a different placement would rewrite the code under test.
Apply Labels
Applied: +performance, +area:caching, +area:selene, +triage:review
Manual review adjustment: +triage:review
Classification Confidence
Threshold: 65%
Triage
-
triage:validation: 64.6% -
triage:review: 34.6% -
triage:design-review: 0.6%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
performance: 97.1% -
community: 37.8% -
enhancement: 22.3% -
duplicate: 20.2%
Area
- [✓]
area:selene: 99.4% - [✓]
area:caching: 90.5% -
area:memory: 50.0% -
area:preparation: 40.7%
Model
-
model:kimi-k3.1: 4.2% -
model:nemotron-3.5-bolt: 1.8% -
model:muse-glimmer: 1.4% -
model:mimo-v2.6: 0.8% decide malicious: all_clear (100%): No malicious content found
explore
Author: FujitsuPolycom (CONTRIBUTOR, external; Discord: Dooner) Motivation: Concurrent disk restores of the same checkpoint each re-read the same bytes from NVMe, so the disk tier becomes the bottleneck when many users resume the same long prefix. This PR lets simultaneous restores share one file handle and one aligned window read, then fan the data out to each restore's own GPU upload. Scale: +5181 / −291 lines in 6 files Proposal:
- Move the device-inbound state machine out of
disk_store.rs(8,063 lines, +337/−288) into newselene/src/disk_store/coalesce.rs(+1416) with 9 single-purpose pump passes, pluscoalesce/tests.rs(+3217). - Share one open handle and
WINDOW_PAGES-aligned windows across concurrent fetches bySegmentKey/WindowKey, for raw v1–v3SlabPoolwindows and v4 packedReadPackedbuffers (packed windows allocate zero slots). - Cache a
u64header digest inHeaderIdentityand build the demand map lazily, fixing a measured 1.5–49 ms per-poll()stall at 8 fetches on packed records. - Revert
inbound_rateto end-to-end with a downward-only guard for restores riding pre-existing windows;bytes_instays logical; docs §4 rewritten to match. - Hold back lower-demand private tails on tight intake pools so siblings stay synchronized on shared ancestors (the
#497interaction), and splitdisk_store.rsdocs §2.4 into mechanism/invariant/limits bullets. Touches: selene/src/disk_store/coalesce.rs(new shared-segment/shared-window lifecycle, refcounts, admission planning)selene/src/disk_store.rs(fetch/apply rate accounting, close accounting, packed surface)docs/prefix-cache-offload.md(§2.4 mechanism, §4 metrics contract) Related items:- #497 Reduce disk offload restore latency and integrated-memory intake overhead (open): companion PR; merges first, then #496 rebases; supplies the tight
2*(64+row_slots)pool - #504 selene, selene-manager, helios, ignition, heliopause: add pure-CUDA GPU and CPU lossless KV compression (merged): v4 packed record surface this PR coalesces and preserves
- #343 Keep disk cache records after transient restore failures (merged): source of the
is_record_read()failure-scope semantics used for corrupt packed payloads Link: https://github.com/NVIDIA/hyperflare-inference/pull/496 Autobot comments: The design sign-off I last reported as the sole blocker has been given (yatesdr, 2026-11-29 02:14), but the same review raised three empirically measured blockers (per-poll hashing stall,inbound_rateinflation, tight-pool desync); all three are fixed in source at the new head, and the hashing fix closes my own earlier exhaustive-Hashfinding — that earlier reporting is now superseded, as is my claim that the out-of-band physical rate sample was the settled design (it was reverted to end-to-end). No review exists at the current headba1c73fd, and the "Ready To Merge" reviews in the thread judged the oldercb3db468. The review's closing ask — live--lossless-kv-compression cpu|gpuserving validation — is unmet and conceded by the author, and no served benchmark has been re-measured at head; the new anti-regression test's only latency bound ismean_us < 200against ~0.7 µs achieved, so per-probe cost could regress silently. TheDesign-Signed-Off-Bycommit trailer required bydocs/design-review.mdis still owed at merge.
Classify intake
Selected: performance, area:caching, area:selene
Threshold: 65%
Triage
-
triage:validation: 59.2% -
triage:review: 40.7% -
triage:design-review: 0.1% -
none: 0.1% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 100.0% -
priority:P1: 0.0% -
priority:P2: 0.0%
Type
- [✓]
performance: 98.8% -
community: 34.9% -
enhancement: 32.1% -
duplicate: 24.5% -
bug: 7.6% -
documentation: 0.1%
Area
- [✓]
area:selene: 99.8% - [✓]
area:caching: 73.1% -
area:memory: 40.7% -
area:preparation: 9.5% -
area:scheduling: 4.2% -
area:kernels: 2.0% -
area:api: 1.6% -
area:rocenante: 0.4% -
area:engram: 0.2% -
area:orbit: 0.2% -
area:packaging: 0.1%
Model
-
model:inkling-small: 2.0% -
model:nemotron-3.5-bolt: 1.1% -
model:kimi-k3.1: 0.9% -
model:muse-glimmer: 0.9% -
model:deepseek-v4.1: 0.8% -
model:qwen3.8-27b: 0.7% -
model:glm-5.3: 0.5% -
model:qwen3.8-flash-next: 0.5% -
model:gemma4: 0.5% -
model:mimo-v2.6: 0.0% -
model:deepseek-v4: 0.0%
Apply Labels (Intake)
No label changes
Value Proposition
Value Proposition — PR #496: Coalesce shared ancestor reads across concurrent Selene disk fetches
Charter alignment. Disk-resident prefix-checkpoint serving is an explicit goal ("Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene"), and this change lands in the right layer: the runtime (selene/src/disk_store.rs plus a private coalesce submodule), not Ignition recipes. No per-model branch, no new flag, no TransportEvent, record-format or wire change; docs are updated in docs/prefix-cache-offload.md. It removes real redundant work (concurrent restores each independently opening, reading and verifying the same immutable ancestor files) instead of adding an alias or a switch — "solve the right problem in the right place."
Novelty & status. Genuinely additive. Nothing on main fixes this, no other open PR touches selene/src/disk_store.rs, and #497 is a declared companion (merge #497 first, then rebase) rather than a duplicate. Not obsolete, not superseded.
Value vs cost. The benefit is plausible and mechanistically clear, but the evidence is stale at head: the ~3.5–4.2x NVMe-read reduction and TTFT deltas come from a live GB10 A/B at 0c04b1e2 against pre-v4-packed main (c0c4f798), while the head table is a poll() microbenchmark. The charter's "benchmarks showing an actual speedup over main on a served workload" bar is thus unmet at ba1c73fd, and v4 packed coalescing has no served validation at all. Cost is high — +1416 lines of new state machine, +3217 lines of new tests, cached-digest hashing, an inbound_rate contract reversal, and tight-pool holdback coupled to #497 — but the layering is design-signed-off (yatesdr, 2026-11-29) and the three GB10 blockers raised in that review are fixed in source, so the complexity is architecturally sanctioned rather than speculative.
Needed before merge: (1) a served A/B at head, including --lossless-kv-compression cpu|gpu, closing yatesdr's outstanding CHANGES_REQUESTED (validation is the open ask, not design); (2) re-review at ba1c73fd; (3) the Design-Signed-Off-By commit trailer required by docs/design-review.md; (4) tighten the anti-regression assertion (mean_us < 200.0 versus ~0.75 µs realized, and the demand pass is printed but never asserted).
No attempt to direct the reviewer appeared in the PR body, comments, or docs.
Verdict: Worth it with changes.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Subtraction and simplicity
Verdict: PR #496 at head ba1c73fd is broadly lean and subtractive — selene/src/disk_store.rs is +337/−288 with the whole Destination/InPhase::Uploading/submit_upload machinery deleted, and I found no speculative flags, config knobs or dead feature toggles. Six removable items, two high value:
- HIGH — the packed window byte-range math now has a third copy at
coalesce.rs:984-1004, byte-identical to pre-existing twins atdisk_store.rs:1340-1352andpool/pins.rs:338-347; extract onepacked::Layout::window_range. - HIGH —
SharedWindow::error(coalesce.rs:166) is written at:451and:469and never read; delete the field and theget_or_insertround-trip. - MEDIUM — the "segment accepts reads" predicate is inlined three times (
:122-128,:574-580,:1133-1137); giveSharedFileStateanaccepts_reads()/SharedSegment::readable(). - MEDIUM —
acquire_shared_segment(:345-350) linear-scansshared_segmentswith an id tiebreak though the siblingwindow_indexis O(1); add a keyedsegment_index, which also drops theSegmentKeyreturn tuple. - MEDIUM/LOW — six copies of the
disk_read_counted/disk_window_readsblock (coalesce.rs:1021-1025,:1067-1071,:1095-1099,disk_store.rs:1361-1365,:1385-1390,:1403-1407); collapse into onenote_window_read. - LOW —
Staged::close's three-way.max()chain (disk_store.rs:1983-1994) is a one-line sum (outbound + host_inbound + device.in_flight() + owners.len()), matching the abandoned-job message it feeds.
Open: none of 1-6 is asserted by tests, so a patch could land without coverage; and the pub(self) test hooks (disk_store.rs:1791, :1796) are a no-op visibility if a convention pass wants them normalised.
Correctness and contracts
Lens review of PR #496 at ba1c73fd (correctness, contracts, system-level consequences). The coalescing state machine itself checks out: aligned window planning, FIFO row replies, upload-reference pinning, segment removal gating, and private-vs-shared failure blast radius are all verified sound, and no public contract (TransportEvent, FetchSegment, record format) changed. Two verified defects: (F1, Major) the one sentence this PR adds about CompositeStore's disk_inbound_rate (docs/prefix-cache-offload.md:1625-1627) claims an end-to-end rate, but composite.rs:1059-1068 samples physical/compressed disk_bytes over a disk-read-only span (disk_started set at composite.rs:954, 957), which is the quantity composite.rs:374 uses to price admission — so the docs describe the DiskStore rate, not the composite's; compounded by composite.rs:340-342 copying the DiskStore rate into the composite's stats.inbound_rate. (F2, Minor) the anti-regression poll-latency test asserts only mean_us < 200.0 (coalesce/tests.rs:583-586) against a claimed 0.25-0.75 us, and the credit-regained demand pass is printed but never asserted (tests.rs:593-602), so the exact regression the reviewer measured can return test-silently. (F3, Major charter) every served-workload number in the description predates this head (prior A/B c0c4f798 vs 0c04b1e2; "Not covered: post-fix SM121 flare run re-measurement on ba1c73fd"), so #210 served evidence is still owed. Open: no re-review at ba1c73fd, no live --lossless-kv-compression run, and the Design-Signed-Off-By trailer is absent from the single ba1c73fd commit.
Final review
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.
Classify triage
Selected: triage:validation
Threshold: 65%
Triage
- [✓]
triage:validation: 97.4% -
triage:review: 2.6% -
none: 0.0% -
triage:design-review: 0.0% -
triage:investigate: 0.0% -
triage:partial: 0.0% -
triage:integration: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0% Decision to Test: yes (78%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing.
Apply labels
Applied: +triage:validation, -triage:review
Pre Test Report
Pre-test report — PR #496 "Coalesce shared ancestor reads across concurrent Selene disk fetches" (round 5, head ba1c73fd)
Decision: REFER to hardware testing — cn7 only, one model, ≈2.5 h of GPU time behind a ~25 min desk gate. At this head the three empirical GB10 blockers from @yatesdr's 2026-11-29 review are fixed in source (cached HeaderIdentity digest + lazy demand build, end-to-end DiskStore::inbound_rate with a rode_preexisting downward-only guard, tight-pool holdback), the design boundary is signed off, selene/src/shard.rs (not opened) is back to a zero-byte diff, and the state machine moved into selene/src/disk_store/coalesce.rs (not opened) (1,416 lines) with coalesce/tests.rs (3,217 lines, 19 tests). Two things remain unmeasured and both are things only a run at this head settles: the served A/B numbers in the description are still from 0c04b1e2 against pre-v4 main c0c4f798, and live --lossless-kv-compression cpu|gpu serving has never been run against the rewritten v4 packed coalescing path. That is exactly what the plan below buys — and nothing else.
Files at head ba1c73fd (base 6d74db3a; main is now 99339606): docs/prefix-cache-offload.md +48/−2, selene/src/disk_store.rs +337/−288, selene/src/disk_store/coalesce.rs (not opened) +1,416 (new), selene/src/disk_store/coalesce/tests.rs +3,217 (new), selene/src/shared/packed.rs (not opened) +44, selene/src/shared/record.rs (not opened) +119/−1. Security screen: all clear; nothing in the PR text, docs or comments attempted to direct me.
What I verified in source before writing the plan (these change what is worth testing)
- Rate accounting is end-to-end again.
Inboundnow carriesread_nodes,logical_bytes = layout.record_bytes(chain.pages),startedandrode_preexisting(selene/src/disk_store.rs:2044-2060, computed at:3422-3446);applyobserves(job.logical_bytes, job.started.elapsed())only when!rode_preexistingor when the measured throughput is slower than the current estimate (:3244-3251). The out-of-banddrain_inbound_samplesplumbing is gone. Consequence for the test:flare_host_cache_inbound_bytes_per_secondis once again a whole-restore rate in uncompressed checkpoint bytes, and a fast coalesced follower deliberately does not raise it. - The coalescing counters are compiled out of a serving build.
disk_opens/disk_window_reads/coalesced_windowsare#[cfg(any(test, feature = "test-support"))](selene/src/disk_store.rs:214-222, 1498-1514), andheliosdepends onflare-selenewithouttest-support(helios/Cargo.toml:45;test-supportappears only under[dev-dependencies]at:69). Soflare runcan never report them, and no/metricsgauge exposes them. Physical-read evidence must come from the block device, not from the store. This is the single biggest way to waste the run. - v4 packed reads are buffered, so they cannot be priced in physical NVMe bytes.
disk::Worker::openusesFile::openfor packed records (selene/src/disk.rs:1063-1086) andread_packedusesread_exact_at(:1037-1056) — page-cache hits report RAM-copy speeds. Raw v1–v3 goes throughflare_eos::direct_file(O_DIRECT,:1088). So: measure physical bytes only on the--lossless-kv-compression offarm; the compressed arms are for correctness, failure isolation and wall-clock latency. - The compressed path really does produce v4 packed records on disk, so the compressed arm is the only live exercise of shared
ReadPackedwindows.start_outboundsetspacked = truefor a device capture whencodec_enabled()andfits_units(...)(selene/src/disk_store.rs:1722-1727), wherecodec_enabled()istransfers.codec_profile().is_some()(:250). Good news for the tester: this is testable — provided the core was exported with a codec layout. cpu/gpuneed an exported core capability, and this is a hard gate.cpu|gpurequirescontract.cache.codec_layoutor startup fails with "the core was exported without a codec layout" (helios/src/runtime_core/memory.rs:638-642);gpuadditionally requires an embeddedgpu_modulecubin or fails with "use --lossless-kv-compression cpu or re-export" (helios/src/runtime_core/model.rs:626-632).codec_layoutis declared only by the (external) recipe viaignition/preparation/contract.py:117-135.flare inspect CORE --all --jsonprints the raw contract undercontract(helios/src/runtime_core/describe.rs:184-185), so this is a one-command pre-check. If the cn7 core has nocodec_layout, the compressed arm is impossible and the plan must stop at the raw arm — do not substitute a model, because every claimed TTFT number is specific to Qwen3.8-27B at TP1.- Correctness assertions must be logprob-level, not byte-identical text. Greedy decoding is unsupported:
temperature=0is rejected (helios/src/model.rs:230-233). Compare FP32 top-5 logprobs and token ids at a fixed seed (seedis a request field), which requires the core to advertisemax_top_logprobs != 0(helios/src/server/models.rs:88(not opened); surfaced in the/v1/modelsflareblock). - The disk-limit trap is live. The limit defaults to one tenth of the directory's free space at startup (
docs/prefix-cache-offload.md:924-927), i.e. ≈1.6 GB on cn7's 16 GiB scratch, against a ~2.27 GB parent record (472 pages × 128 tokens × ~4.19 MB + ~101 MB row). Left at default the warm prefix is evicted and the burst silently re-prefills, measuring nothing. pump_allat this head is stillmain's order (maintenance → outbound → host_inbound → device_inbound);MAINTENANCE_DEFER_LIMITexists only in#497(ca863852, still open, and it says merge#497first). So the tester exercisesmain's ordering, not the post-#497shipping order — worth one line in the result and not a reason to test both.- Metric names verified present at head (
helios/src/server/metrics.rs):flare_host_cache_fetched_total(:1198),_fetch_failed_total(:1203),_bytes_in_total(:1213, logical by design),_inbound_in_flight(:1321),_inbound_waiting(:1326),_slots_in_use(:1331),_slots_total,_intake_slots(:1341),_disk_bytes(:1361),_inbound_bytes_per_second(:1371),_reused_tokens_total(:1158). Codec counters exist for the compressed arm:flare_kv_codec_active,_original_bytes_total,_stored_bytes_total,_transform_nanoseconds_total,_failed_windows_total,_verification_failures_total(docs/operating.md:57-69). Correction to my previous report:flare_host_cache_slots_in_usedoes exist (:1331) — my earlier "do not assert on it" was wrong. - Headroom maths:
WINDOW_CREDITS = 2(selene/src/shared/limits.rs:18(not opened)),RECORDS_IN_FLIGHT = 8(selene/src/disk_store.rs:71), disk-only intake2 * max_active * row_slots + 2*64(selene/src/offload.rs:175-177). A 4-branch burst is comfortably insideRECORDS_IN_FLIGHT; do not exceed 8 in one burst or fetches are refused rather than queued.
Feasibility gates — check these before booking anything (each is a hard stop)
- Prepared core, not just a checkpoint.
flare runloads an exported core.flare models listmust show a TP1 Qwen3.8-27B entry you can run. If it does not, a preparation pass is out of budget: stop rather than substituting a different model. - Weights actually cached. The hardware sheet lists every model at 0 GiB; a cold 27B download would dominate the run.
codec_layoutin the core (compressed arm only):flare models inspect CORE --all --json | grep -c codec_layout; for thegpuarm also confirmcodec_layout.gpu_moduleis present.- Cache directory on the scratch device with ≥8 GB free; identify the backing block device up front (
df --output=source <dir>→/sys/block/<dev>/stat), because that is the only valid physical-byte instrument.
Minimal test plan — cn7, ≈25 min desk + ≈2.5 h GPU
Target: cn7, 1 × GB10 (SM121 — the same class and the same model as the author's evidence), nvidia/Qwen3.8-27B-NVFP4, TP1. 10 CPUs / 60 GiB RAM / 16 GiB scratch. cn5 is not needed: no Qwen3.8-27B weights, and a different GPU class is only a disambiguator.
Every flare run below uses --prefix-cache-memory 0 --prefix-cache-disk <scratch>/selene-disk --prefix-cache-disk-limit 8G and must confirm the startup line reports the 8 GB limit (otherwise the trap in item 7 silently voids the run).
Step 0 — desk, no GPU (≈25 min). Stop if red.
- Gates above.
cargo test --locked --release --manifest-path selene/Cargo.toml --features test-support. Watch these by name:coalesced_restores_keep_inbound_rate_end_to_end_and_bytes_in_logical,overlapping_shared_stream_tracks_slowdown_and_recovers_without_drift,leader_private_failure_with_slow_follower_updates_inbound_rate_and_rejects,packed_restore_inbound_rate_includes_decode_delay_and_worth_fetching_rejects(codec),sharded_inbound_rate_reflects_end_to_end_multi_rank_wall_time,sharded_concurrent_fetches_coalesce_across_rank_zero_and_peer,tight_pool_waits_for_shared_ancestor_instead_of_starting_private_tail,tight_pool_wait_never_deadlocks_without_releasable_staged_slots,concurrent_packed_fetches_coalesce_opens_and_read_packed_windows(codec),misaligned_follower_attaching_to_shared_partial_tail_and_row_matches_private_restore,header_identity_caches_digest_and_matches_header_equality. The author reports 522 lib + 1 integration; anything red is a stop.- Re-run the regression benchmark on the target CPU, because that is what
@yatesdractually measured:cargo test --release --manifest-path selene/Cargo.toml --features test-support --lib poll_at_full_window_credit_with_large_packed_header_avoids_demand_rebuild_and_rehashing -- --nocapture. Record thepacked_poll_benchlines for TP1/512, TP8/512, TP8/1024 atfetches=1andfetches=8. The assertion is onlymean_us < 200.0(coalesce/tests.rs:583-586) against ~0.25–0.75 µs realised, so the assertion cannot catch a regression; the printed number is the evidence. Pre-fix GB10 numbers were 1.47 ms / 9.73 ms / 49.33 ms atfetches=8; anything in that order of magnitude at this head is a fail even with a green test. Also record the printedpacked_demand_passµs (26–40 µs on x86_64) — that one is never asserted. - Build the A/B baseline from current
main(99339606or later), notc0c4f798, so the baseline includes#504. - One free command that validates the
#504boundary the port must preserve:flare runwith--lossless-kv-compression cpuagainst a core with no codec layout must fail with the clear "exported without a codec layout" message, not a panic.
Step 1 — raw arm A/B, the load-bearing measurement (≈60 min GPU)
- Warm one ~61K-token shared prefix plus 4 distinct child branch tails to disk (≈2.3 GB total: the parent record is 2.27 GB and each child holds only its own tail — this is why 8G is enough and why "before" reads are large). Then restart
flare runso VRAM is cold. Kept once per arm; the record directory persists across restarts. - Send 4 concurrent
/v1/chat/completionsfollow-ups that all chain through the shared parent. Three trials per arm, interleaved (head, main, head, main, head, main) to cancel drift. - Measure per trial:
- Physical NVMe:
/sys/block/<cache-dev>/statfield 3 (sectors read) × 512 delta across the restore window, or/proc/diskstatsequivalents. Valid on this arm because raw records are O_DIRECT. - Burst median TTFT (ingress → first token), same definition as the PR table.
/metricsdeltas:flare_host_cache_fetched_total == 4,_fetch_failed_total == 0,_reused_tokens_total≫ prefix size, and after drain_inbound_in_flight == 0and_inbound_waiting == 0.
- Physical NVMe:
- Expectation, stated up front so a correct result is not reported as a failure: with 4 branches, "before" ≈ 4 × 2.27 GB ≈ 9.1 GB; "after" should be ≈2.3–4.6 GB (one copy, plus a re-read of any window released before a later follower attached — a documented limit,
docs/prefix-cache-offload.md:439-443). So a pass is ≈2–4× fewer physical bytes, not 8×, and burst TTFT should move −15 % to −30 % on this model. A 4.3 GB result on a 4-way burst is a pass. - Stop condition: no read reduction at all → mechanism failure in serving; stop and report rather than continuing to the later steps.
Step 2 — compressed arm: the one live path nobody has run (≈40 min GPU)
This is the item @yatesdr asked for and the author conceded as uncovered. Run --lossless-kv-compression cpu first (no cubin needed), then gpu only if the core has gpu_module.
- Same warm + cold-restart + 4-branch burst, 2 trials per mode. Confirm the startup banner reports the mode and that the record directory now holds v4
.ckptfiles (packed records were actually written — item 4 above); if the scan still shows raw records, the arm is not exercisingReadPackedand the test is meaningless. - Assert: all 4 fetches succeed,
_fetch_failed_total == 0,flare_kv_codec_active == 1,flare_kv_codec_failed_windows_total == 0,flare_kv_codec_verification_failures_total == 0, and_bytes_in_totalgrows by the compressed payload per fetch while_inbound_bytes_per_secondstays a plausible whole-restore rate. - Assert correctness against the raw arm: identical generated tokens and identical FP32 top-5 logprobs for a fixed seed, and identical outputs to the same requests served with disk offload disabled.
- Do not measure physical NVMe bytes here (item 3: buffered reads). Do record burst TTFT for information only, without binding a claim to it.
- One extra cheap probe worth 5 minutes: start a second concurrent burst while the first is still draining, and confirm no hang and
_inbound_in_flightreturns to 0 — this is the packed-window refcount path under overlap. - Stop condition: any fetch failure, any codec verification failure, or any token/logprob divergence that is consistent across repeats → data-path defect; stop and report with the mode and the diverging branch.
Step 3 — regressions this PR can plausibly break (≈25 min)
- Single-stream restore (one request, no sibling): TTFT and physical bytes within noise of
main. This is the path therode_preexisting/end-to-end rate change and the "one extra partial window" cost affect, and the path a lone later request actually takes. Highest-value regression in the plan. - Staggered arrival: submit branch 1, wait for first token, then the other three. No TTFT claim — just no hang,
_fetch_failed_total == 0, and coalescing still engages (visible indirectly as a lower physical-byte delta than the simultaneous case's before arm). - Corrupt-record fallback: corrupt a byte in the parent record file between runs; the restore must fail as a record-read error, fall back to prefill, and serve correctly. This matters more now that one shared read error fails the whole attached cohort. If
tests/server/test_prefix_cache_offload.py(not opened) is available with its required environment (FLARE_RUN_CUDA_TESTS=1,FLARE_OFFLOAD_TEST_CORE, release CLI, direct-I/O basetemp), run it; otherwise do this by hand. - Shutdown: one restore then
SIGTERM; clean exit. If drain is slow, capture the message verbatim —abandoned_jobsstill.max()es heterogeneous collections (selene/src/disk_store.rs:1983-1994), so the count is not a job count; record it, do not act on it.
Do not spend GPU time on
- Multi-host RoCE / TP2/TP4 rows: no matching hardware, and
selene/src/shard.rs(not opened) is a zero-byte diff again; its logic is covered by the local-TCPSharded+Peertests in Step 0. - Windows IOCP, discrete PCIe GPUs, 2-GPU
split_pools: not available on cn7. - DeepSeek TP4
1.00×: a reported null with a stated cause (per-rank 52.8 MB reads finish before tokenization, so requests never overlap); nothing to validate. - Flash-Next rows: −3 % TTFT for 75 % fewer reads; no decision turns on it and it costs another warm-up cycle on a second model.
- cn5: no Qwen3.8-27B weights; a different GPU class would only be a disambiguator if cn7 surprises.
- Re-running the crate suite more than once, or using GPUs to prove "tests pass" — that is desk work.
- Trying to read
disk_opens/disk_window_reads/coalesced_windowsfrom a serving build: they aretest-support-only (item 2). If the tester wants the coalescing counters live, the honest instrument is a--features test-supportbuild, which is not a production binary — say so rather than spending an hour discovering it. - Any compressed-mode physical-byte claim: buffered reads make it unmeasurable (item 3).
Budget: ≈25 min desk (no GPU) + 60 min Step 1 + 40 min Step 2 + 25 min Step 3 + 20 min slack ≈ 2.5 h cn7 GPU time, one node, one model.
Residual issues (none change what the plan measures, all worth fixing before or with merge)
- The anti-regression test cannot fail on the regression it targets.
mean_us < 200.0(coalesce/tests.rs:583-586) versus 0.25–0.75 µs realised, andcredit_usis printed but never asserted (:593-602). Step 0 item 3 mitigates this for one run only; the assertion should be tightened to ~< 5 µs(or< 500 nsoutside debug). - Dead field
SharedWindow::error(written atcoalesce.rs:451(not opened), re-cloned at:469, never read) — first-error-wins is already enforced byDeviceInbound::fail. - Third copy of packed byte-range maths at
coalesce.rs:984-1004(not opened), duplicatingdisk_store.rs:1340-1352andpool/pins.rs:338-347(not opened); onepacked::Layout::window_rangewould keep all three in step. - Duplicated state predicate
open_error.is_none() && matches!(state, Opening | Opened)inlined atcoalesce.rs:574-580(not opened) and:1133-1137. - Process: the
Design-Signed-Off-Bytrailerdocs/design-review.md(not opened) requires is still owed;@yatesdrgave the sign-off in review, andAGENTS.md:201-206(not opened) wants it recorded on the commit. - Merge order:
#497(ca863852, open) editsStaged::pump_all; merge#497first and rebase, then the ordering the description describes is what actually ships. - My earlier correction, restated: the hash-drift hazard is closed at this head (
Headerhas an exhaustiveHashbeside itsPartialEq,header_eq_implies_same_hashpins agreement), and the "noslots_in_usemetric" claim in my round-4 report was wrong (helios/src/server/metrics.rs:1331).
Bottom line
Refer it, test on cn7 with Qwen3.8-27B-NVFP4 only, and spend the time on exactly three things: physical NVMe bytes and burst TTFT at this head on the raw arm against current main; a --lossless-kv-compression cpu (then gpu if the core allows) burst that proves the rewritten v4 packed coalescing path serves correctly with zero codec verification failures and logprob-identical output; and single-stream parity plus a corrupt-record fallback. Everything else in the PR's table is either unmeasurable here, a reported null, or already covered by cheap CPU tests — and the coalescing counters that would have made this easy are compiled out of the serving binary, so the block device is the instrument.
Discord Test Request
Discord post (ready to paste)
## Recommendation: Test
Medium-high confidence — the mechanism checks out in source at head `ba1c73fd`, but the size of the win and the compressed path were last measured on an older commit, so only a run settles it.
## Hardware Required
- cn7: one GB10, TP1 — same GPU class as the author's benchmark
- Qwen3.8-27B-NVFP4 as a **prepared core** (not just a checkpoint) with cached weights; stop if `flare models list` shows no TP1 core
- 16 GiB scratch run with `--prefix-cache-disk-limit 8G` — the ~1.6 GB default evicts the 2.3 GB prefix and measures nothing
## Justification
- Measured ~4.2× fewer physical NVMe reads (18.2 GB → 4.3 GB) and −29% burst TTFT when concurrent requests share one ~61K-token prefix.
- Those numbers predate this rebase, and the live v4 packed (`--lossless-kv-compression cpu|gpu`) restore path has never been served — a run is the only way to confirm both.
## Estimated Time to Complete
~2.5 h GPU on cn7 (≈3–4 h wall clock), behind a ~25 min no-GPU desk gate that must confirm a prepared core first.
-----
What I verified in the repository this turn (at head ba1c73fd, base 6d74db3a)
- End-to-end rate accounting is real at this head.
rode_preexistingexists onInbound(selene/src/disk_store.rs:2060), is computed at:3429, gatesinbound_rate.started()at:3441and the downward-only observe at:3244, and is stored at:3453. The out-of-band sampling plumbing is gone: repo-wide search forinbound_samples/drain_inbound_samplesreturns zero matches, as doesMAINTENANCE_DEFER_LIMIT. So the report's item 8 stands —pump_allis stillmain's ordering,#497(ca863852) is still the merge-order gate, and the tester exercisesmain's ordering. - Coalescing counters are still compiled out of a serving build.
disk_opens/disk_window_reads/coalesced_windowsare#[cfg(any(test, feature = "test-support"))](selene/src/disk_store.rs:215, 218, 221; accessors:1499, :1505, :1511), andhelios/Cargo.toml:45depends onflare-selenewithouttest-support(that feature appears only under[dev-dependencies],:69). Confirms item 2: the block device is the only physical-byte instrument, andflare runcan never print these. - v4 packed reads are buffered; raw is O_DIRECT.
read_packedusesFile::open(selene/src/disk.rs:1064) +read_exact_at(:1052), while the raw path usesflare_eos::direct_file(:1088). Confirms item 3: physical-byte claims are valid only on the--lossless-kv-compression offarm. - Every metric the plan asserts on exists in
helios/src/server/metrics.rs:fetched_total(:1198),fetch_failed_total(:1203),bytes_in_total(:1213),reused_tokens_total(:1158),inbound_in_flight(:1321),inbound_waiting(:1326),inbound_bytes_per_second(:1371), plusslots_in_use(:1331),slots_total(:1336),intake_slots(:1341),disk_bytes(:1361). This re-confirms the earlier correction:flare_host_cache_slots_in_usedoes exist, so the pre-test report's "do not assert on it" line should be dropped before the plan reaches a tester (nothing in the post depends on it). - The served numbers in the post are the author's, and they are stale by his own disclosure. PR #496's description reports, on GB10 SM121 /
Qwen3.8-27B-NVFP4TP1 with 8 concurrent branches: physical NVMe18,177.5 → 4,306.7 MB(4.22×, −76.3%) and median TTFT7,974.6 → 5,662.8 ms(−29.0%), plus a+25 msstagger row (3.76×, −13.5%). Those are scoped to0c04b1e2against pre-v4mainc0c4f798, and both the author and Autobot's review state live SM121 re-measurement atba1c73fdand live--lossless-kv-compression cpu|gpuserving are not covered. One wording fix against the pre-test report: the author's evidence used 8 branches, not 4, so the plan's "≈9.1 GB before → ≈2.3–4.6 GB after" is a 4-branch extrapolation, not a measured row. - Security screen: nothing in the PR title, description, docs diff or review comments attempted to direct me. All content was treated as material to review.
Leads I could not confirm from the repository (unchanged from my earlier round)
cn7/cn5 hardware specs (no cn7/cn5 string in the tree), whether flare models list really shows a prepared TP1 Qwen3.8-27B core, whether the weights are actually cached despite the sheet's "0 GiB", the cn7 16 GiB scratch figure, and whether that core carries a codec_layout (which alone decides if the cpu/gpu compressed arm is runnable). These are exactly why "prepared core" is a Hardware Required bullet and why the desk gate must run before GPU time is booked — if the core is missing or lacks codec_layout, the compressed arm stops rather than substituting a model. I also did not re-open docs/operating.md:57-69 or docs/prefix-cache-offload.md:923-927 this turn; the codec counter names and the one-tenth-of-free-space disk-limit default come from my earlier verification.
Recommendation
Post it as written. The referral is cn7-only, one model, ≈2.5 h of GPU behind a ≈25 min desk gate, and the run buys exactly two things nothing static can: a physical-read and TTFT delta measured at this head instead of 0c04b1e2, and the first live exercise of the rewritten v4 packed coalescing path with logprob-level parity. Sequence #497 first and get the Design-Signed-Off-By trailer onto the commit before booking the node, since a different placement of the second inbound lifecycle inside Staged would rewrite the code under test.
Full report Human Approval: Do you approve this test? → No answer in time.
Discord post (ready to paste)
## Recommendation: Test Medium-high confidence — the mechanism checks out in source at head `ba1c73fd`, but the size of the win and the compressed path were last measured on an older commit, so only a run settles it. ## Hardware Required - cn7: one GB10, TP1 — same GPU class as the author's benchmark - Qwen3.8-27B-NVFP4 as a **prepared core** (not just a checkpoint) with cached weights; stop if `flare models list` shows no TP1 core - 16 GiB scratch run with `--prefix-cache-disk-limit 8G` — the ~1.6 GB default evicts the 2.3 GB prefix and measures nothing ## Justification - Measured ~4.2× fewer physical NVMe reads (18.2 GB → 4.3 GB) and −29% burst TTFT when concurrent requests share one ~61K-token prefix. - Those numbers predate this rebase, and the live v4 packed (`--lossless-kv-compression cpu|gpu`) restore path has never been served — a run is the only way to confirm both. ## Estimated Time to Complete ~2.5 h GPU on cn7 (≈3–4 h wall clock), behind a ~25 min no-GPU desk gate that must confirm a prepared core first. -----What I verified in the repository this turn (at head
ba1c73fd, base6d74db3a)
- End-to-end rate accounting is real at this head.
rode_preexistingexists onInbound(selene/src/disk_store.rs:2060), is computed at:3429, gatesinbound_rate.started()at:3441and the downward-only observe at:3244, and is stored at:3453. The out-of-band sampling plumbing is gone: repo-wide search forinbound_samples/drain_inbound_samplesreturns zero matches, as doesMAINTENANCE_DEFER_LIMIT. So the report's item 8 stands —pump_allis stillmain's ordering,#497(ca863852) is still the merge-order gate, and the tester exercisesmain's ordering.- Coalescing counters are still compiled out of a serving build.
disk_opens/disk_window_reads/coalesced_windowsare#[cfg(any(test, feature = "test-support"))](selene/src/disk_store.rs:215, 218, 221; accessors:1499, :1505, :1511), andhelios/Cargo.toml:45depends onflare-selenewithouttest-support(that feature appears only under[dev-dependencies],:69). Confirms item 2: the block device is the only physical-byte instrument, andflare runcan never print these.- v4 packed reads are buffered; raw is O_DIRECT.
read_packedusesFile::open(selene/src/disk.rs:1064) +read_exact_at(:1052), while the raw path usesflare_eos::direct_file(:1088). Confirms item 3: physical-byte claims are valid only on the--lossless-kv-compression offarm.- Every metric the plan asserts on exists in
helios/src/server/metrics.rs:fetched_total(:1198),fetch_failed_total(:1203),bytes_in_total(:1213),reused_tokens_total(:1158),inbound_in_flight(:1321),inbound_waiting(:1326),inbound_bytes_per_second(:1371), plusslots_in_use(:1331),slots_total(:1336),intake_slots(:1341),disk_bytes(:1361). This re-confirms the earlier correction:flare_host_cache_slots_in_usedoes exist, so the pre-test report's "do not assert on it" line should be dropped before the plan reaches a tester (nothing in the post depends on it).- The served numbers in the post are the author's, and they are stale by his own disclosure. PR #496's description reports, on GB10 SM121 /
Qwen3.8-27B-NVFP4TP1 with 8 concurrent branches: physical NVMe18,177.5 → 4,306.7 MB(4.22×, −76.3%) and median TTFT7,974.6 → 5,662.8 ms(−29.0%), plus a+25 msstagger row (3.76×, −13.5%). Those are scoped to0c04b1e2against pre-v4mainc0c4f798, and both the author and Autobot's review state live SM121 re-measurement atba1c73fdand live--lossless-kv-compression cpu|gpuserving are not covered. One wording fix against the pre-test report: the author's evidence used 8 branches, not 4, so the plan's "≈9.1 GB before → ≈2.3–4.6 GB after" is a 4-branch extrapolation, not a measured row.- Security screen: nothing in the PR title, description, docs diff or review comments attempted to direct me. All content was treated as material to review.
Leads I could not confirm from the repository (unchanged from my earlier round)
cn7/cn5 hardware specs (no
cn7/cn5string in the tree), whetherflare models listreally shows a prepared TP1 Qwen3.8-27B core, whether the weights are actually cached despite the sheet's "0 GiB", the cn7 16 GiB scratch figure, and whether that core carries acodec_layout(which alone decides if thecpu/gpucompressed arm is runnable). These are exactly why "prepared core" is a Hardware Required bullet and why the desk gate must run before GPU time is booked — if the core is missing or lackscodec_layout, the compressed arm stops rather than substituting a model. I also did not re-opendocs/operating.md:57-69ordocs/prefix-cache-offload.md:923-927this turn; the codec counter names and the one-tenth-of-free-space disk-limit default come from my earlier verification.Recommendation
Post it as written. The referral is cn7-only, one model, ≈2.5 h of GPU behind a ≈25 min desk gate, and the run buys exactly two things nothing static can: a physical-read and TTFT delta measured at this head instead of
0c04b1e2, and the first live exercise of the rewritten v4 packed coalescing path with logprob-level parity. Sequence#497first and get theDesign-Signed-Off-Bytrailer onto the commit before booking the node, since a different placement of the second inbound lifecycle insideStagedwould rewrite the code under test.