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

Raw Markdown for agents: https://autobot.eidonix.com/p/b61740c5-665b-46f6-80aa-a3ec2ca3e725.md

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

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)

Still open, worth fixing before the same pass (none testable on hardware)

  1. Rate sample rides the cross-rank event enum. TransportEvent::InboundWindowSample (pr/496:97-101) carries no JobId in an enum documented as "Completion the transport reports" (:83); it forces unreachable!() in Kind::of (shard.rs:476-478) upheld by two hand-written guards (shard.rs:722-725, :1148-1150), and CompositeStore::poll bumps stats.progress for it (composite.rs:1376) ahead of the maintenance gate (:1418-1428), re-arming spill+maintain per physical window. Move it to a Staged drain method or a field on Fetched.
  2. HeaderIdentity's hand-written Hash mirrors PartialEq owned 1,200 lines away in another module. Implement Hash beside the equality (or hash PrefixKey + a discriminator) and add an a == b ⇒ hash(a) == hash(b) test. Now doubly relevant: packed already exists on main.
  3. pick_next_pending_plan restates Layout::record_slots (pr/496:1767-1777 vs geometry.rs (not opened):180-182) and takes the transfers lock per candidate; hoist the lock and call the helper.
  4. §2.4 doc bullet (docs:333-366) packs ~12 behaviours into one paragraph and repeats the metrics contract from §4 (:1528-1531).
  5. Maintainer sign-off on a second reference-counted inbound lifecycle inside Staged rather than DiskThread is still unrecorded — process item, not a test item, but a merge precondition per AGENTS.md (not opened):201-206.
  6. Test fragility: staggered_arrival_attaches_out_of_order_to_in_flight_windows asserts an exact total disk_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):

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

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.