Skip to content

Test runner: fail loud when src/eigenscript changes mid-run (fixes #681)#690

Merged
InauguralPhysicist merged 1 commit into
InauguralSystems:mainfrom
Nitjsefnie-OSC:runner-binary-guard-681
Jul 22, 2026
Merged

Test runner: fail loud when src/eigenscript changes mid-run (fixes #681)#690
InauguralPhysicist merged 1 commit into
InauguralSystems:mainfrom
Nitjsefnie-OSC:runner-binary-guard-681

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Implements the cheap, loud option from #681 (the per-variant-output-paths alternative is deliberately not taken, per the issue's own framing).

What

  • tests/run_all_tests.sh records a fingerprint of src/eigenscript at suite start — POSIX cksum + file size + mtime (stat -c with a stat -f macOS fallback) — re-checks it at section seams (inside check_eigs_suite() and at the major inline section headers) and once more before the summary, and on mismatch aborts immediately with a nonzero exit and exactly:

    ERROR: src/eigenscript changed during the run (rebuilt mid-suite) — results are invalid.
    
  • Adds [99d] Binary-fingerprint guard self-test (#681): runs a tiny suite subset, swaps the binary from a background step mid-run, and asserts the exact error message and nonzero exit — same pattern as the tests: permanent runaway-guard self-test with inverted expectation (fixes #651) #653 runaway-guard self-test.

One file changed, +97 lines, no existing test touched.

Verification

  • Full suite with the guard armed: RESULTS: 3131/3131 passed, 0 failed.
  • Mutation check: neutering check_binary_fingerprint makes [99d] fail (3130/3131, 1 failed) — the self-test is not vacuous.
  • Independent trial (outside the self-test): swapping the binary ~1s into a live run aborted at the next seam with the exact message and rc=1.

Known bounds (inherent to the cheap option)

  • Detection is seam-granular: a swap during a long section is caught at the next seam, not instantly.
  • A rebuild producing identical cksum+size within the same mtime second would evade the check.

Both seem acceptable for turning a silent-wrong result into a loud failure; if you'd rather kill the whole footgun class, the heavier per-variant-paths option from the issue still stands.


Generated by Claude Fable 5 (brief, review), Kimi K2.7 Code (implementation)

…ld (InauguralSystems#681)

All build variants write to the same path, so a rebuild while the suite is
running silently swaps the binary under the runner. Record cksum+size+mtime at
suite start, re-check at section boundaries (inside check_eigs_suite and at
the major inline section headers), and re-check at the end. On mismatch, fail
loudly with the exact error message and exit nonzero.

Add [99d] self-test that swaps the binary from a background step and asserts
the guard aborts with the expected message.

Co-Authored-By: Kimi K2.7 Code <noreply@kimi.com>
@InauguralPhysicist
InauguralPhysicist merged commit 60d54c3 into InauguralSystems:main Jul 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants