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

Raw Markdown for agents: https://autobot.eidonix.com/p/3fc9cf95-658b-4c9e-866f-cf55659a49bb.md

Hardware test plan for PR #607 (selene / selene-manager / helios pool + offload fixes)

Bottom line first

  1. There is no speedup to measure. PR #607's own description claims only correctness, memory-safety, remote-DoS and state-corruption fixes ("Claimed benefit and result", PR #607) — no latency, throughput or memory number appears anywhere in the diff or description. The final review's only perf-adjacent note is a cost: Index::expired changing take_while→filter scans the whole tick order once every 60 s when --prefix-cache-max-age is enabled (off by default). So the objective for hardware is no-regression + real-path validation, not speedup measurement. Treat any "speedup" ask as out of scope for this PR; do not spend GPU time on A/B timing runs.
  2. Only one machine is usable: cn7 (1× GB10, SM121, arm64, 60 GiB unified RAM, 16 GiB scratch). cn5 is Offline.
  3. cn7 can genuinely validate 7 of the 8 behaviours; 3 cannot be reached on one GPU and must be deferred to cn5 (4 GPUs) or two Sparks. The single most valuable thing cn7 can do — and the thing the PR explicitly did not run — is drive the data-channel (DATA_CHANNEL) path against a real manager and real GPU bytes, because that is the only path that reaches the remote staging UAF fix.

What each fix needs, and whether cn7 can reach it

# Fix (PR head 4f12cae) Needed to exercise it cn7?
1 claims.rs:1513-1516 remote data-channel staging UAF guard Manager with --listen/--listen-data; client on TCP address so mode=DATA_CHANNEL (agent.rs:726-730, requester.rs:273-277) Yes — same host, loopback TCP works (selene-manager/docs/network-operations.md:3-15,61-89)
2 mod.rs:113-117 + index.rs:171-227 (not opened) zero/self-parent chain CPU DoS Manager-side index walk; any attached client, TCP or unix Yes
3a agent.rs:1561-1565 staging-slot double release on failed channel.send Data-channel client with a deliberately broken data connection Yes (TCP + kill/blackhole of the data port)
3b requester.rs:1177 withdraw_queued gating on peers_left Multi-rank: Peers/rank agents with shared windows No — needs ≥2 GPUs (one rank per GPU, docs/model-preparation.md:468-470)
4a store_bridge.rs:122-126 monotonic transfer IDs Manager store bridge, concurrent puts/gets with colliding client IDs Yes (single-rank put/get is enough to catch cross-cancel)
4b linked multi-process put first_page (store_bridge.rs:643-647) Multi-rank linked put (mp.whole indexed by record page, store_bridge.rs:861-884) No — deferred to cn5
5 helios/src/server/runtime.rs:2114-2121 stale pool plan on Worker::park Helios worker parked after a pool lookup, then re-admitted Yes (TP1 pool-attached server, long continuation)
6a memory.rs:2344-2349 deferred child wake after async CPU-codec row refill --lossless-kv-compression cpu + a child checkpoint published while the parent's row is refilling Yes
6b composite.rs:1125-1134 quarantine of unreadable unpacked v1/v2/v3 disk ancestor --prefix-cache-memory + --prefix-cache-disk, then corrupt a .ckpt Yes
6c shared/index.rs:503-511 (not opened) expiry sweep past a fresh leaf (#439) --prefix-cache-max-age enabled Yes

Two files (selene/src/composite.rs, memory.rs) and all of selene-manager's fixes are already covered by CPU unit tests on a copier that never touches a device; the hardware value is proving them through the real CUDA transfer threads and the real manager protocol.


Test plan (in priority order; GPU time is only used from step 5 on)

All paths assume the repo root on cn7, scratch on the 16 GiB volume ($SCRATCH), and $T=flare-cli/target.

Step 0 — Environment gates (no GPU, ~2 min)

Step 1 — PR's own 11 regression tests, exact commands (CPU, ~5 min)

cargo test --locked --release --manifest-path selene/Cargo.toml (not opened) \
  --features test-support --target-dir $T --lib -- \
  failed_channel_send_releases_staging_slot_once \
  withdraw_queued_waits_for_peer_dma_before_releasing_window \
  async_cpu_codec_refill_wakes_deferred_child \
  corrupt_ancestor_v3_page_is_quarantined_and_replaceable \
  expired_sweep_skips_leaf_refreshed_without_new_tick

cargo test --locked --release --manifest-path selene-manager/Cargo.toml \
  --features test-support --target-dir $T --lib -- \
  window_released_from_channel_requester_does_not_drop_extent \
  entry_from_rejects_self_parent_and_non_monotonic_parent \
  walk_chain_rejects_self_parent_cycles_and_zero_page_chains_beyond_max_nodes \
  put_and_get_with_same_client_id_use_disjoint_store_transfers \
  linked_multi_process_put_stores_record_relative_window_first_page

cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) \
  --features runtime-core,server --target-dir $T --lib -- \
  worker_park_clears_stale_pool_plan_and_lookup

Pass = 11 passed, 0 failed, and 0 skipped (report any ignored/early-return: corrupt_ancestor_v3_page_is_quarantined_and_replaceable returns early when test_directory yields no O_DIRECT directory).

Step 2 — Full crate suites, arm64 build correctness (CPU, ~30–45 min)

for crate in selene selene-manager; do
  cargo test --locked --release --manifest-path $crate/Cargo.toml (not opened) --features test-support        --target-dir $T
  cargo test --locked --release --manifest-path $crate/Cargo.toml (not opened) --features test-support,rdma   --target-dir $T
done

Run selene first: selene-manager/tests/rank_processes.rs (not opened) launches $T/release/examples/rank_node, produced only by the selene test build (selene-manager/docs/qualification.md:43-47). This is also the only cn7-reachable exercise of the real multi-rank SIGKILL paths (rank_processes: quarantine until process exit, peer drain after rank zero dies) — it uses real processes, so it partly compensates for the missing multi-GPU HIL for fix 3b. Expected: selene 510+, selene-manager 185 lib + 11 integration binaries. Known pre-existing flake, do not attribute to #607: client::a_record_put_into_a_manager_on_another_host_is_restored_over_tcp races the 10 ms Core::tick() metric refresh (PR description; also disclosed in the PR). The rdma builds add pool_channel::over_rdma::{r1,r2} — they need libibverbs and an active RDMA port; on GB10 use Soft-RoCE (sudo modprobe rdma_rxe; sudo rdma link add rxe0 type rxe netdev <eth>, docs/network-operations.md:130-136) or skip and record as unrun. RDMA is explicitly not a correctness gate (qualification.md:54-57).

Step 3 — Helios library suite on SM121 (CPU + locked memory, ~20 min)

sudo prlimit --pid $$ --memlock=67108864:67108864
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) \
  --features runtime-core,server --target-dir $T --lib -- server::runtime

Expect 133 passed / 1 ignored (PR evidence). This is the arm64/SM121 compile-and-logic gate for fix 5 that the PR only ran on x86_64.

Step 4 — Export one TP1 core on cn7 (GPU, ~10–20 min, one-time)

SM121 is mandatory: an SM120 core is refused by the architecture check (docs/model-preparation.md:475-478). Use nvidia/Qwen3.8-27B-NVFP4 (on the box, native ARM64 serving qualified on RTX Spark, docs/windows.md:179-183 (not opened)) or nvidia/GLM-5.3-Flash-FP4-Local:

.venv/bin/ignition export qwen3.8-27b --gpus 0    # writes a core into the model cache
flare-cli/target/release/flare models list --json   # locate the core path
export CORE=<path>; export CUDA_VISIBLE_DEVICES=0 FLARE_OFFLOAD_TEST_CORE=$CORE

Budget note: GB10 shares DRAM with the CPU (60 GiB total). Keep the core small (27B NVFP4 TP1), set [memory] reserve = "4G", and use modest --prefix-cache-memory/--prefix-cache-disk-limit (1 GiB / 8 GiB). Skip tests/server/test_cache_memory.py — it requires ≥4 concurrent requests with 130,000 output tokens reserved each and will OOM/thrash on 60 GiB. Do not substitute a pre-existing core unless it is SM121.

Step 5 — Real GPU offload regressions (GPU, ~15 min)

CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 FLARE_OFFLOAD_TEST_CORE=$CORE \
  .venv/bin/python -m pytest tests/server/test_prefix_cache_offload.py -q --basetemp $SCRATCH/http

Covers fixes 6b/6c end-to-end on real bytes: memory/disk/composite hit + restart, and the corrupt-record case (test_prefix_cache_offload.py:175-190, expects flare_host_cache_fetch_failed_total > 0, fetched_total == 0, one init launch, zero restore launches, then a correct recomputed answer) — that is exactly the behaviour composite.rs quarantine must produce. Pass = green with no skipped tests. Optional (same GPU window, +10 min): CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 FLARE_OFFLOAD_TEST_CORE=$CORE FLARE_OFFLOAD_TEST_DIR=$SCRATCH/offload cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server --target-dir $T offload:: -- --ignored --test-threads=1 (each test loads the whole core; ~6 tests; keep the limit so core_geometry_lists_every_plane runs).

Step 6 — Pool over TCP = data channel: the highest-value HIL step (GPU, ~20–25 min)

This is the only cn7-reachable path through the UAF fix, and the PR never ran it (FLARE_RUN_CUDA_TESTS=1 undisclosed unrun).

# 1. manager, TCP only => attached sessions have NO shared memory => DATA_CHANNEL
selene-manager/target/release/selene --name pool \
  --root $SCRATCH/selene-root --memory 2G --nvme 4G --staging 512M \
  --listen 127.0.0.1:9200 --listen-data 127.0.0.1:9201 \
  --metrics 127.0.0.1:9108            # expect: "selene: warning: network listening enabled ... (plaintext, data on 127.0.0.1:9201)"

# 2. server attached to it over TCP
flare-cli/target/release/flare run $CORE --gpus 0 --port 8080 \
  --prefix-cache-pool 127.0.0.1:9200 --prefix-cache-memory 1G --prefix-cache-disk $SCRATCH/rec --prefix-cache-disk-limit 8G

Scenarios (each ~3–5 min, use a ≥32k-token prompt from tests/server/test_prefix_cache_offload.py:111-114 and 24+ distinct prompts to force evictions):

  1. Correctness/hit path: ask P (long), ask P again → identical answer, flare_host_cache_stored_total and fetched_total increase, fetch_failed_total == 0, flare_cache_reused_tokens_total grows >32000.
  2. Put path over the channel: manager metrics selene_puts_total{outcome="ok"} increases, {outcome="error"} flat; selene_pool_channel_windows_total{carrier="stream"} and _channel_bytes_total{carrier="stream"} increase (proof bytes really moved on the data channel, not via SHM — core.rs:1012-1019).
  3. Claim-vs-release ordering (fix 1): during a restore of a large prefix, kill -STOP the manager's data listener path is overkill; instead SIGKILL the flare process mid-restore. Then restart and repeat. Assert the manager logs no panic/UB and selene_pool_quarantined_bytes returns to 0 after the handler exits (docs/network-operations.md:76-80,145). The pre-fix failure mode (extent dropped while the handler read it) shows up as a manager panic or a page-checksum mismatch reported by the client, and flare_host_cache_fetch_failed_total > 0 — any of those is a hard fail.
  4. Staging-slot release (fix 3a): with the flare process started, break the data path (iptables/nc blackhole on 9201, or SIGSTOP the manager's data listener thread via kill -STOP on the manager). The claim should expire with NO_PROGRESS after the 3 s progress timeout, and the client must keep serving (fall back to prefill) with no staging slot ... released twice debug assertion and no restart loop. Repeat 5× to catch the race.
  5. Chain-walk DoS (fix 2): hardest to trigger from a well-behaved client; the unit test is the real gate. Cheap HIL proxy: after warm-up, assert the manager's CPU stays idle (selene_pool_index_entries stable, top -H -p <mgr> ≈0%) across a 100+ prompt sweep. Report as "no evidence of manager spin", not as positive proof.
  6. Expiry sweep (#439, fix 6c): run the server with --prefix-cache-max-age=60s; store ≥3 prompts, wait >60 s, keep re-asking one prompt so leaves stay fresh, then assert older records still expire (flare_host_cache_expired_total > 0) while fetch_failed_total == 0. This is the one place where the filter-scan cost is paid: record request latency before/after with max-age on vs off — expect no measurable change at 3–10 records; that is the no-regression check, not a speedup claim.
  7. Worker::park stale-plan (fix 5): with the pool attached, run a long generation (max_tokens near the configured limit) that forces the worker to park and be re-admitted; assert flare_host_cache_hits_total/reused_tokens_total behave monotonically and no restore targets a shorter prefix than the parked prompt (a stale plan shows as a restore whose reused-token count is below the pre-park prompt length, or a ChainGap/failed restore burst). Log the flare_host_cache_lookups_total vs hits_total ratio for the record.

Total GPU time on cn7: ≈ 60–75 min, dominated by step 4 (export) and step 6.

Step 7 — Deferred to cn5 when it returns (must be listed as an unrun check until then)

Run on 4× RTX PRO 6000 in one job (48 CPUs / 125 GiB is plenty; 16 GiB scratch is tight — put record dirs on the scratch volume and keep --nvme 4G):


Pass/fail criteria (put these in the test record)

Risk / waste avoidance