Skip to content

Commit 3c20392

Browse files
authored
Merge pull request #175 from AdaWorldAPI/claude/pr-x-phase6-avx512-ci
ci(simd): Phase 6 — AVX-512 dispatch check job
2 parents b4190e3 + f9d127a commit 3c20392

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,46 @@ 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+
# # Why `CARGO_TARGET_<triple>_RUSTFLAGS` instead of plain `RUSTFLAGS`:
189+
#
190+
# The first iteration used `env: RUSTFLAGS: "-Ctarget-cpu=x86-64-v4"`
191+
# and failed in ~23 s — RUSTFLAGS env applies to BOTH the target
192+
# compilation AND host build scripts (`build.rs` artifacts that
193+
# cargo runs natively). On a GH runner without AVX-512 silicon,
194+
# those v4-baked build scripts SIGILL during the dep build.
195+
#
196+
# `CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS` is documented to
197+
# apply only when cargo is producing artifacts for that triple, NOT
198+
# to host build scripts. Combined with explicit `--target` (so cargo
199+
# distinguishes host from target even when they're the same triple),
200+
# this gives us "v4 for our crate, baseline for build scripts."
201+
runs-on: ubuntu-latest
202+
name: tier4-avx512-check
203+
env:
204+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-D warnings -Ctarget-cpu=x86-64-v4"
205+
steps:
206+
- uses: actions/checkout@v4
207+
- uses: dtolnay/rust-toolchain@stable
208+
- uses: Swatinem/rust-cache@v2
209+
- name: cargo check (v4 / AVX-512 dispatch arm)
210+
run: cargo check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon
211+
- name: cargo check (v4 / AVX-512 + hpc-extras)
212+
run: cargo check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon,hpc-extras
213+
174214
blas-msrv:
175215
runs-on: ubuntu-latest
176216
name: blas-msrv
@@ -269,6 +309,7 @@ jobs:
269309
- tests
270310
- native-backend
271311
- hpc-stream-parallel
312+
- tier4-avx512-check
272313
- miri
273314
- cross_test
274315
- cargo-careful

0 commit comments

Comments
 (0)