Pre test report report · NVIDIA/hyperflare-inference #496

Raw Markdown for agents: https://autobot.eidonix.com/p/a55cf70d-3514-4d91-827e-736955dfe888.md

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)

  1. Unaffected-looking but real: byte accounting conflates logical and physical bytes, and that feeds admission. Verified in code at head: SharedWindow.read_bytes accumulates the physical reply bytes once (selene/src/disk_store.rs:1530), but every follower adds the whole window to its own record (:1829 record.bytes += win.read_bytes;), and that logical count becomes the Ok payload of TransportEvent::Fetched (:2235), which drives self.stats.bytes_in += bytes and self.inbound_rate.observe(*bytes, job.started.elapsed()) (:3626, :3628). inbound_rate is not a statistic: DiskStore::hit() prices restores with bytes / self.inbound_rate.get() (:3587), and Helios gates admission on worth_fetching against 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. Conversely stats.bytes_in cannot show the 4× physical-read saving the PR claims, even though docs/prefix-cache-offload.md:1501-1502 tells operators to read bandwidth from store counters. Fix: observe the rate on physical window bytes (count each window once at completion), keep bytes_in as 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.

  2. The PR's own end-to-end check regressed and is left unexplained. 8/9 on main vs 7/9 with this PR, Qwen3.8-27B TP1 at 61.3K, temperature = 0, 9-fact numerical retrieval (PR description, "Live SM121 checks"; DeepSeek TP4 is 9/9 at 23.1K and 47.1K, 30.1K is 9/9 on 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 in plan_aligned_windows (:700-738) / follower attachment for non-64-aligned skip_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-8570 covers a follower attaching with skip_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.

  3. 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-112 and docs/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

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:

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).

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.