Gates and contracts report · NVIDIA/hyperflare-inference #734

Raw Markdown for agents: https://autobot.eidonix.com/p/85278628-2b25-41ce-9b7b-74b8ccab7ef0.md

Contracts, Charter & Verification Gates Audit — PR #734

selene: parallelize startup disk scan and coalesce small header reads · head 015076e · base main @ 22d2ac9 Changed files (pr_files): selene/src/shared/record.rs (+424/−23), selene/src/input.rs (+130/−7). Nothing else.

Verdict: one Major contract/verification gate miss (served-workload A/B evidence), one Minor documentation-contract drift, no blockers on core-format/wire/graph boundaries, vendored code, or cross-PR dependencies. No failing tests or CI failures are reported anywhere, so no failing-test gate applies.


Gate 1 — Signed core-format / wire / captured-graph / public contract boundaries: PASS

Minor (documentation-contract drift, not a blocker): docs/prefix-cache-offload.md:684-690 states that across a restart "partial temporary files are discarded" and :677-680 states the startup scan "deletes temporary files"; :1180-1182 states startup fails if scanning or cleanup cannot establish disk usage. The new fail-closed ordering returns an Unreadable error before deleting .tmp/invalid files (record.rs:1265-1277) and before unlinking .input.pending (input.rs:554-567), so on the failure path temporaries survive where the old code had already deleted them. Because startup aborts on that error (input.rs:506-510; offload.rs:750-761 propagates with ?), the accounting invariant at :1180-1182 still holds and the next startup removes the leftovers — the end state on the success path is identical. Still, the normative prose at :677-690 is the contract this PR changes behavior under, and AGENTS.md:233 names docs/prefix-cache-offload.md as required reading for Selene changes. Recommend one sentence there for the fail-closed ordering (and for the new deterministic .input admission order, which is undocumented anywhere, unlike the checkpoint path at :250).

Gate 2 — Vendored upstream dependencies & cross-PR conflicts: PASS

Gate 3 — Mandatory verification evidence: ONE MAJOR MISS (evidence), otherwise PASS

Major — performance claim lacks an attributable served-workload A/B measurement. The governing rules are explicit:

The PR measures the right baselines (control 22d2ac97 vs candidate 015076ec, interleaved A-B-B-A, two architectures, cold/warm, medians with p10–p90) — but only at component level: in-process record::scan and InputStore::start_bounded. The description states this plainly: "These are isolated component microbenchmarks, not end-to-end flare run startup timings." No flare run / Prepare host prefix cache measurement exists, on either architecture, in any round.

Why this is a real gate miss rather than pedantry here:

  1. The claimed benefit is operator-visible startup latency, and the measurement surface already ships and is documented — selene/src/offload.rs:750-765 records timings.disk_scan around record::scan and InputStore::start_bounded inside the Prepare host prefix cache phase, with on_step("scanning disk records"), and it is documented at docs/prefix-cache-offload.md:1070-1076. A flare run cold-restart A/B would require no new instrumentation.
  2. The PR itself declares a served-path regression: warm InputStore::start_bounded on x86_64, 1,000 files, 2.09 → 2.53 ms (0.83x, +0.44 ms), with the cause "not separately isolated by ablation", plus bimodal aarch64 warm distributions with overlapping arms. docs/core-design.md:1834-1836 ("an aggregate win does not erase a workload regression") means a declared regression on a common restart path needs the served measurement to establish whether it is even visible, and an ablation to attribute it. Without either, the regression is unresolved by the PR's own evidence.
  3. The ~200-line harness is not in the diff (pr_files = 2 files; selene/Cargo.toml declares only the rank_node example, :57-59). It exists only as pasted prose, which conflicts with AGENTS.md:110-112 ("Reproduction commands must identify the required inputs and configuration directly or through a precise reference").

Required to clear the gate: one flare run (exported core, local disk tier) restart A/B on main vs head, cold and warm page cache, report Prepare host prefix cache / disk_scan duration — plus an ablation isolating read coalescing from par_map (and, for the warm .input regression, entries.sort() vs thread-scope setup) that #497's review round also asked for.

Not applicable — correctly omitted, not a miss:

No failing test or CI evidence to act on. Nothing in the description, the dossier, or pr_comments reports a failing check. selene-spark-pipeline-style CI is not evidenced either way; per calibration I am not flagging CI absence. The author reports 591 selene tests (test-support) and 566 (--no-default-features) passing on both bare-metal aarch64 GB10 and containerized x86_64, non-root, with both 0o000 unreadable-entry tests and the live-symlink test executing rather than skipping — counts consistent with the new tests visible in the diff. The one admitted hardware gap (no native Windows execution) is disclosed and would be exercised by .github/workflows/native-serving.yml:53-55 (not opened) (windows-2022, cargo test … selene), since the new scan tests are not #[cfg(unix)]-gated except the two permission tests that self-skip via modes_restrict_user().

Gate 4 — Material scope / claim contradictions: PASS

Info / Nit (correcting the Discovery Dossier, not a gate violation): Dossier Key finding 7 calls the deferred deletion and the lexicographic .input admission order "undeclared behavioural changes". They are declared in the PR body's Worker::scan and record::scan bullets ("sorts .input paths lexicographically", "rejects non-InvalidData I/O errors before unlinking .input.pending files or mutating self.disk/self.budget", "returns any Unreadable error before deleting .tmp or invalid entries"). They are undeclared in the docs, which is Gate 1's Minor above. Likewise the dossier's "selene-manager is only half covered" is fair as an effect caveat (selene-manager/src/disk.rs:71-98 identity pre-pass stays sequential because par_map is pub(crate)) but is not a contract or scope violation.


Summary

Gate Result
1. Core-format / wire / captured-graph / public contract Pass — no proto/wire/graph change; read_metadata signature unchanged with documented cursor semantics and all 5 callers verified cursor-safe; par_map is pub(crate). Minor doc drift on the fail-closed deletion ordering (docs/prefix-cache-offload.md:677-690, :1180-1182) and the undocumented .input admission order.
2. Vendored upstream / cross-PR dependency Pass — no vendored or native file, no manifest/lockfile change, no unmerged external dependency.
3. Mandatory verification Major miss (evidence only) — performance claim has an attributable main-vs-head A/B but only at component level; no served-workload (flare run / Prepare host prefix cache disk_scan) measurement, a declared warm .input regression (0.83x) unresolved, and an uncommitted harness, against charter #210, docs/design-review.md:106-115, docs/core-design.md:1828-1856. TLA+, Kani, mutation, GPU and core-replay gates correctly not applicable. No failing tests/CI reported.
4. Material scope / claim contradictions Pass — all named tests present, focused diff, no unrelated tooling.

Blockers: none. Should fix before merge: (1) the end-to-end Prepare host prefix cache / disk_scan A/B on main vs head, cold and warm, on at least one architecture, plus a coalescing-vs-par_map ablation that resolves the warm .input regression; (2) commit or reference the benchmark harness so the numbers are reproducible from the branch; (3) one paragraph in docs/prefix-cache-offload.md covering the fail-closed deletion ordering and the deterministic .input admission order.