From e8cf572a090995199cee10966ffd2f1f47afb36a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 14:40:10 +0000 Subject: [PATCH] =?UTF-8?q?ci(simd):=20TD-SIMD-9=20=E2=80=94=20nightly-sim?= =?UTF-8?q?d=20polyfill=20check=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a `nightly-simd-polyfill` CI job that compiles the crate with `--features nightly-simd` on nightly rustc, exercising the `#[cfg(feature = "nightly-simd")]` dispatch arm in `src/simd.rs` (landed in Phase 2 / PR #173). Catches arm shadowing bugs and the class of API-break codex flagged on that PR (lowercase aliases dropped from `pub use` list). `cargo check` rather than full build/test: - Nightly rustc is only needed for `#![feature(portable_simd)]` in `src/simd_nightly/lib.rs`. - The type/borrow/cfg checker reaches every type alias and macro expansion — same coverage as the v4 check job for the AVX-512 path, minus runtime exercise. - Two passes: default features and +hpc-extras (same shape as the v4 job). Gating: `if: merge_group || push` (same as `miri`) — keeps the nightly toolchain pull out of the per-PR critical path. Added to `conclusion.needs` so a failure blocks merge, but the "skipped on PR" case is accepted by the conclusion logic (`success | skipped`). --- .github/workflows/ci.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75d085ac..f7ab91ca 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -211,6 +211,35 @@ jobs: - name: cargo check (v4 / AVX-512 + hpc-extras) run: cargo check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon,hpc-extras + nightly-simd-polyfill: + # TD-SIMD-9 from .claude/knowledge/simd-dispatch-architecture.md. + # Exercises the `feature = "nightly-simd"` dispatch arm in + # `src/simd.rs` (added in Phase 2 / PR #173) so the portable + # `core::simd::*` backend doesn't bit-rot between PRs. + # + # Why nightly: `src/simd_nightly/*` uses `#![feature(portable_simd)]` + # which only compiles on nightly rustc. The stable `cargo check` + # paths in tests/clippy never reach this arm. + # + # `cargo check` rather than full build/test — pure type/borrow/cfg + # verification. Catches arm shadowing bugs and the kind of API-break + # codex flagged on PR #173 (lowercase aliases dropped). + # + # Runs only on merge_group + push (not every PR) to keep nightly + # toolchain pulls out of the per-PR critical path. Mirrors the + # `miri` job's gating strategy. + if: github.event_name == 'merge_group' || github.event_name == 'push' + runs-on: ubuntu-latest + name: nightly-simd-polyfill + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + - name: cargo check (nightly + nightly-simd feature) + run: cargo check -p ndarray --features approx,serde,rayon,nightly-simd + - name: cargo check (nightly + nightly-simd + hpc-extras) + run: cargo check -p ndarray --features approx,serde,rayon,nightly-simd,hpc-extras + blas-msrv: runs-on: ubuntu-latest name: blas-msrv @@ -310,6 +339,7 @@ jobs: - native-backend - hpc-stream-parallel - tier4-avx512-check + - nightly-simd-polyfill - miri - cross_test - cargo-careful