Repository navigation
Tooling: schedule isolated test modules concurrently with identical receipts (3.3-3.9x faster verify-tests, no new kappa) - #921
Merged
Mister-Meeseeks merged 1 commit intoOct 13, 2026
Conversation
…eceipts (3.3-3.9x faster verify-tests, no new kappa) scripts/run_isolated_tests.py now runs the same per-module unittest commands concurrently (one isolated interpreter per module, --workers pins the width) and replays each module's captured bytes in sorted module order. Exit codes, summary lines and failure reporting are unchanged; benchmark.py proves per-module receipt equality against the pre-change sequential schedule (88 modules, exit codes identical, 87 byte-identical modulo the unittest timing field, 1 module inherently nondeterministic via a random temp path in its failing traceback). Measured on the same host/input: 298.5s end-to-end at base -> 76.7s; benchmark sequential 250.6s -> concurrent 75.9s (16 workers). tests/test_isolated_test_runner.py adds sandbox negative controls, including a barrier test that fails against the sequential runner. Prepared with help from opencode. No new kappa claim; no certificate, patch, generator or pinned source file is touched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tooling: schedule isolated test modules concurrently with identical receipts
Status: tooling improvement (verification engineering, track 85–94, assignment seed 88). No new kappa claim. Prepared with help from opencode.
What and why
scripts/run_isolated_tests.py(run bymake verify-tests, hencemake verify) runs every test module in a fresh interpreter to isolate colliding research-package module names. A timing survey of themake verifychecks at basef567884aeb8851b6e794af1184119a3bfbe1e631found this runner to be the single most expensive check: 298.5 s end to end (and over a 250 s sweep budget), while every other surveyed check was at most 144 s (scripts/audit_quadratic_affine.py), most under 10 s. No open PR (surveyed 703) targets the test runner or generic parallelism.The runner now schedules the same per-module commands concurrently — one isolated interpreter per module;
--workers Npins the width — and replays each module's captured bytes in sorted module order. The isolation design is unchanged; it is exactly what makes the modules independent and safely concurrent. A test-module audit found no writes outsidetempfile.TemporaryDirectory()blocks, so concurrent modules share no mutable state.Measured result (same host, same input, 16 logical CPUs, CPython 3.13.15/Windows)
Exactness (machine-checked,
research/agent-07-verifeng-seed88/benchmark.py)Per-module command is byte-identical to the pre-change one (
python -m unittest discover -s tests -p <module> -v, same interpreter/cwd/env); only scheduling changes. Across 88 modules:ModuleNotFoundError: No module named 'resource', present identically at base);unittest -vembeds inRan N tests in T.TTTs;test_frontier799_bindings.pyis inherently nondeterministic across any two runs (its failing traceback embeds a machine-random temp path). The benchmark proves this automatically by re-running any mismatched module twice under the same schedule:scheduling_driven_mismatchesis empty.No certificate, patch, generator, proof supplement or hash-pinned source file is touched (
run_isolated_tests.pyis not pinned bycertificates/selected-result.json,SELECTED-SOURCE.jsonor any checkpoint).Negative controls
tests/test_isolated_test_runner.pyruns the real runner end to end in a sandbox: (1) a deliberately failing module must appear in the sharedFailed modules:summary; (2) a barrier test — three modules each wait (8 s) for three markers, passing only if at least three module processes run concurrently — fails against the pre-change runner with "barrier timeout: test modules did not run concurrently" and passes with--workers 3after; (3) default-invocation summary lines and exit codes are unchanged.Reproduce
Expected final line:
PASS identical exit codes (88 modules); receipts identical for 87 modules modulo the unittest timing field; 1 module(s) inherently nondeterministic across same-mode runs: ['test_frontier799_bindings.py']On a Unix host
python3 -B scripts/run_isolated_tests.pyshould endPASS all 88 test modules in isolated interpreters; on this Windows host it exits 1 with the same 15-module environmental failing set as at base (documented in the package README).Scope and remaining obligations
Windows portability of the 15 pre-existing failing modules is out of scope; the claim is exact reproduction of the sequential runner's receipts, exit codes and failing set. Live interleaved output is replaced by sorted per-module replay. Related concurrent tooling on a different target: PR #853 (PR 741 pinned-stage concurrency) — independent of and not depended on by this change. Base commit, claim record and full evidence are in
research/agent-07-verifeng-seed88/(README.md, SPRINT-CLAIM.md, evidence/benchmark.json).