From f0462d21bf232b2c94d113af244c056f1c20eb24 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 01:55:08 +0000 Subject: [PATCH] ci(miri): shard the run across eight jobs Under Miri each test runs as its own interpreted process, about 30 s minimum each (measured locally: 33-39 s wall for single trivial tests). The ~1400 selected tests take 4-5 hours serial; the 2026-11-05 master run was cancelled at the 2-hour job cap after 590 tests. The job now runs as an eight-way matrix, each shard passing --partition count:K/8 to nextest via MIRI_PARTITION. The script runs the full suite when the variable is unset. Coverage is unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XAqKMQJzQD5KvNm8BtbsWG --- .github/workflows/ci.yaml | 13 +++++++++++-- scripts/miri-tests.sh | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ccb28da..f869d3f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -393,9 +393,16 @@ jobs: # Only runs on merge queue / push to main โ€” never blocks PR checks. if: github.event_name == 'merge_group' || github.event_name == 'push' runs-on: ubuntu-latest - name: miri - # A healthy run takes well under this; the per-test limit is in the + # Sharded: under Miri every test is its own interpreted process (about + # 30 s minimum each), so the ~1400 selected tests take 4-5 hours serial. + # The 2026-11-05 master run reached 590 tests in the 2-hour cap. Eight + # shards keep each well under the cap; the per-test limit is in the # `miri` nextest profile (.config/nextest.toml). + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4, 5, 6, 7, 8] + name: miri/${{ matrix.shard }} timeout-minutes: 120 steps: - uses: actions/checkout@v4 @@ -405,6 +412,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@nextest - run: ./scripts/miri-tests.sh + env: + MIRI_PARTITION: count:${{ matrix.shard }}/8 cross_test: # Gated on merge_group only โ€” cross-compile via docker (cross-rs) for diff --git a/scripts/miri-tests.sh b/scripts/miri-tests.sh index 4cdbac31..af966c14 100755 --- a/scripts/miri-tests.sh +++ b/scripts/miri-tests.sh @@ -56,8 +56,12 @@ export RUSTFLAGS="-Zrandomize-layout" # The polyfill is no longer the bottleneck โ€” the missing piece is a # `cfg(miri)` switch in `src/simd.rs` that re-exports from `simd_nightly` # instead of `simd_avx*` under Miri. +# CI shards the run (MIRI_PARTITION=count:K/N, see ci.yaml ยง miri): under Miri +# each test is its own interpreted process, so the whole suite takes about +# 4-5 hours on one runner. Unset, the full suite runs in one go. cargo +nightly miri nextest run -v --profile miri \ --no-fail-fast \ + ${MIRI_PARTITION:+--partition "$MIRI_PARTITION"} \ -p ndarray -p ndarray-rand \ --features approx,serde,nightly-simd \ -E '!(