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.