#1 [high] Change: what PR #734 does and its size
PR #734 (open, DRAFT, author FujitsuPolycom, labelled area:selene + performance, Discord "Dooner", base main 22d2ac9, head 015076e, opened & last updated 2026-12-04, no CI checks, no reviews, no comments).
Files (pr_files): selene/src/input.rs (+130/−7), selene/src/shared/record.rs (+424/−23). Total +554/−30; description says +105 net non-test production LOC (+135/−30) with +419 test LOC.
Three production changes:
Header::read_metadata(selene/src/shared/record.rs:355-397): reads into a stack buffer[0u8; HEADER_BYTES + 4096]in a singleread()loop (handles short reads + EINTR), so v3 headers and v4 directories <= 4096 B are covered by one syscall; larger v4 falls back toVec+read_exactfor the tail. Doc comment now says "May read ahead past the end of the metadata... callers must not rely on the reader cursor position after this returns" (record.rs:357-359). HEADER_BYTES = BLOCK_BYTES = 4096 (record.rs:92);packed::MAX_DIRECTORY= 2 MiB (selene/src/shared/packed.rs:17).- New
par_maphelper (record.rs:1142-1189):PARALLEL_SCAN_THRESHOLD=64,PARALLEL_SCAN_CHUNK=8,MAX_SCAN_WORKERS=16; workers =available_parallelism().map_or(4,..).clamp(1,16), falls back to serial map below threshold or if <=1 worker; usesstd::thread::scope+Builder::name("flare-scan").spawn_scoped(...).ok()(spawn failure silently degrades to fewer threads) with the calling thread participating; results re-sorted by index for order. record::scan(record.rs:1206-1280) split into collect-candidates →par_mapsymlink_metadata+inspect→ serial reduction that deletes.tmp/invalid files only after noUnreadableerror; thenremove_orphans.Worker::scan(selene/src/input.rs:518-585): collects.inputentries, sorts paths,par_map(inspect), returns the first non-InvalidDataerror before unlinking.input.pendingor mutatingself.disk/self.budget, then applies the serial budget/recovery loop.
Tests added (record.rs:2429-2740 and input.rs:1643-1750): read_metadata single-read/EINTR/short-read/truncation tests, parallel_scan_handles_large_mixed_v3_v4_directory_deterministically (also checks dangling + live symlinks, subdirs, foreign file survive), parallel_scan_preserves_directory_on_unreadable_entry, two input-side tests (deterministic recovery under tight DiskBudget; unreadable entry preserves dir+budget).
#2 [high] Change: behaviour changes the description does not spell out
Things the description understates or omits (verified in the diff, pr_diff of both files):
- Deletion is now deferred and best-effort-ordered: previously
record::scandeleted.tmp/invalid files inline as it walked; now removals happen in a second pass after reduction (record.rs:1266-1280). Same net effect on success, but on a mid-scanUnreadableerror the whole removal pass is skipped, so garbage that a previous run would have deleted survives until the next successful scan. Same intentional fail-closed change inWorker::scanfor.input.pendingfiles (input.rs:548-568) —.pendingfiles used to be deleted as encountered insideread_dir, now only after all inspects succeed. Worker::scannow sorts.inputpaths lexicographically before inspecting (input.rs:552entries.sort()). This is a new deterministic admission order underMAX_DISK_RECORDS/DiskBudget; before, order followedfs::read_dirorder. The description mentions it, but it is a behaviour change in which records survive a tight budget, not just a perf change. Testparallel_scan_recovers_large_directory_deterministically_under_tight_budget(input.rs:1645+) pins the new order.Worker::scanerror selection changed: it reports the first non-InvalidData error by sorted path order, and usesswap_removeon the result vec. Description mentions reject-before-unlink; what it does not say is that all inspections still complete before the error is returned (no early abort), so a directory of thousands of files pays full inspection before failing.par_mapispub(crate)and lives inshared::record(record.rs:1148).selene-managercannot use it;selene-manager/src/disk.rs::recover(disk.rs:60-108) still does its own sequential per-directoryHeader::read_metadataloop over the first entries to find identity/fingerprint before delegating the actual scan torecord::scan(disk.rs:101). So selene-manager's own discovery loop is still QD=1 — the description says "delegates full directory scans to record::scan", which is true for the scan but not for its pre-pass.- Symlink handling unchanged:
inspectstill usesfs::symlink_metadataand requiresis_file(), so symlinks (live or dangling) are neither followed nor deleted — same as before the change; the new test locks that in. Note a live symlink to a regular file is not treated as a record, it is skipped (record.rs:1256-1262if !metadata.is_file() { return Inspection::Absent }). - Read-ahead can consume up to 4096 bytes of the first record segment into the buffer: for a v3 record whose file is only HEADER_BYTES long (metadata-only),
read()returns fewer bytes, fine; but for any record whose segment begins with page data, up to 4096 page bytes are read and discarded. No correctness effect since every caller either drops the handle or uses positional reads (verified: selene/src/disk.rs:1478 caller later usesread_exact_atat disk.rs:1464, io_uring submits explicit offsets at disk.rs:2126-2165; selene/src/shard.rs:1200-1273 opens and drops per use; selene-manager/src/disk.rs:77 drops the File each iteration).
#4 [high] Project fit: scan runs in the timed 'Prepare host prefix cache' phase (PR #625)
- record::scan is called with the directory lock held by
DirectoryLock::acquireat selene/src/offload.rs:681-684 and from selene-manager/src/disk.rs::recover (disk.rs:69-108). - The scan itself is timed and reported to operators:
Prepare host prefix cachephase emitson_step("scanning disk records")and storestimings.disk_scan = Some(started.elapsed())(selene/src/offload.rs:750-765);Prepared::summary()appendsscan Z.Zs(added by merged PR #625 "Avoid THP compaction stalls in eos::map_host and report offload startup timings", helios/src/runtime_core/model.rs:1049progress.phase("Prepare host prefix cache")). Documented at docs/prefix-cache-offload.md:1070-1076 ("the record directory, disk limit, scanned record count, staged transport, andscanduration"). => Connection: #625 (merged 2026-12-01) is what makes this PR's target measurable in operator output; #734 does not add metrics of its own (no new counters/gauge;disk_scantiming already existed). InputStore::start_boundedis called from the same function (offload.rs:767-779) and itsWorker::scanruns there, so both timed components are insidePrepare host prefix cache. #734's own limitation note says it times record::scan and InputStore::start_bounded in isolation, not the phase.- docs/prefix-cache-offload.md:677-680 documents the startup scan contract that #734 preserves (reads each header, validates magic/version/identity/fingerprint/name, derives row presence from size, seeds access order from mtime, deletes temporaries and missing-parent nodes). docs/prefix-cache-offload.md:113-116 notes v3 writers/readers prune v4
.ckptfiles during the startup scan (format-compat behaviour the scan must not change).
#5 [high] Related work: author's #497/#496 series — same pattern, adjacent paths
This is the third PR in a series by the same author (FujitsuPolycom, Discord "Dooner"; CONTRIBUTOR; 20 merged, 12 closed, 0 open in the last 180 days) doing the same kind of change in Selene:
- #497 (merged 2026-11-29) "Reduce disk offload restore latency and integrated-memory intake overhead" — added bounded
std::thread::scopeparallel xxh3 page hashing inselene/src/disk.rs(cacheparallel_cpusatWorker::new,MAX_HASH_THREADS = 4,HASH_PARALLEL_MIN_PAGES = 4, inline fallback if a helper can't spawn) and a single-read raw open (header + page checksums in one 4 KiB-aligned transfer). #734 applies the identical pattern to startup scanning (bounded scoped threads, calling thread participates, fallback on spawn failure) plus a coalesced-metadata read. Note #497's coalescing is for the restore path; #734's is for the scan path — complementary, not overlapping. - #496 (merged 2026-11-29) "Coalesce shared ancestor reads across concurrent Selene disk fetches" — also touches
selene/src/shared/record.rs(+119/−1:HeaderHash,packed::LayoutEq/Hash) and is where read coalescing in the fetch path landed. Does not overlapHeader::read_metadataorscan. - Autobot reviews on #496/#497 raised the same themes this PR will likely meet: evidence must name the exact head, isolated component numbers must be labelled as such, spawn-failure fallbacks, and
available_parallelism()policy. #497's review nit explicitly flagged "available_parallelism()per batch" — #734 computes it once perpar_mapcall (record.rs:1149). - Other recent record.rs work: #610 (merged, yatesdr)
fix(selene): fix local storage tier, input cache, sharding, and codec edge cases— touched both changed files (input.rs +129/−29, record.rs +34) and is the last commit on either file (a56333a0, 2026-11-29). #734 builds on that but conflicts with none of it (no commits on main since 22d2ac9 touch these files).
#6 [high] Project fit: matches charter goals; deviates from the served-workload evidence rule
AGENTS.md (repo root) requirements vs. what this PR supplies:
- Performance PRs need served-workload evidence (charter "Bring real evidence": "Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)"). #734's own Limitations say the timings are "isolated component microbenchmarks, not end-to-endflare runstartup timings". So the headline numbers do not meet the letter of the served-workload rule; the change is a startup metadata scan, where a component benchmark may be the only tractable measurement, but the gap should be stated in the case file as a claim/evidence gap. - Four-part PR description (why/what/result/evidence, AGENTS.md:88-112): #734 complies unusually thoroughly, including a p50/p10–p90 table on two architectures, an interleaved A-B-B-A method, and explicit "does not do" notes. It distinguishes component from whole-model results (AGENTS.md:98-100) and states unrun checks (Windows).
- Benchmark reproducibility rule (AGENTS.md:110-112: reproduction commands must identify inputs directly): the harness lives in an uncommitted
selene/examples/scan_bench.rs, not in the diff, andselene/Cargo.toml:57-59only declares therank_nodeexample. So the numbers cannot be reproduced from the branch; they can only be reproduced by pasting the description's code. - Charter goals: "Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene" — squarely in scope; no per-model branch, no new flag, no new dependency, no on-disk/wire change, so no non-goal sign-off needed.
- Guidance to read (AGENTS.md:233): prefix-cache offload / Selene changes require docs/prefix-cache-offload.md, selene-manager/README.md, selene-manager/PROTOCOL.md. #734 changes no docs; docs/prefix-cache-offload.md:677-680 already describes the startup scan contract it must preserve (it does). No doc update is included for the new parallel behaviour, the new thread names, or the changed deletion timing — consistent with the repo's preference for not expanding docs unnecessarily, but worth noting since §2.11 (docs:1070-1076) reports
scanduration that this PR makes much smaller.
#7 [high] Process & community: draft, zero engagement, no CI, no review yet
- Comments/reviews: none.
pr_commentsreturns "No comments" at the time of this case file; no reviews, no reactions, no maintainer engagement yet. - Process state: open and marked DRAFT; head
015076e; no CI checks reported on the head commit. The repo does have a CI job that would exercise this:.github/workflows/native-serving.yml:48-55runscargo test --locked --release --manifest-path selene/Cargo.toml --features test-supporton ubuntu-24.04 and (withouttest-support) on windows-2022, plusselene-managertests on Linux. So the untested-on-Windows caveat the description admits would be partly covered by CI once it runs — the newparallel_scan_handles_large_mixed_v3_v4_directory_deterministicallytest is not#[cfg(unix)]and writes/renames/handles symlinks only under#[cfg(unix)], so it would execute on Windows. - Age: opened and last updated 2026-12-04 (same day as this case file) — very new.
- Author labels applied by triage:
area:selene,performance(notriage:*label yet, unlike #496/#497 which hadtriage:validation/triage:review). - Precedent for process: the author's #496/#497 went through multiple Autobot review rounds (Changes Requested → Ready To Merge) and the author rebased/answered each round; expect the same here once review starts.
#8 [high] Claims and evidence: what is backed, what is self-reported, what is missing
Headline claims in the description and how each is (or is not) backed:
- "9.93x cold / 2.28x warm speedup for
record::scanof 10,000.ckpton x86_64; 10.84x/2.99x on aarch64 GB10." Backed by the author's own bare-metal microbenchmark, medians with p10–p90, interleaved A-B-B-A, control22d2ac9vs candidate015076e, dataset generator in the uncommitted harness. Not independently reproduced; not end-to-end; the harness itself is not in the diff, so a reviewer must paste ~200 lines from the description to re-run it. - Cold cells are the strong result (all cold cells have non-overlapping ranges). Warm cells are much weaker:
record::scanwarm 1.38x (500), 1.85x (2000), 2.28x (10000) on x86_64. - One measured regression is declared honestly: warm
InputStore::start_boundedon x86_64 goes2.09 → 2.53 ms(0.83x,+0.44 ms) for 1,000 files; the author attributes it to thread-scope setup +entries.sort()but says it was "not separately isolated by ablation". This is the one place the change makes a real-served path slower, and the affected path (warm restart of the input store) is common in practice (a container restart with a warm page cache). aarch64warm distributions are bimodal and overlap between arms onInputStore; the author says so. Cold ratios on GB10 are ~9–10x.- Test evidence is strong and specific: 591 selene tests (lib+integration) with
test-support, 566 with--no-default-features, on both aarch64 bare metal and x86_64 container, non-root uid 1000/1001 withrustc1.94.1/1.99.1/1.100.0; plus full-suite counts for helios (1,976), flare (247), flare-cli (224), selene-manager (205 + 98), and 4 Python tests. Counts are far above the 522/475 figures quoted in #496/#497, consistent with ~10 days of main-branch growth — plausible but not verifiable without CI. - Claim "all five callers in
seleneandselene-managereither drop the file handle or use positionalread_exact_at" — verified correct (see scratchpad entry on callers): record.rs:1334, disk.rs:1478 (positional reads at disk.rs:1464 and io_uringspan.offset), shard.rs:1200, shard.rs:1251, selene-manager/src/disk.rs:77. - Claim "
0productionunsafe,0new dependencies" — verified: diff adds nounsafe;Cargo.tomluntouched (std::thread::scope/spawn_scopedonly). The onlyunsafein the added code islibc::geteuid()inside a#[cfg(unix)]test (record.rs testparallel_scan_preserves_directory_on_unreadable_entry). - Claim "+105 net non-test production LOC (+135/−30)": not independently recounted;
pr_filesreports +554/−30 across two files, which includes the +419 test LOC the description also states (554 − 419 = 135 added, −30 removed → +105 net; arithmetically consistent). - NOT claimed and not measured: any end-to-end
flare runstartup A/B; any RSS/CPU-cost measurement of the new threads at startup; any measurement on a machine with a page cache smaller than the cache directory; any behaviour of the changed deletion ordering under a real unreadable-file incident. - No ablation of the two changes against each other (read coalescing vs parallel scan), so a reader cannot tell how much of the cold win comes from each. #497's reviewer asked for exactly this kind of isolation ("attribute the hash pool separately"); the same ask applies here.
#9 [high] Reach: who is affected, compat, deployment, and what is not reversed
Who and what this touches (verified):
- Users/operators: every
flare runwith--prefix-cache-disk(local disk tier) and, in multi-host, every rank process; plus anyselene-managerserving a record root. No configuration, flag, or metric name changes. ThePrepare host prefix cachephase'sscanduration (docs/prefix-cache-offload.md:1070-1076) will shrink, so operator-visible startup timing changes without a docs change. - Compatibility: none broken. On-disk v3/v4
.ckptand.inputformats untouched (diff only reads/writes through existingHeader::encode/packed_metadata), Protobuf/wire untouched, model core loading untouched, noCargo.tomledit..inputHEADERstays 88 bytes (selene/src/input.rs:21).MAX_DISK_RECORDS = 4096(input.rs:26) still caps recovery, but which records survive a tight budget is now path-sorted (input.rs:552). - Deployment: new short-lived threads named
flare-scan(≤16, only when a directory has ≥64 candidates), spawned duringPrepare host prefix cache— i.e. before serving starts, so no interaction with the model worker or CUDA launch threads; no priority change (contrastselene/src/shared/codec.rs:47-54, which nices codec workers). Under a cgroup CPU quotaavailable_parallelism()is quota-aware, so the pool shrinks. - Reach into other crates:
record::scanispuband used byhelios/src/offload/gpu_tests.rs(4 sites),selene-manager/tests/{client,packed}.rs,selene/tests/mixed_codec_root.rs, plus many selene-internal tests — same signature, same ordering guarantee.par_mapispub(crate), so selene-manager cannot reuse it: itsrecoverpre-pass (selene-manager/src/disk.rs:71-98) that finds identity/fingerprint is still sequential per directory (it only delegates the actual scan, selene-manager/src/disk.rs:101). - Threading-model question (not a defect):
selenealready has a rayoncpu_pool(shared/codec.rs:37-60) and scoped threads at disk.rs:605 and pool/startup.rs:241;par_mapuses rawstd::thread+spawn_scopedrather than the existing rayon pool.selene's default feature iscodec(selene/Cargo.toml:13-16), so the evidence's--no-default-featuresrun is the slim/restore-only build. - Serial-path cost where
rayonwas already available: the new code does not consultcpu_pool, so startup scan parallelism is independent of the codec pool's nice(10) policy. - Nothing on
mainsince22d2ac9touches the two changed files; the last change to either was #610 (a56333a0, 2026-11-29), which also reworkedinput.rsscan/eviction error handling — #734's fail-closed changes compose with it rather than reverse it. - Undone/reversed by this PR: nothing. It does not reverse #496 (fetch-path coalescing), #497 (restore-path parallel hashing + single-read raw open), or #610. It is additive, in the startup path only.
- Open issues in the area that this PR does not address: #703 (helios/selene CPU retry storm under DRAM spill saturation), #78 (Engram disk cache first-touch latency), #189 (closed: startup row thinning overflow). None is a startup-scan report — which is why the "why" rests on the description's own argument rather than a filed bug or maintainer request.
#10 [high] Why: the motivation is self-declared, not issue-backed
- The "why" has no filed issue, no linked report, and no maintainer request.
search_itemsfor "startup disk scan recovery parallel", "selene recovery slow startup records", "selene scan ckpt header read latency", and "startup time record directory scan" returns only #734 itself (plus unrelated hits such as #625 and #254). Nothing in the tracker asks for faster startup scanning. So the problem statement is the PR's own: "serial metadata inspection leaves storage queue depth unutilized and stalls startup" for "hundreds to tens of thousands of records". - The nearest adjacent operator-visible startup complaint is #616 / merged PR #625: "v0.4.4 takes over 15 minutes to prepare a 119 GiB host prefix cache on fragmented Linux memory" — that was host slab population, not the record scan, and #625's own fix added the per-step
scanduration that would now show this PR's win. #625's description explicitly separatespopulate/registerfromscan, which is the only place in the repo that treatsscanas a startup cost worth measuring. - Scale argument is checkable:
MAX_DISK_RECORDS = 4096caps the input store (selene/src/input.rs:26) soWorker::scansees at most ~4,096 relevant files per directory; the.ckptrecord directory is bounded only by--prefix-cache-disk-limit(defaultfree_space/10, selene/src/offload.rs:658-664), so tens of thousands of.ckptfiles are plausible — the 10,000-record row of the benchmark is the realistic upper end, and 500 is the common case. - How long it has been wanted: no history of requests. The scan code's sequential shape dates back to the original Selene record store (#92, #141, #168 all touch
record.rs); the only prior latency work in this file family is fetch-side (#496, #497), not startup-side. So this is a first-of-its-kind (in this repo) startup-latency PR.
#12 [high] Amendment 2026-12-05 (head b7bd3fa9): scope shrank, coalescing reverted, served-workload A/B added
Head moved 015076e -> b7bd3fa9 (014076e... incremental 015076ec..b7bd3fa9; PR now based on main be4092d7). Size now +498/-112 in 3 files (pr_files): selene/src/shared/record.rs +352/-103, selene/src/input.rs +140/-7, docs/prefix-cache-offload.md +6/-2. Title changed to "selene: parallelize startup disk scan" (coalescing dropped from title). Labels now area:selene, performance, triage:validation (triage label added); item reads as open, not draft.
SUPERSEDED from my 2026-12-04 report:
Header::read_metadata4 KiB read-ahead is fully reverted — head has the exact two-read_exactbody ofmain(head record.rs:355-370 == main record.rs:355-370, verified by reading both refs). So the cursor-contract angle, the "coalescing helps .ckpt only" point, and theread_metadataunit tests are all gone. Author's stated reason: ablation showed read-ahead slowed warm scans 4.7-9.2% with no parallel cold gain (Linux page-cache readahead), and it weakened thepub fnio::Readcursor contract. Removing rather than defending it is the right call.- The declared warm regression is withdrawn (author comment 2026-12-05 01:10).
- The "undeclared behaviour" complaint is closed: fail-closed deletion ordering, removal failure, and lexicographic
.inputadmission are now in present-state docs (docs/prefix-cache-offload.md:681ckpt,:1199-1204input) plus the description. - The served-workload evidence gap is closed (see note on evidence).
WHAT THE CODE LOOKS LIKE NOW:
par_maprecord.rs:1124-1171,pub(crate): threshold 64 (:1118), chunk 8,available_parallelism().min(MAX_SCAN_WORKERS=16).min(chunk_count)(:1126-1129), serial fallback below threshold (:1130), scopedflare-scanthreads, per-chunk(start, Vec<R>)then sort by start (:1165), panic re-raised viaresume_unwind(:1161).record::scanrecord.rs:1189-1260: read_dir pre-filter*.ckpt/.*.tmpintoVec<PathBuf>(:1219-1222),par_mapsymlink_metadata+inspect (:1224-1245), serial reduce that returns firstUnreadablebefore any deletion (:1248-1255), then removals (:1256-1258), then unchangedremove_orphans(:1262-1284, deterministic sort:1282).Worker::scaninput.rs:514-587: temporaries deferred (:541),entries.sort_unstable_by(|a,b| a.as_os_str().cmp(b.as_os_str()))(:552),par_map(inspect)(:553), non-InvalidDatarejection before unlinking temporaries or mutating disk/budget (:554-567), then ordered admission (:568-585).
#13 [high] Amendment: served-workload + ablation evidence now present, with 4 caveats
PR #734 body (updated 2026-12-05) now carries end-to-end flare run startup A/B, closing the docs/design-review.md:106-115 / #210 served-workload rule I flagged:
- Setup: bare-metal aarch64 GB10, TP1 signed Qwen4-35B-A3B-NVFP4,
--prefix-cache-disk-limit 2000G --lossless-kv-compression cpu, 10,000.ckpt(5,000 v3 + 5,000 v4 Literal, 1,000 10-step chains, tail_pages=1, 697,774,713,000 logical B / 649.85 GiB) + 1,000.input(4,440 B). 22 boots, each verified10000 records,flare_host_cache_disk_records==10000,flare_input_cache_disk_records==1000,/healthready, 0 deletions/0 rejections after SIGTERM. - Cold (n=5/arm, drop_caches each boot):
Prepare host prefix cache2,542.00 -> 295.44 ms (8.60x);timings.disk_scan2.2 -> 0.2 s; spawn->/health17.57 -> 15.36 s (-2.21 s, -12.6%). - Warm (n=5/arm): phase 95.58 -> 53.20 ms (1.80x); spawn->
/health14.71 -> 14.64 s (within noise). - Component
.ckpt(GB10, n=20 cold / n=40 warm): 500: 119.44->11.19 (10.68x) cold, 3.31->1.70 (1.94x) warm; 2,000: 466.08->43.80 (10.64x) / 15.53->4.81 (3.23x); 10,000: 2,122.11->211.29 (10.04x) / 61.43->16.54 (3.71x). - Ablation now exists:
.inputfour columns (control unsorted-seq / OsStr::cmp seq / Path::cmp+par_map / candidate) — GB10 cold 214.43 / 218.11 (0.98x) / 23.96 (8.95x) / 23.16 (9.26x); GB10 warm 4.73 / 5.28 (0.90x) / 3.55 (1.33x) / 2.50 (1.89x); x86_64 WSL2 warm 4.40 / 4.55 (0.97x) / 3.05 (1.44x) / 2.60 (1.69x). Sort alone costs 2-10%;OsStr::cmpbeatsPath::cmpby ~0.45-0.6 ms warm. Caveats to keep in the report:
- Cross-round control inconsistency: my 2026-12-04 report recorded warm
.inputcontrol 2.09 ms -> 2.53 ms on x86_64; this round's x86_64 control is 4.40 -> 2.60 ms for the same 1,000-file workload. The control more than doubled, so the "regression is gone" conclusion rests on a different environment (WSL2 ext4), not on a like-for-like rerun. The candidate absolute barely moved (2.53 -> 2.60 ms). Ask which environment is representative before treating warm as won. .ckptbodies are sparse seeded files (set_len), so colddrop_cachescost is inode/header reads without real data extents; scan only touches headers, so this is close to representative, but the cold 8.60x should not be read as "650 GiB cache".- Single host, TP1, one core; x86_64 evidence is component-only inside WSL2. Native Windows still static-audit only.
- Harness still uncommitted:
selene/examples/holds onlyrank_node.rsandselene/Cargo.toml:57-58declares onlyrank_node. Mitigated, not fixed — the fullscan_bench.rssource is now pasted into the PR body<details>, so a reviewer can reproduce by hand. Test-count claims (self-reported): aarch64 1,945 passed/8 ignored; x86_64 3,287 Rust + 4 Python; selene 645 with test-support and 620--no-default-featureson both. New mutation claims: deletingentries.sort_unstable_byor restoring inline deletion makes the new tests fail on FIFO, LIFO tmpfs and hash-ordered ext4.
#14 [high] Amendment: what still stands on b7bd3fa9 (manager pre-pass, no issue, process, reach)
Findings from my 2026-12-04 report that still hold on head b7bd3fa9 (verified):
selene-manager's pre-pass is still sequential.selene-manager/src/disk.rs:60recover()opens each.ckptand callsHeader::read_metadataone at a time (:77) before delegating the actual scan torecord::scan(:101).par_mapispub(crate)(record.rs:1124) so the manager crate cannot reuse it. The updated description still says "selene-manager/src/disk.rs::recoverdelegates full directory scans torecord::scan", which is true only of the scan, not the identity/fingerprint pre-pass. Unchanged from the prior head.- Still no issue, bug report or maintainer request behind it.
search_items "parallelize startup disk scan"returns only #734. Nearest adjacent operator complaint remains #616 (closed) and its fix #625 (merged), which added thetimings.disk_scan/ "Prepare host prefix cache" surface that this PR's evidence now uses (docs/prefix-cache-offload.md,selene/src/offload.rs). So thewhyis still self-declared but now quantified against a real served boot. - Process moved: this is no longer a zero-engagement draft.
triage:validationlabel added; one Autobot review ("Changes Requested", 0 blockers / 1 should-fix / 3 simplify / 3 nits) at 2026-12-04 22:00; one author response at 2026-12-05 01:10 answering every point. No human maintainer review yet, and no CI run is visible in the conversation (the author's numbers are local--releaseruns; the repo'snative-serving.ymlwindows-2022 selene job still would be the first native-Windows signal). - Reach/risk unchanged: pre-serving startup only; no on-disk v3/v4
.ckpt/.inputformat change, no protobuf/wire change, no new dependency, no productionunsafe(onlylibc::geteuid()in#[cfg(unix)]tests, e.g. record.rs test at theparallel_scan_preserves_directory_on_unreadable_entrybody). Thread count bounded at 16; FD concurrency bounded by workers sinceinspectcloses its handle before returning (record.rs:1306-1353). - Behaviour changes now documented rather than undeclared (see note 12). Their effect on a tight budget is unchanged: lexicographic
.inputadmission decides which records survive (input.rs:552+:568-585), pinned byparallel_scan_recovers_large_directory_deterministically_under_tight_budget(input.rs:1668+, seeded odd-then-even so a FIFO/LIFO/hash readdir order cannot pass). - No behaviour change in the
.inputunreadable path: on failureWorker::newreleases the reserved input bytes (selene/src/input.rs:506-510) and returns the error; the new test also asserts the budget comes back whole (budget.checkpoint_limit() == limit,checkpoint_pressure() == 0,reserve_input(limit)succeeds) at input.rs:1751-1753. record::scanstill completes every inspection before reporting the firstUnreadable(par_maphas no early abort), so the fail-closed ordering is paid for with a full-directory inspection on failure. Documented intent now; not a defect.
#15 [high] Amendment: revised verdict and open questions for maintainers
Amended verdict for PR #734 at head b7bd3fa9 (2026-12-05). My 2026-12-04 report said "Changes Requested, evidence gap: no served workload, uncommitted harness, declared warm regression". Revised position:
- The served-workload requirement (
docs/design-review.md:106-115, #210) is now met at the scale the author could run: end-to-endflare runcold startup phase 8.60x, process spawn->/health-2.21 s (-12.6%), with a per-boot record-count and metric audit across 22 boots. That is real service measurement, not a component microbenchmark. - The ablation I asked for now exists and is honest: the
.inputsort costs 2-10% of the win, andOsStr::cmpbeatsPath::cmp. The author used the ablation to delete theread_metadatacoalescing (which the ablation showed was a warm-path loss), i.e. the evidence changed the code rather than the other way round. That is the strongest signal in the PR. - Remaining reasons not to call it clean: (a) the cross-round control inconsistency for warm
.input(2.09 ms control previously vs 4.40 ms now for the same workload — the withdrawn regression was not re-measured in the same environment); (b)selene-manager/src/disk.rs:77pre-pass still QD=1; (c) harness still not committed (onlyrank_nodein selene/Cargo.toml:57-58), mitigated by pasting the source into the PR body; (d) single host, TP1, sparse.ckptbodies, x86_64/WSL2 for the input ablation, no native Windows run. - Net: mergeable-from-a-correctness standpoint (0 blockers), and the performance claim is now defensible for large cold caches. The honest framing for the final report is "evidence gap closed; two caveats worth a maintainer question, not a block".
#17 [high] Research summary
PR #734 was rewritten between my 2026-12-04 report (head 015076e) and head b7bd3fa9, so the amendments are substantial rather than cosmetic. Saved as scratchpad entries #12–#16.
What is now superseded. The Header::read_metadata 4 KiB read-ahead was deleted outright — head selene/src/shared/record.rs:357-372 is byte-identical to main — so the cursor-contract concern, the "coalescing helps .ckpt only" point and the read-ahead tests are moot. The declared warm .input regression was withdrawn, the "undeclared behaviour" block is now present-state docs (docs/prefix-cache-offload.md:681, :1199-1204), and the served-workload evidence gap I treated as the main blocker is closed by an end-to-end flare run A/B (cold phase 2,542.00 → 295.44 ms, 8.60x; spawn→/health −2.21 s, −12.6%), plus the ablation I asked for, which is what drove the deletion of the coalescing. Scope shrank to +498/−112 in 3 files, title lost "coalesce", triage:validation added.
What still stands. selene-manager/src/disk.rs:77's identity pre-pass is still QD=1 (par_map is pub(crate)), contradicting the unchanged "delegates full directory scans" wording; the motivation is still self-declared with no issue behind it; and risk/compat are unchanged (no format, wire, dependency or production-unsafe change). One correction worth noting: the printed timings.disk_scan covers record::scan only (selene/src/offload.rs:750-765); InputStore::start_bounded starts after it at :769, so the "2.2 → 0.2 s" figure must not be cited as the .input result.
New caveats, not blocks. The withdrawn warm regression was not re-measured like-for-like — my prior control was 2.09 ms, this round's is 4.40 ms for the same workload while the candidate barely moved — and the harness is still uncommitted (only rank_node in selene/Cargo.toml:57-58), mitigated by pasting scan_bench.rs (not opened) into the PR body. Evidence remains single-host TP1 GB10 with sparse .ckpt bodies, x86_64 component-only in WSL2, native Windows static-audit only, and no visible CI. No Autobot re-review has run since the author's 2026-12-05 01:10 response, and no human maintainer has engaged.
#18 [high] Current state at b7bd3fa9: verified file map and citations to use (supersedes stale parts of #11)
Use this instead of the file map in entry #11, which describes code that no longer exists (the read_metadata read-ahead, the "coalesce small header reads" half of the title, +554/-30 in 2 files, and the read_metadata tests).
PR metadata at this head (read_item 734): open, not draft; head b7bd3fa9032f4ee306f0995495ed6dd463818ada, base be4092d7e1f0efe8a16049568c12ec7b841a2e8e; branch perf/selene-parallel-startup-scan; title "selene: parallelize startup disk scan"; labels area:selene, performance, triage:validation; pr_files reports +498 -112 across 3 files: selene/src/shared/record.rs +352/-103, selene/src/input.rs +140/-7, docs/prefix-cache-offload.md +6/-2. Body was rewritten (read_item) to a Why / What changed / Result / Evidence & Limitations structure with the harness source in a <details> block. Merge base is now be4092d7, one commit ahead of the 22d2ac9 base in my prior report.
VERIFIED CODE MAP (head b7bd3fa9):
Header::read_metadataselene/src/shared/record.rs:357-372— unchanged frommain(main:354-370, read at both refs). Cite this as "reverted to main", never as a coalesced read.par_mapselene/src/shared/record.rs:1124-1171, constantsPARALLEL_SCAN_THRESHOLD = 64/PARALLEL_SCAN_CHUNK = 8/MAX_SCAN_WORKERS = 16at:1118-1120; worker count:1126-1129; serial fallback below threshold:1130-1132; chunk sort:1165; panic re-raised:1161. Signature ispub(crate) fn par_map<T: Sync, R: Send, F: Fn(&T) -> R + Sync>(items: &[T], f: F) -> Vec<R>.record::scanselene/src/shared/record.rs:1189-1260; doc contract:1173-1188(now states fail-closed-before-delete); candidate pre-filter:1219-1222;par_mapclosure:1224-1245(symlink_metadata,!is_file -> Absent,!ends_with(SUFFIX) -> Invalid); serial reduce returning firstUnreadablebefore deletions:1248-1255; removals:1256-1258;remove_orphans:1262-1284with deterministic sort:1282.Inspectionenumselene/src/shared/record.rs:1286-1295with updated doc comments;inspect:1297-1353(opens and drops its own handle, so FD concurrency is bounded by worker count);remove:1355+.Worker::scanselene/src/input.rs:514-587: temporaries deferred:541;sort_unstable_by(|a,b| a.as_os_str().cmp(b.as_os_str())):552;par_map:553; non-InvalidDatarejection before unlinking/mutating:554-567; admission loop:568-585;Worker::newreleases reserved input bytes on scan error:506-510..inputinspection is still its own path, untouched by this PR:selene/src/input.rs:1008-1030(HEADER= 88 at:21),inspect_metadata_bytes:1000; capMAX_DISK_RECORDS = 4096:26;reserve_input:139used at:571.- Timing surface
selene/src/offload.rs:timings.disk_scanfield:349, reported:475, phase stepon_step("scanning disk records"):752,record::scancalled:754, timing set:761;InputStore::start_boundedbegins after the timing closes at:769-776. - Docs hunks
docs/prefix-cache-offload.md::681(unreadable.ckptfails scan before deleting temporaries/invalid) and:1199-1204(.inputordering, removal-failure, lexicographic admission). Both statements match the code atrecord.rs:1248-1258andinput.rs:552-567— the docs are accurate, which is worth stating since the prior report called these changes undeclared. - New tests:
record.rsadded block roughly:2358-2590(packed_header~:2361,scan_default~:2410,parallel_scan_handles_large_mixed_v3_v4_directory_deterministically,parallel_scan_preserves_directory_on_unreadable_entry);PARALLEL_SCAN_THRESHOLD * 2assertion verified at:2445— cite:2445exactly, treat the others as ranges.input.rsadded block from:1640(indexed_key,seed_valid_inputs,parallel_scan_recovers_large_directory_deterministically_under_tight_budget,parallel_scan_preserves_directory_and_budget_on_unreadable_entry); budget-restoration asserts verified at:1758(assert!(budget.reserve_input(limit))). Pre-existing test atinput.rs:1519startup_preserves_unreadable_records_and_rejects_failed_cleanupis unchanged and still passes. - Harness absent from the branch:
list_files selene/examples/*returns onlyrank_node.rs;selene/Cargo.toml:57-58declares only[[example]] name = "rank_node". - History: since my last report the only selene-touching commits are this PR's head and merged
7bbc6707(#694, write-side NVMe/pool spill gate — different files). No rebase conflict, no competing PR onrecord.rs/input.rs.
#19 [high] Charter/AGENTS mapping status after the revision (what is now met, what still applies)
This updates the "Project fit / charter" angle from my prior report (entry #6, as summarised in #11). The charter text itself is unchanged, so the goal mapping stands; only the compliance verdict moves.
- Goal fit — unchanged, still positive. Selene's disk prefix-cache tier and its startup recovery are core charter scope ("Store prefix-cache checkpoints in host memory and share them across Flare instances via Selene", charter line 24 as recorded in entry #6 during the prior run; I did not re-read
read_charterthis turn, so cite it as the prior run's charter read rather than a fresh quote). Startup recovery of that tier is exactly the code this PR touches, and it touches nothing outside the two startup scanners plus one doc file. - Served-workload evidence rule — now MET, previously not.
docs/design-review.md:106-115(re-read this turn) requires "equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements", withflare runas the required vehicle for comparisons andignition debug-servetimings "diagnostic only", plus "keep raw measurements and disclose unrun checks and material limitations". The revised body now reports aflare runcold/warm startup A/B with per-arm medians and min–max ranges, an interleaved design, an ablation table, and an explicit limitations list. Caveat to keep the claim honest: the A/B is TP1, so "complete GPU steps across all ranks" is not exercised beyond a single rank; and it measures startup, not serving throughput. - #210 (closed issue, cited by the prior Autobot review as the served-measurement precedent) is linked from the PR body's related items; no longer a gap I need to raise as a blocker.
- No model-branch / flag / format rule is engaged: no per-model conditional, no new CLI flag or config key, no on-disk v3/v4
.ckpt/.inputlayout change, no protobuf/wire change, no new dependency, no productionunsafe.--no-default-features(rayon-free) builds are unaffected becausepar_mapusesstd::thread::scope. The repo's Windows selene CI job remains the untested native path. - What a maintainer should still weigh (unchanged by the revision, and not charter violations): the
selene-manager/src/disk.rs:77pre-pass is still sequential; the harness is not committed (selene/Cargo.toml:57-58); and the warm.inputbaseline discrepancy between rounds (prior control 2.09 ms vs this round 4.40 ms for the same workload) means the withdrawn regression has not been re-measured like-for-like.
#3 [medium] Change: read_metadata callers and cursor semantics (verified)
Callers of Header::read_metadata at PR head (from search_code), and why the new read-ahead is safe:
- selene/src/shared/record.rs:1334
inspect()— file handle dropped at end ofinspect. - selene/src/disk.rs:1478
Worker::open— keeps the File inRecord::Reading, but later reads are positional:read_exact_at(&mut buf, offset)at disk.rs:1464 and io_uring submits with explicit offsets (span.offset) at disk.rs:2126-2165. So the moved cursor is harmless. - selene/src/shard.rs:1200 and :1251 —
File::openinline, handle dropped immediately. - selene-manager/src/disk.rs:77 —
Header::read_metadata(File::open(entry.path())?), temporary dropped each iteration. So the doc-comment caveat ("callers must not rely on the reader cursor position") holds today, but it is a new public-API footgun on apub fn(record.rs:361), reachable from external crates (helios, selene-manager) with no compile-time guard.
#16 [medium] Amendment: timing-surface correction and unchanged .input path
Refinement to my prior report's timing-surface finding, verified on head b7bd3fa9:
timings.disk_scancovers onlyrecord::scan(the.ckptscan):selene/src/offload.rs:750-765, set at:761right afterrecord::scan(...)at:754, underon_step("scanning disk records")at:752, reported at:475and defined at:349.input::InputStore::start_boundedruns after that timing closes (selene/src/offload.rs:769-776), still inside the samePrepare host prefix cachephase. So both record kinds are inside the phase wall time, but only.ckptis inside the printedscanline.- Consequence for reading the new evidence: the reported
timings.disk_scan2.2 -> 0.2 s cold is a.ckpt-only figure and must not be cited as the.inputresult; the.inputwin shows up only in the surrounding phase wall time (2,542 -> 295 ms) and in the separateInputStore::start_boundedcomponent rows. Both readings are consistent with the code, so this is a citation-accuracy point, not a defect. - Also confirmed unchanged on head:
.inputinspection still uses its own 88-byteread_exactpath (selene/src/input.rs:1008-1030,HEADERat:21,inspect_metadata_bytesat:1000), and admission is still capped byMAX_DISK_RECORDS = 4096(:26) plusbudget.reserve_input(:139, used at:571). So the.inputgain remains parallelism + sort only — the same conclusion as before, now with the coalescing code removed from the PR entirely. - History check: the only commits touching
selenesince my last report are the PR headb7bd3fa9and merged7bbc6707(#694, write-side NVMe/pool spill gate, different files) — no rebase conflict and no competing change torecord.rs/input.rs.