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

Raw Markdown for agents: https://autobot.eidonix.com/p/664e22d4-ba75-4a06-9f50-0df67628d312.md

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)

  1. Rate accounting is end-to-end again. Inbound now carries read_nodes, logical_bytes = layout.record_bytes(chain.pages), started and rode_preexisting (selene/src/disk_store.rs:2044-2060, computed at :3422-3446); apply observes (job.logical_bytes, job.started.elapsed()) only when !rode_preexisting or when the measured throughput is slower than the current estimate (:3244-3251). The out-of-band drain_inbound_samples plumbing is gone. Consequence for the test: flare_host_cache_inbound_bytes_per_second is once again a whole-restore rate in uncompressed checkpoint bytes, and a fast coalesced follower deliberately does not raise it.
  2. The coalescing counters are compiled out of a serving build. disk_opens / disk_window_reads / coalesced_windows are #[cfg(any(test, feature = "test-support"))] (selene/src/disk_store.rs:214-222, 1498-1514), and helios depends on flare-selene without test-support (helios/Cargo.toml:45; test-support appears only under [dev-dependencies] at :69). So flare run can never report them, and no /metrics gauge 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.
  3. v4 packed reads are buffered, so they cannot be priced in physical NVMe bytes. disk::Worker::open uses File::open for packed records (selene/src/disk.rs:1063-1086) and read_packed uses read_exact_at (:1037-1056) — page-cache hits report RAM-copy speeds. Raw v1–v3 goes through flare_eos::direct_file (O_DIRECT, :1088). So: measure physical bytes only on the --lossless-kv-compression off arm; the compressed arms are for correctness, failure isolation and wall-clock latency.
  4. The compressed path really does produce v4 packed records on disk, so the compressed arm is the only live exercise of shared ReadPacked windows. start_outbound sets packed = true for a device capture when codec_enabled() and fits_units(...) (selene/src/disk_store.rs:1722-1727), where codec_enabled() is transfers.codec_profile().is_some() (:250). Good news for the tester: this is testable — provided the core was exported with a codec layout.
  5. cpu/gpu need an exported core capability, and this is a hard gate. cpu|gpu requires contract.cache.codec_layout or startup fails with "the core was exported without a codec layout" (helios/src/runtime_core/memory.rs:638-642); gpu additionally requires an embedded gpu_module cubin or fails with "use --lossless-kv-compression cpu or re-export" (helios/src/runtime_core/model.rs:626-632). codec_layout is declared only by the (external) recipe via ignition/preparation/contract.py:117-135. flare inspect CORE --all --json prints the raw contract under contract (helios/src/runtime_core/describe.rs:184-185), so this is a one-command pre-check. If the cn7 core has no codec_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.
  6. Correctness assertions must be logprob-level, not byte-identical text. Greedy decoding is unsupported: temperature=0 is rejected (helios/src/model.rs:230-233). Compare FP32 top-5 logprobs and token ids at a fixed seed (seed is a request field), which requires the core to advertise max_top_logprobs != 0 (helios/src/server/models.rs:88 (not opened); surfaced in the /v1/models flare block).
  7. 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.
  8. pump_all at this head is still main's order (maintenance → outbound → host_inbound → device_inbound); MAINTENANCE_DEFER_LIMIT exists only in #497 (ca863852, still open, and it says merge #497 first). So the tester exercises main's ordering, not the post-#497 shipping order — worth one line in the result and not a reason to test both.
  9. 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_use does exist (:1331) — my earlier "do not assert on it" was wrong.
  10. 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 intake 2 * max_active * row_slots + 2*64 (selene/src/offload.rs:175-177). A 4-branch burst is comfortably inside RECORDS_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)


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.

  1. Gates above.
  2. 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.
  3. Re-run the regression benchmark on the target CPU, because that is what @yatesdr actually 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 the packed_poll_bench lines for TP1/512, TP8/512, TP8/1024 at fetches=1 and fetches=8. The assertion is only mean_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 at fetches=8; anything in that order of magnitude at this head is a fail even with a green test. Also record the printed packed_demand_pass µs (26–40 µs on x86_64) — that one is never asserted.
  4. Build the A/B baseline from current main (99339606 or later), not c0c4f798, so the baseline includes #504.
  5. One free command that validates the #504 boundary the port must preserve: flare run with --lossless-kv-compression cpu against 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)

  1. 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 run so VRAM is cold. Kept once per arm; the record directory persists across restarts.
  2. Send 4 concurrent /v1/chat/completions follow-ups that all chain through the shared parent. Three trials per arm, interleaved (head, main, head, main, head, main) to cancel drift.
  3. Measure per trial:
    • Physical NVMe: /sys/block/<cache-dev>/stat field 3 (sectors read) × 512 delta across the restore window, or /proc/diskstats equivalents. Valid on this arm because raw records are O_DIRECT.
    • Burst median TTFT (ingress → first token), same definition as the PR table.
    • /metrics deltas: flare_host_cache_fetched_total == 4, _fetch_failed_total == 0, _reused_tokens_total ≫ prefix size, and after drain _inbound_in_flight == 0 and _inbound_waiting == 0.
  4. 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.
  5. 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.

  1. 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 .ckpt files (packed records were actually written — item 4 above); if the scan still shows raw records, the arm is not exercising ReadPacked and the test is meaningless.
  2. 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_total grows by the compressed payload per fetch while _inbound_bytes_per_second stays a plausible whole-restore rate.
  3. 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.
  4. Do not measure physical NVMe bytes here (item 3: buffered reads). Do record burst TTFT for information only, without binding a claim to it.
  5. 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_flight returns to 0 — this is the packed-window refcount path under overlap.
  6. 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)


Do not spend GPU time on

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)

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.