Skip to content

Commit 45b1bfe

Browse files
committed
ci(simd): Phase 6 — AVX-512 dispatch check job
Phase 6 of the integration plan in `.claude/knowledge/ simd-dispatch-architecture.md`. Adds a new `tier4-avx512-check` job that compiles the crate with `-Ctarget-cpu=x86-64-v4` so the `#[cfg(target_feature = "avx512f")]` dispatch arm in `src/simd.rs` is exercised on every PR. Without this the AVX-512 code path bit-rots under the v3 default (`x86-64-v3` baseline in `.cargo/config.toml`) — it compiles only when a developer happens to build locally with `--config .cargo/config-avx512.toml`. Implementation notes -------------------- * `cargo check` instead of `cargo test`/`cargo build`. GH-hosted `ubuntu-latest` runners have intermittent AVX-512 silicon across VM SKUs (Azure D-series mix); a v4-baked binary would SIGILL on a non-AVX-512 host. `check` compiles through type/borrow/monomorphization without producing a runnable artifact — catches the dispatch-arm type mismatches that motivated this PR series in the first place (PR #170 CI failure mode). * Job-level `env: RUSTFLAGS: "-D warnings -Ctarget-cpu=x86-64-v4"` overrides the global `RUSTFLAGS="-D warnings"` set at the top of `ci.yaml`. Without the override, `.cargo/config-avx512.toml`'s rustflags would be ignored — env wins over config file in cargo's precedence (the same issue that broke PR #172 with the v3 setting in config.toml). * Two check passes: default features + `hpc-extras`. The latter pulls the p64/fractal dep tree which exercises a different slice of the AVX-512 codepaths (BF16 RNE, AMX byte-asm). Each runs ~30 s with Swatinem cache hit, ~3 min cold. * Added to the `conclusion` job's `needs` list so a v4 check failure blocks merge.
1 parent a18366a commit 45b1bfe

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,38 @@ jobs:
171171
- name: clippy --features rayon
172172
run: cargo clippy -p ndarray --features rayon --lib -- -D warnings
173173

174+
tier4-avx512-check:
175+
# Phase 6 of the SIMD integration plan (.claude/knowledge/
176+
# simd-dispatch-architecture.md). Exercises the AVX-512 dispatch
177+
# arm (`#[cfg(target_feature = "avx512f")]` in `src/simd.rs`) so it
178+
# doesn't bit-rot under the v3-default cargo config.
179+
#
180+
# `cargo check` rather than `cargo test`: GH-hosted `ubuntu-latest`
181+
# runners may not have AVX-512 silicon (intermittent across SKUs),
182+
# so a v4-baked binary would SIGILL at run time. `check` compiles
183+
# the AVX-512 code path through the type checker + borrow checker
184+
# + monomorphization without producing a runnable artifact —
185+
# catches type mismatches and dispatch-arm holes that the v3
186+
# default never touches.
187+
#
188+
# The job-level `RUSTFLAGS` env overrides the global
189+
# `RUSTFLAGS="-D warnings"` set at the top of this file so the v4
190+
# target-cpu actually applies. Without the override, `.cargo/
191+
# config-avx512.toml`'s rustflags would be ignored (env wins over
192+
# config file in cargo's precedence).
193+
runs-on: ubuntu-latest
194+
name: tier4-avx512-check
195+
env:
196+
RUSTFLAGS: "-D warnings -Ctarget-cpu=x86-64-v4"
197+
steps:
198+
- uses: actions/checkout@v4
199+
- uses: dtolnay/rust-toolchain@stable
200+
- uses: Swatinem/rust-cache@v2
201+
- name: cargo check (v4 / AVX-512 dispatch arm)
202+
run: cargo check -p ndarray --features approx,serde,rayon
203+
- name: cargo check (v4 / AVX-512 + hpc-extras)
204+
run: cargo check -p ndarray --features approx,serde,rayon,hpc-extras
205+
174206
blas-msrv:
175207
runs-on: ubuntu-latest
176208
name: blas-msrv
@@ -269,6 +301,7 @@ jobs:
269301
- tests
270302
- native-backend
271303
- hpc-stream-parallel
304+
- tier4-avx512-check
272305
- miri
273306
- cross_test
274307
- cargo-careful

0 commit comments

Comments
 (0)