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.