Hardware test plan for PR #607 (selene / selene-manager / helios pool + offload fixes)
Bottom line first
- 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::expiredchangingtake_while→filterscans the whole tick order once every 60 s when--prefix-cache-max-ageis 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. - Only one machine is usable: cn7 (1× GB10, SM121, arm64, 60 GiB unified RAM, 16 GiB scratch). cn5 is Offline.
- 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)
- Rust 1.88+,
protoc, CMake,.venvsynced (AGENTS.md:294-328). /dev/shmmust hold--memory + --stagingfor every manager; give it ≥4 GiB (containers:--shm-size=4g,selene-manager/docs/qualification.md:49-57).export FLARE_OFFLOAD_TEST_DIR=$SCRATCH/offloadon a direct-I/O local filesystem (O_DIRECT is required; tests skip silently otherwise — a silent skip must be reported as an unrun check,AGENTS.md:306).- Fetch templates once, or the Helios run fails rather than skips:
python tests/frontend/prepare_templates.py (not opened) --output $SCRATCH/templates --recipe qwen38 --recipe glm53;export FLARE_TEST_TEMPLATE_DIR=$SCRATCH/templates.
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):
- Correctness/hit path: ask P (long), ask P again → identical answer,
flare_host_cache_stored_totalandfetched_totalincrease,fetch_failed_total == 0,flare_cache_reused_tokens_totalgrows >32000. - 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). - Claim-vs-release ordering (fix 1): during a restore of a large prefix,
kill -STOPthe 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 andselene_pool_quarantined_bytesreturns 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, andflare_host_cache_fetch_failed_total > 0— any of those is a hard fail. - Staging-slot release (fix 3a): with the flare process started, break the data path (
iptables/ncblackhole on 9201, or SIGSTOP the manager's data listener thread viakill -STOPon the manager). The claim should expire withNO_PROGRESSafter the 3 s progress timeout, and the client must keep serving (fall back to prefill) with nostaging slot ... released twicedebug assertion and no restart loop. Repeat 5× to catch the race. - 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_entriesstable,top -H -p <mgr>≈0%) across a 100+ prompt sweep. Report as "no evidence of manager spin", not as positive proof. - 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) whilefetch_failed_total == 0. This is the one place where thefilter-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. Worker::parkstale-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; assertflare_host_cache_hits_total/reused_tokens_totalbehave 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 aChainGap/failed restore burst). Log theflare_host_cache_lookups_totalvshits_totalratio 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):
- Multi-rank HIL for fix 3b and 4b:
ignition export qwen3.8-27b --ranks 2(or GLM TP2) thenflare run CORE --gpus 0,1 --prefix-cache-pool unix:...plus a second rank process; assertselene_pool_channel_*and, crucially, that a linked multi-process put commits (selene_put_links_total{parent="linked"}increases,selene_puts_total{outcome="error"}flat, zeroput_commit ... missing page checksumfailures). Pre-fix, every linked multi-process put failed here — this is the single cheapest A/B proof of fix 4b. - Peer-DMA gating (3b): with TP2 attached, cancel a restore mid-flight and confirm no
WindowReleasedis emitted before the peer rank reports done — observable as no client-side page-checksum mismatch and noselene_pool_quarantined_bytesleak. - Cross-host data channel (the untested half of the PR's limitations): cn5 manager + cn7 client, or two Sparks (
docs/multi-host.md(not opened)), with--rdmaif the ConnectX-7 ports are cabled, else TCP.
Pass/fail criteria (put these in the test record)
- PASS: steps 1–3 green with zero skipped tests; step 5 green; step 6 scenarios 1, 2, 4, 6, 7 as specified; no manager panic, no
debug_assert"released twice",selene_pool_quarantined_bytesreturns to 0,fetch_failed_totalreturns to 0 when no record is corrupt. - FAIL (block merge): any manager panic/UAF symptom in step 6.3/6.4, any page-checksum mismatch reported by the client during a data-channel claim, a linked multi-process put error in step 7, or a staging slot released twice.
- KNOWN, not a #607 regression:
a_record_put_into_a_manager_on_another_host_is_restored_over_tcptiming flake;flare/Cargo.toml (not opened) --lockedlocal lockfile mismatch fordeepseek-recipe(unmodified in this PR). - Record these two review caveats as observed behaviour while you are there (they are the PR's own "Should Fix" items and hardware can confirm or refute them cheaply):
claims.rs:1513-1516returnsOk(())before the twoErr(Violation)checks at:1517-1529, so on the untrusted gRPC entry point a channel claim bypasses window/phase validation. In step 6, after a client disconnect, checkselene's log for strayWindowReleasedhandling — if a malformed release is silently accepted it will appear as a no-op; that is the expected (deliberate) behaviour, so do not fail it, but do note whether the manager ever logged aViolationfor a channel claim (expected: never).composite.rs:1130-1132quarantines on anyis_record_read()error, including transientEMFILE/EIO. Test it: with a healthy disk record resident, run the server under a lowulimit -nor with a temporarily unreadable record file, then restore the condition and re-ask. Expected comfortable result: the record is quarantined and recomputed (cache miss), not wrong data. If descendants stay hidden until recapture (checkflare_host_cache_fetch_failed_totalstays >0 for that ancestor after the condition clears), that confirms the reviewer's concern — record it as a follow-up, not a blocker.
Risk / waste avoidance
- Do not run cn7 steps 5–7 before steps 1–3 pass: the unit tests are the real gate for 7 of 8 behaviours and cost no GPU time.
- Do not attempt multi-rank anything on cn7 (single GPU) and do not attempt
tests/server/test_cache_memory.pythere. - Do not run
qualify/host_cache.py(not opened) orqualify/multihost_cache.py(not opened): they are referenced by the docs (docs/prefix-cache-offload.md:1515-1560) but are not present in this tree, so that documented qualification path is unavailable; note it as a doc/coverage gap. - Reuse the single exported core for steps 5, 6 and 7-type runs; exporting is the dominant cost.
- One job on cn7 can host the manager + server + pytest concurrently (10 CPUs is enough); pin
--gpus 0everywhere so nothing contends.