Hardware test plan — PR #734 (selene: parallelize startup disk scan), head b7bd3fa9
0. What I verified before writing the plan
The review stack is consistent and the PR is at "Ready To Merge / Decision to Test: yes". The changed code and the instrumentation I rely on below are all present at the PR head:
- Change surface:
par_map(selene/src/shared/record.rs:1118-1171, threshold 64, chunk 8,MAX_SCAN_WORKERS = 16,available_parallelism()driven),record::scan(:1189-1260),input::Worker::scan(selene/src/input.rs:514-587).Header::read_metadatais back tomain's tworead_exact(record.rs:358-373) — so there is no read-coalescing claim left to test, only parallelism, fail-closed deletion ordering, and lexicographic.inputadmission. - The timed surface already ships; no instrumentation work is needed:
- phase
"Prepare host prefix cache"is created athelios/src/runtime_core/model.rs:1121and finished at:1167with the store summary as detail; timings.disk_scanwrapsrecord::scanatselene/src/offload.rs:750-765, andInputStore::start_boundedruns immediately after at:767-776(inside the phase, outsidedisk_scan);- the summary renders as
disk <dir> (limit …, <N> records, staged, scan <x.x>s)—selene/src/offload.rs:469-483withelapsed_seconds={:.1}s(:488-490). Note the 0.1 s resolution: warm scans (0.05 s) are below it, so warm must be measured from the phase wall time, not the printedscan. - Non-TTY stderr prints one line per phase ending in
… Prepare host prefix cache. <detail> <elapsed>x.xs(helios/src/startup.rs:414-465), so a boot log is a complete record; the phase prints[ PENDING ]only while running.
- phase
- Counters to prove the scan saw the dataset:
flare_host_cache_disk_recordsandflare_input_cache_disk_records(helios/src/server/metrics.rs:40, 663-670, 1405-1415). - Relevant flags exist as claimed:
--prefix-cache-disk,--prefix-cache-disk-limit,--prefix-cache-memory,--lossless-kv-compression,--prefix-cache-drain-on-shutdown(flare-cli/src/cli.rs:1060-1088),--gpus,--host/--port(:767, 782-792). - Docs rule I am respecting: benchmarks must be
flare runon an exported core, notignition debug-serve(docs/performance-work.md:9-13,docs/design-review.md:106-115).
Two facts that shape the plan:
- This code path never touches a GPU. It runs during startup directory inspection, before serving. GPU time is only spent on model load that both arms pay identically. So the whole mechanism, the two behaviour changes, and the scaling claim can be validated on CPU only — the GPU is needed for exactly one end-to-end confirmation pair.
- The exported core is arm-independent. It is produced by
ignitionfrom the model, and the namespace directory name comes from core/config identity+fingerprint (selene/src/offload.rs:642-657, 645), not from the changed code. Export once and reuse for both arms — this is the single biggest GPU-time saving (two builds, one export, one seeded dataset).
1. Hardware assignment
| Test | Machine | Why | GPU used |
|---|---|---|---|
| T1 correctness suites | cn5 (48 CPUs, x86_64) and cn7 (arm64) | both arches must compile/pass; 0o000 fail-closed tests must actually run (need non-root) |
none |
| T2 component A/B + ablation | cn5 (48 CPUs) | reproduces the .ckpt scaling claim on a many-core x86_64 host, and closes the PR's own disclosed gap: its x86_64 warm .input numbers came from WSL2, never bare metal. Also exercises available_parallelism≫16 → worker cap behavior |
none |
| T2b worker-cap ablation | cn7 via taskset |
cn7 gives a job 10 CPUs, so workers = min(10,16,chunks); taskset -c 0-3 lowers it further. Confirms the 64/8/16 tuning curve the PR claims is a trade-off, and tests the <64 candidates serial path |
none |
T3 end-to-end flare run A/B (cold+warm) |
cn7 (GB10, SM121, integrated memory, NVMe) | the architecture the PR measured (20-core Grace); cn7 is 10 CPUs, so this is also a capacity-sensitivity check: expect a smaller speedup, and a null result here is itself a finding | 1 (of 1) |
T4 (optional) flare run A/B on x86_64 |
cn5, --gpus 0 only |
second arch for the served number; leave GPUs 1-3 free | 1 |
Model choice (smallest first, to bound RAM and export time):
- cn7:
google/gemma-4-E4B-it(smallest) ornvidia/Qwen3.8-27B-NVFP4;gemma-4-26B-A4B-itas a third option.dbg: gemma4is a supported recipe (docs/api.md:961(not opened)). Use an image-capable model (gemma4) if you wantflare_input_cache_disk_records> 0 —InputStoreis only started wheninput_staging != 0(selene/src/offload.rs:767-776), which is text-only zero for pure text cores. - cn5:
nvidia/GLM-5.3-Flash-NVFP4(glm53recipe) with--gpus 0.facebook/dinov2-baseandtimm/vit_base_patch14_dinov2.lvd142mare notflare runtargets — do not use them. - Precondition (confirm before booking time): all model rows list
0 GiB. Verify actual weight bytes on disk (du -shon the hub cache) and thatignition exportcan run in the job's 60 GiB (cn7) / 125 GiB (cn5) RAM. If weights are absent and cannot be fetched in-job, skip T3/T4 and deliver T1/T2 — they cover the change (see §6).
2. Test plan
T1 — Correctness gate (no GPU, ~15 min, run first on both machines)
cargo test --locked --release -p selene --features test-support # expect 645 passed, 0 failed, 0 ignored
cargo test --locked --release -p selene --no-default-features --lib # expect 620 passed (rayon-free path)
cargo test --locked --release -p selene-manager --lib # expect 205 passed, 1 ignored
- Run as non-root and confirm
0 failedand0 ignoredfor the twoselenecommands: the0o000unreadable-entry tests self-skip for root (selene/src/shared/record.rs:2524-2528,selene/src/input.rs:1507-1515), and they are the only tests that actually pin the new fail-closed behaviour. - Pass: zero failures on both arches, no skip. This alone validates determinism, symlink/subdirectory/foreign-file preservation, fail-closed error-before-deletion, and deterministic
.inputadmission under a tight budget.
T2 — Component A/B and ablation (no GPU, ~45 min, cn5)
The PR's selene/examples/scan_bench.rs (not opened) is not in the branch (selene/examples/ holds only rank_node.rs (not opened)), so the engineer must recreate it. Minimal recipe (keep it out of the commit):
- Two clean trees:
git archive be4092d7(control) andgit archive b7bd3fa9(candidate). - In each:
printf '%s' "<source from the PR description <details>>" > selene/examples/scan_bench.rs(not opened),cargo build --locked --release -p selene --example scan_bench, then delete the example. - Datasets (sparse, so 16 GiB scratch is ample — only the 4 KiB header per file occupies blocks):
prep-ckpt <dir> 10000(5,000 v3 + 5,000 v4, ~70 MB logical each),prep-ckpt <dir> 2000,prep-ckpt <dir> 500,prep-input <dir> 1000(4,440 B each). - Interleaved mirrored rounds, medians: Warm = 20 rounds n=20/arm after one warm-up pass per arm. Cold = 10 rounds with
sync; echo 3 | sudo tee /proc/sys/vm/drop_cachesbefore each invocation (checksudo -n truefirst; if not permitted, see §5). - Ablation rows to reproduce (
record::scan,/= control/candidate):- 10,000
.ckpt: 2,122 → 211 ms cold (10.0x), 61 → 17 ms warm (3.7x) - 2,000: 466 → 44 cold, 16 → 5 warm; 500: 119 → 11 cold, 3.3 → 1.7 warm
InputStore::start_bounded1,000 files: cold 214 → 23 ms, warm 4.7 → 2.5 ms.inputsort ablation (3rd/4th columns):OsStr::cmpsequential (nopar_map) vsPath::cmp+par_mapvs candidate, warm. This is the row the x86_64 host has never produced natively.
- 10,000
- Pass: candidate ≥ control on every warm row (no regression), cold speedup ≥ 5x at 10,000 records, and the sequential-sort-only column within ±5% of control (i.e. sorting alone does not explain the win or a loss).
T2b — Worker-cap / threshold ablation (no GPU, 10 min, cn7)
Same harness on cn7 at 10,000 records, warm, three cell counts:
taskset -c 0-0 ./scan_bench scan-ckpt <dir> 10000 # available_parallelism()=1 -> serial path (record.rs:1130)
taskset -c 0-3 ./scan_bench scan-ckpt <dir> 10000 # 4 workers
./scan_bench scan-ckpt <dir> 10000 # 10 workers (job's CPU cap)
Plus a sub-threshold dataset of 40 records: both arms must be within noise (< 64 takes items.iter().map(f)). Record the scaling curve — this is the number the maintainer will need if MAX_SCAN_WORKERS = 16/threshold = 64 is ever revisited, and it tells you what to expect from T3 on a 10-CPU machine (roughly half of the 20-core GB10 gain).
T3 — End-to-end flare run A/B, cold and warm (cn7, 1 GPU)
- Export the core once (ignition is unchanged by this PR):
.venv/bin/ignition export gemma-4-E4B-it --gpus 0(or the 27B). Do not re-export per arm. - Build both binaries from clean archives:
cargo build --locked --release --manifest-path flare-cli/Cargo.toml(not opened) atbe4092d7and atb7bd3fa9. Keep the twoflarebinaries side by side. - Populate the namespace directory with a small prefix cache and drain, to obtain one genuine
.ckptwith the real identity/fingerprint/page_tokens/ranks from that core (PR method): one boot with--prefix-cache-disk <DIR> --prefix-cache-disk-limit 2000G --prefix-cache-drain-on-shutdown=30s, one 400-token chat request to/v1/chat/completions, SIGTERM, then read the header of the written.ckptto learn the namespace directory name and geometry. - Seed 10,000 sparse
.ckptfiles into that same namespace directory using the harvested geometry (5,000 v3 + 5,000 v4, roots survivingremove_orphansneed either a row or a child — the PR used 1,000 ten-step chains), and 1,000.inputfiles of 4,440 B.truncate-style sparse files keep real usage ≈ 10k × 4 KiB. - Verify before trusting the data: first boot must log
10000 recordsin thePrepare host prefix cachedetail and/metricsmust showflare_host_cache_disk_records 10000(+flare_input_cache_disk_records 1000on an image-capable core). If the count is 0, the seeded headers do not match the running core and were deleted as invalid — regenerate (cheap) and recheck; snapshot the filename list first so this is detectable. - Measure, n=5/arm interleaved (A,B,A,B,…), SIGTERM after
/health:Prepare host prefix cacheOK-line elapsed (this is the number that improved 2,542 → 295 ms cold, 95.6 → 53.2 ms warm on 20-core GB10 — use it for warm, sincescanprints at 0.1 s);- the
scan x.xsin the phase detail (= timings.disk_scan); - spawn →
/health200; - record counts from
/metrics; - file count in the namespace directory after shutdown (must be unchanged: 0 deletions).
- Cold arm:
sync; echo 3 | sudo tee /proc/sys/vm/drop_cachesbefore each boot (root required, see §5); otherwise report warm only.
- Pass criteria: warm phase time candidate < control with non-overlapping ranges (or ≥1.3x); cold (if runnable) ≥3x at 10 parallel workers, with the 20-core PBX-style 8.6x as the ceiling NOT the expectation on 10 CPUs; identical record counts and zero deletions in every boot;
spawn→/healthnot worse.
T4 — (optional) x86_64 served confirmation (cn5, --gpus 0)
Repeat T3 steps 5-7 with the same seeded dataset and the two binaries, one GPU only, 3 boots/arm. Purpose: a single-arch served number is enough for the charter, and cn5's 48 CPUs make the parallel path fire at the full 16-worker cap — a different operating point from cn7.
3. Time budget (GPU time is what matters)
| Step | Wall time | GPU |
|---|---|---|
| T1 both machines | 30 min | 0 |
| T2 (+builds) cn5 | 60 min | 0 |
| T2b cn7 | 15 min | 0 |
| core export (once) | 20-40 min | 1 GPU, once |
| T3: 10 warm boots + 6 cold (if allowed) | 25 min (≈90 s/boot) | 1 GPU |
| T4 optional | 15 min | 1 GPU on cn5 |
Total ≈2.5 h wall, of which < 1.5 h touches a GPU, and never more than one GPU at a time.
4. What each result proves
- T1 proves the two semantic refinements (fail-closed error-before-deletion; lexicographic
.inputadmission) and the non-following of symlinks/subdirectories behave as documented indocs/prefix-cache-offload.md:681, 1199-1204on both arches and under--no-default-features. - T2/T2b prove the mechanism: the win is parallelism (not sorting), it scales with cores, it vanishes below 64 candidates, and there is no warm regression on x86_64 bare metal (the PR's warm
.inputregression was previously "fixed" only against WSL2 numbers — that gap is now closed by cn5). - T3/T4 prove the operator-visible claim at the layer it targets (
Prepare host prefix cache), and that the scan does not delete data or reject records.
5. Pitfalls the engineer should not lose time to
- 16 GiB scratch. Do not create 650 GiB of real files: use sparse files (
truncate -s, or write only the 4 KiB header thentruncate). Logical size is whatDiskBudget/--prefix-cache-disk-limitaccounts (selene/src/offload.rs:766), so pass--prefix-cache-disk-limit 2000G— it is a number, not a free-space check, when given explicitly (default would be free/10,offload.rs:658-664). - Cold cache needs root.
drop_cachesis the only clean cold state. Ifsudois unavailable, report warm + freshly-recreated-directory numbers and say so; do not call page-cache-warm numbers "cold". - cn7 gets 10 CPUs, not 20.
available_parallelism()drives the pool (record.rs:1126-1129), so cap your expectation at ~half the quarantine GB10 speedup; a null result there is a real, reportable finding about the worker cap, not a broken build. --prefix-cache-memory 0is tempting but changes what runs. With memory 0 and disk set, intake is still allocated viaheadroom_inner(offload.rs:178-192, 702-746) andInputStoreonly starts wheninput_staging != 0(:767-776). Keep the PR's flags (--lossless-kv-compression cpu, explicit--prefix-cache-disk-limit) so the phase composition matches the published numbers; if the slab does not fit, report the slab/register sub-timings separately and compare only thescansub-timing plus a warm phase delta.- Phase total includes slab population and CUDA registration (
offload.rs:694-749), which this PR does not change. Because those are constant across arms they only add noise — take medians and prefer thescandetail (0.1 s resolution) as the secondary signal, with the wall time as primary. - Deletion risk is real and cheap to contain. Any seeded
.ckptwhose header disagrees with the running core is deleted by design (record.rs:1343-1345). Snapshot the directory listing, use a throwaway directory, and check/metricsbefore running the A/B. - Never measure with
ignition debug-serve(docs/performance-work.md:9-13); it is diagnostic only.
6. If core export cannot be done in-job
Deliver T1 + T2 + T2b only. They fully exercise the changed code paths (both record::scan and Worker::scan, all four Inspection outcomes, budget accounting, determinism) with zero GPU, and they reproduce the mechanism claim that the PR's end-to-end number rests on. In that case, record explicitly that the served-workload number was not re-measured on our hardware, and that the PR's 8.60x cold / 1.80x warm remain author-reported from a 20-core GB10.