#1 [high] PR #734 subtraction audit — key line cites
PR #734 (selene parallel startup scan), head 015076e, base 22d2ac9. Files: selene/src/shared/record.rs +424/-23, selene/src/input.rs +130/-7.
F1 test dup: record.rs:2354-2389 (inline PackedUnit block in header_eq_implies_same_hash, let first_page = a.parent.unwrap().consumed_tokens / a.page_tokens;) vs new helper packed_header record.rs:2430-2471 (let first_page = parent.map_or(0, |p| p / base.page_tokens);). Only diffs: stored_length 128 vs 256, crc 11+p/22+p vs 11/22, loop var. ~34 lines deletable; a = header(&geometry,512,Some(256)) ≡ packed_header(&geometry,512,Some(256)).
F2 par_map record.rs:1142-1192: atomics work-stealing + ordered.sort_unstable_by_key(|(idx, _)| *idx) + ordered.into_iter().map(|(_, value)| value).collect(); materializes Vec<(usize,R)> then Vec. disk.rs:585-649 hash_pages_scoped is the crate's other scoped pool, static chunks (buffers.chunks(chunk_len), completed[0]=true, inline fallback for unspawned/panicked) and needs no re-sort. rayon ruled out: selene/Cargo.toml:16,23 rayon is optional behind codec feature; PR claims --no-default-features --lib passes 566 tests. Doc line record.rs:1147 "with zero unsafe" is a claim not a contract.
F3 duplicated fail-closed encodings: record.rs:1305-1313 enum Inspection {Record, Absent, Invalid, Unreadable(Error)} vs input.rs:554-562 position(|result| matches!(result, Err(error) if error.kind() != std::io::ErrorKind::InvalidData)) + inspected.swap_remove(pos).unwrap_err() ceremony.
F4 record.rs:1239/1243/1259 third tuple field is_tmp + candidates.push((entry.path(), name.to_owned(), is_tmp)) + if *is_tmp { return Inspection::Invalid; }; derivable from name in the closure; reduction ignores it (((path, _, _), outcome) at :1266). Note order preservation of par_map IS load-bearing: both callers zip by index (record.rs:1266, input.rs:568) and pick first error deterministically (input.rs:552 sorts entries first).
F5 record.rs temp-dir boilerplate repeated: 1986, 2156, 2205, 2236, 2569, 2697 — same std::env::temp_dir().join(format!("flare-...-{}-{:?}", process::id(), thread::current().id())) + let _ = fs::remove_dir_all(...).
F6 input.rs record-size expression HEADER as u64 + metadata.len() + payload.len() at 884-886 (production Worker::write), 985 (parse), and tests 1237-1239, 1292-1294, 1580-1582, 1648-1650, 1702-1704; PreparedInputRecord::bytes() exists (input.rs:35-39) but adds ENTRY_BYTES.
Lean: no CLI flags/knobs/deps introduced; read_metadata record.rs:357-397 is effectively minimal (slow path needs with_capacity to avoid realloc); only nit is magic 4096 at :363 vs HEADER_BYTES=BLOCK_BYTES=4096 (geometry.rs:22).
#2 [medium] input.rs scan: collapse entries/inspected index pairing
input.rs:553-568 best simplification: two parallel vectors indexed in lockstep.
let mut inspected = super::record::par_map(&entries, |path| inspect(path)); if let Some(pos) = inspected.iter().position(...) { return Err(failure("read prepared-input record", &entries[pos], inspected.swap_remove(pos).unwrap_err())); } ... for (path, result) in entries.into_iter().zip(inspected) {
entries[pos] and swap_remove(pos) rely on the zip invariant holding; collapsing to let mut pairs: Vec<_> = entries.into_iter().zip(inspected).collect(); then let (path, result) = pairs.swap_remove(pos); removes the index-correspondence assumption and the &entries[pos] habit; final loop becomes for (path, result) in pairs. Net -2 lines, one fewer invariant.