Skip to content

ci: parallelize ci-tests and balance ws-test critical path - #757

Open
joshlf wants to merge 1 commit into
mainfrom
joshlf/ci-nr-mir-08-tail-cut
Open

joshlf wants to merge 1 commit into
mainfrom
joshlf/ci-nr-mir-08-tail-cut

Conversation

@joshlf

@joshlf joshlf commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

Cut CI critical-path latency in anneal-ci-tests and anneal-ws-test without adding runners or changing the executed test set:

  • ci-tests: switch from sequential unittest discover to ./ci/run_py_tests.py -s ci -p 'test_*.py' --jobs 4 -v, and update ci/tripwire_checker/checks.py _check_ci_wiring so tree tripwires accept the parallel runner alongside unittest discover.
  • ws-test heavy shards: skip constructing and extracting the Miri toolchain overlay on heavy-corresp, heavy-cyclic, heavy-batch, and heavy-kernel-physics (none execute Miri), and replace --workspace with exact -p <crate> --test <bin> targets so each heavy shard compiles only its required test binary.
  • ws-test partition shards: replace per-binary count:i/20 shards with deterministic two-phase LPT partitioning (respecting .config/nextest.toml threads-required overrides and measured CI weights in ci/anneal_ci_lib.py, plus bounded late-alphabet tail swaps) over live cargo nextest list --message-format json output, chunked under 32 KiB per -E argument.
  • Parity tests: add fail-closed checks in ci/test_run_anneal_check.py, ci/test_anneal_ci_lib.py, and ci/test_check_phase0_tripwires.py proving exact unittest discover parity and 100% union/disjoint coverage across all heavy-* and 1/20..20/20 shards.

Authored by an AI agent acting on joshlf's behalf.

@joshlf
joshlf force-pushed the joshlf/ci-nr-mir-08-tail-cut branch from 23c2d3a to 73d94b8 Compare December 6, 2026 03:38
@joshlf

joshlf commented Dec 6, 2026

Copy link
Copy Markdown
Member Author

Review Receipt

Human review surface:

  • ci/anneal_ci_lib.py
  • ci/run_anneal_check.sh
  • ci/test_anneal_ci_lib.py
  • ci/test_check_phase0_tripwires.py
  • ci/test_run_anneal_check.py
  • ci/tripwire_checker/checks.py

Scope invariants:

  • 0 trusted/** files modified, 0 .github/** files modified, 0 ci/checks.toml edits, 0 theory/** edits, 0 correspondence/** edits, and 0 extra CI runners.

Verification (HEAD=73d94b8a9dade2012091f688a1bdd9deb515b5eb, tree=99dca7791d51101383ae98f38a55b84729f34866, base=8b73d98158e8fe0863777855ca01f4c4721d0364):

  • [real measurement] /usr/bin/python3 -I -B ./ci/run_py_tests.py -s ci -p 'test_*.py' --jobs 4 -v: 1141 tests across 61/61 modules in 220.28s (0 failures, 0 errors, 6 pre-existing environment-skipped live-binary integration cases).
  • [real measurement] Targeted modules: test_anneal_ci_lib (14/14), test_check_phase0_tripwires (6/6), test_run_anneal_check (48/48), test_check_contract_lockstep (9/9), test_ci_workflow (27/27).
  • [real measurement] Static gates: ./ci/check_todo.sh, ./ci/scripts/check_shell_and_hooks.sh, ./ci/check_phase0_tripwires.py --mode tree, ./ci/check_contract_lockstep.py --repo-root ., ./ci/check_minirust_pin.py --repo-root . --check-lean --check-anchors, ./ci/check_pass2_canaries.py --repo-root . --check-static, ./ci/check_unstable_registry.py, ./ci/check_cartridges_lock.py, ./ci/check_verdict_locks.py, ./ci/check_experimental_isolation.py, and ./ci/check_pr_hygiene.py all passed (0 findings).
  • [real measurement] Workspace Cargo target scoping (cargo test --locked --offline -p <crate> --test <bin> -- --list vs cargo test --workspace --locked --offline -- --list): verified 2085 workspace tests and exact scoped heavy target counts (anneal-audit-tests --test boundary_audit: 119, cargo-anneal-tests --test suite: 85, cargo-anneal-tests --test batch_verify: 4, anneal-audit-tests --test kernel_physics: 1) with unique heavy test symbol ownership.
  • [synthetic test] cargo-nextest 0.9.111 24-shard round-trip over a synthetic 2,078-test workspace mirror matching all CI binary IDs and test names (including r#gen::tests::... and ::bin/itree-diff): 2078/2078 union parity (0 dropped, 0 duplicated, max -E 11,322 B). Note: full CI runner ws-test execution (anneal-tc OCI / Miri / Lean container environment) is exercised by PR CI workflows rather than locally.
  • Gate-1 review: clean (0 P0 / 0 P1 / 0 P2, 4 non-blocking advisories).

Authored by an AI agent acting on joshlf's behalf.

Cut CI critical-path latency in `anneal-ci-tests` and `anneal-ws-test`
without adding runners or changing the executed test set:

- `ci-tests`: switch from sequential `unittest discover` to
  `./ci/run_py_tests.py -s ci -p 'test_*.py' --jobs 4 -v`, and update
  `ci/tripwire_checker/checks.py` `_check_ci_wiring` so tree tripwires
  accept the parallel runner alongside `unittest discover`.
- `ws-test` heavy shards: skip constructing and extracting the Miri
  toolchain overlay on `heavy-corresp`, `heavy-cyclic`, `heavy-batch`,
  and `heavy-kernel-physics` (none execute Miri), and replace
  `--workspace` with exact `-p <crate> --test <bin>` targets so each
  heavy shard compiles only its required test binary.
- `ws-test` partition shards: replace per-binary `count:i/20` shards
  with deterministic two-phase LPT partitioning (respecting
  `.config/nextest.toml` `threads-required` overrides and measured CI
  weights in `ci/anneal_ci_lib.py`, plus bounded late-alphabet tail
  swaps) over live `cargo nextest list --message-format json` output,
  chunked under 32 KiB per `-E` argument.
- Parity tests: add fail-closed checks in `ci/test_run_anneal_check.py`,
  `ci/test_anneal_ci_lib.py`, and `ci/test_check_phase0_tripwires.py`
  proving exact `unittest discover` parity and 100% union/disjoint
  coverage across all `heavy-*` and `1/20..20/20` shards.

Agent-authored-by: AI agent acting on joshlf's behalf
@joshlf
joshlf force-pushed the joshlf/ci-nr-mir-08-tail-cut branch from 73d94b8 to faf4224 Compare December 6, 2026 04:21
@joshlf

joshlf commented Dec 6, 2026

Copy link
Copy Markdown
Member Author

🤖 Review Receipt (faf42248862c)

  • Head / Tree / Base: faf42248862c6d4b786d28a4de069da53e1e36ec / 3108811dfb86e32395e513e8d52d255894323904 / 8b73d98158e8fe0863777855ca01f4c4721d0364

Human review surface

  • ci/anneal_ci_lib.py
  • ci/run_anneal_check.sh
  • ci/tripwire_checker/checks.py
  • ci/test_anneal_ci_lib.py
  • ci/test_check_phase0_tripwires.py
  • ci/test_run_anneal_check.py

Automated Review & Finding Dispositions

  • Pre-Gate-2 Review (Round 2): CLEAN (0 P0, 0 P1, 0 P2, 0 advisories).
    • Closed Round-1 P2 on _nextest_atom / _tokenize_nextest_filter by emitting canonical nextest-filtering escaped equality matchers kind(=...) (\\, \/, \), \,, \n, \r, \t, \b, \f, \u{...}), aligning regex/non-regex tokenization with nextest-filtering, and extracting binary-name for binary(...) overrides.
    • Closed Round-1 P2 on non-Miri heavy-shard source guards in ci/test_run_anneal_check.py by scanning pass2_module_isolation/correspondence.rs and all cross_shard_dag/**/*.rs submodules alongside batch_verify.rs and kernel_physics.rs.
    • Addressed Round-1 advisories (parse_ws_test_shard_spec comment wrap in ci/run_anneal_check.sh and double-quoted/unquoted pattern matching in ci/tripwire_checker/checks.py).

Verification on Exact HEAD (faf42248862c)

  • Static & repo invariant checks: ./ci/check_todo.sh, ./ci/scripts/check_shell_and_hooks.sh, ./ci/check_phase0_tripwires.py --mode tree, ./ci/check_contract_lockstep.py --repo-root ., and ./ci/check_pr_hygiene.py --base origin/main --head HEAD --expected-author 'Josh Liebow-Feeser <joshlf@google.com>' all passed (0 findings).
  • Full CI Python test suite (/usr/bin/python3 -I -B ./ci/run_py_tests.py -s ci -p 'test_*.py' --jobs 4 -v): 1,141 tests across 61/61 modules passed in 212.83s (0 failures, 0 errors, 6 pre-existing skipped live-toolchain integration tests in redteam.test_redteam_harness).

Authored by an AI agent acting on joshlf's behalf.

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an AI agent acting on joshlf's behalf.

Gate 2 Independent Cross-Family Review — CLEAN (tier2b_cli_policy, Round 1)

  • Identity: one:4a3573f6625f0c3ad8e08c25cc39fd8a62b50c07:3108811dfb86e32395e513e8d52d255894323904:c68d76d5de6355b8936a5d22610675bd50cca7998f0375bf342e4961c66c808b (base=8b73d98158e8, head=faf42248862c, tree=3108811dfb86)
  • Separation: author_family=agent vs. reviewer_family=multi
  • Coverage: 6 inspected, 0 inapplicable, 0 blocked (of 6 changed file(s))
Seat Family Role Status Verdict Findings Latency
seat1 claude-frontier-thinking policy_and_cli_critic completed clean 0 495s
seat2 gemini-frontier-thinking policy_and_spec_critic completed clean 0 640s
seat3 gemini-executable-falsifier sandboxed_probe_runner completed clean 0 537s

No unresolved P0-P2 findings raised across completed seats.

Non-blocking advisories (P3, not Gate 2 findings)

These notes do not block merge and do not require another Gate 2 round.

  • G2-R1-A01 [P3] (ci/run_anneal_check.sh:1024): Nothing at runtime checks that the tests matched by a partition shard's -E chunks equal the shard's assigned set under the real cargo-nextest; the claimed 100% union/disjoint coverage rests on a Python re-implementation of nextest filter syntax over a synthetic list.
  • G2-R1-A02 [P3] (ci/tripwire_checker/checks.py:185): The commit body does not mention that the ws-test CI-wiring check now ignores commented-out cargo nextest run --workspace lines (a check tightening).
  • G2-R1-A03 [P3] (ci/tripwire_checker/checks.py:205): The run_py_tests wiring regex accepts an unquoted test_*.py pattern, which the shell could glob-expand, and does not reject later repeated -s/-p flags (argparse keeps the last value).

Executed Sandbox Probes

  • seat3 Candidate ci/test_anneal_ci_lib.py under run_py_tests.py in bwrap: outcome=pass (rc=0)
  • seat3 Candidate ci/test_check_phase0_tripwires.py under run_py_tests.py in bwrap: outcome=pass (rc=0)
  • seat3 Candidate ci/test_run_anneal_check.py under run_py_tests.py in bwrap: outcome=pass (rc=0)
  • seat3 Adversarial Python probe on real .config/nextest.toml, partition_ws_tests, format_nextest_filter_chunks, _compile_nextest_filter, and _strip_shell_comments in bwrap: outcome=pass (rc=0)
  • seat3 Adversarial bash ws-test partition dispatch probe in bwrap: outcome=pass (rc=0)
  • seat3 Full ci/run_py_tests.py -s ci -p 'test_*.py' --jobs 4 -v in bwrap (90s timeout): outcome=partial_timeout (rc=124)

@joshlf
joshlf marked this pull request as ready for review December 6, 2026 04:46
@joshlf
joshlf requested a review from jswrenn as a code owner December 6, 2026 04:46

@joshlf joshlf left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ci-core approve faf4224

@joshlf

joshlf commented Dec 6, 2026

Copy link
Copy Markdown
Member Author

Authored by an AI agent acting on joshlf's behalf. Posted /ci-core approve for faf42248862c6d4b786d28a4de069da53e1e36ec under joshlf's time-bounded Standing Gate-5 Option C authorization after mechanical evaluator + 3/3 cross-family Gate-2 CLEAN + 100% CI execute PASS.

This branch has not been deployed

No deployments
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.

1 participant