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.