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 '!(