Skip to content

Commit c79ee31

Browse files
authored
Merge pull request #361 from AdaWorldAPI/ccr-9f3b8075-74u47l-spr-check
ci: compile both production tiers (x86-64-v4 and sapphirerapids)
2 parents 21948f8 + 87ee47b commit c79ee31

3 files changed

Lines changed: 40 additions & 8 deletions

File tree

‎.cargo/config-avx512.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@
4747
# see the LazyLock runtime dispatch path in § 7.1 of the architecture
4848
# doc instead.
4949
[target.'cfg(target_arch = "x86_64")']
50-
rustflags = ["-Ctarget-cpu=sapphirerapids"]
50+
# `-Dwarnings` matches config-v4.toml, so both CI tier checks gate warnings.
51+
rustflags = ["-Ctarget-cpu=sapphirerapids", "-Dwarnings"]

‎.claude/blackboard.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2026-10-13 — CI compiles both production tiers: x86-64-v4 and Sapphire Rapids
2+
3+
- **Change:** `tier4-avx512-check` in `ci.yaml` is now a two-entry matrix, `x86-64-v4` (`.cargo/config-v4.toml`) and `sapphirerapids` (`.cargo/config-avx512.toml`). Each entry runs both `cargo check` feature sets and the asm-only codegen witness. Neither is executed: GitHub's runners are mostly v3. `config-avx512.toml` gains `-Dwarnings`, matching `config-v4.toml`, so both entries gate warnings and the witness script (which word-splits `CARGO_ARGS`) needs no extra quoted `--config`. The job sets `CARGO_PROFILE_{DEV,TEST}_DEBUG=0`: with `--target`, build scripts take the profile's debug level.
4+
- **Why:** production runs on x86-64-v4 or better, and Railway hosts are Sapphire Rapids, Emerald Rapids or newer (maintainer). lance-graph's canonical deploy file now builds `sapphirerapids`, so the VNNI/BF16/FP16 code paths must at least compile in CI.
5+
- **Measured here (Cascade Lake host, which lacks BF16/FP16 so nothing was run):** `cargo check` at `sapphirerapids` with `-Dwarnings` passes for `approx,serde,rayon` and `+hpc-extras`; the rustc call for ndarray carries `-Ctarget-cpu=native`, then `-Ctarget-cpu=sapphirerapids` (the later one wins), then `-Dwarnings`; the codegen witness passes (1, 1 and 6 `vpternlog`).
6+
- **Open:** the global `RUSTFLAGS` crypto cfgs (dalek, poly1305) are dropped by this job's `env -u RUSTFLAGS`, as before; unchanged here.
7+
18
## 2026-10-13 — build-time warning for target features `cpu_guard` cannot check
29

310
- **Change:** new `build.rs` + `src/cpu_guard_drift.rs` (shared by `build.rs` and the tests via `include!`). On x86_64 the build script reads `CARGO_CFG_TARGET_FEATURE` and the guard's `"name" =>` rows and prints `cargo:warning=` for every enabled feature without a row. Without a row the guard never compares that feature with the running CPU, so the binary passes the guard and can still SIGILL; a toolchain bump that lets LLVM enable a newer feature is the usual cause.

‎.github/workflows/ci.yaml‎

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,22 +300,46 @@ jobs:
300300
# own rustflags list so the warning gate is not lost. (The same global
301301
# env also erases the v3 pin and the dalek/poly1305 cfgs for every other
302302
# x86 job — a pre-existing gap, recorded in the blackboard, not this PR's.)
303+
#
304+
# # Two tiers (2026-10-13):
305+
#
306+
# Production runs on x86-64-v4 or better; the canonical deploy build is
307+
# Sapphire Rapids (`.cargo/config-avx512.toml`: VNNI, BF16, FP16 on top
308+
# of v4). Neither can run on GitHub's mostly-v3 runners, so both are
309+
# compiled and never executed. Both config files carry `-Dwarnings`.
310+
# Debug info is off for every artifact
311+
# (`CARGO_PROFILE_*_DEBUG=0`): `--target` keeps RUSTFLAGS-style flags off
312+
# build scripts, which then take the profile's debug level.
303313
runs-on: ubuntu-latest
304-
name: tier4-avx512-check
314+
name: tier4-avx512-check (${{ matrix.tier }})
315+
strategy:
316+
fail-fast: false
317+
matrix:
318+
include:
319+
- tier: x86-64-v4
320+
config: --config .cargo/config-v4.toml
321+
- tier: sapphirerapids
322+
config: --config .cargo/config-avx512.toml
323+
env:
324+
CARGO_PROFILE_DEV_DEBUG: "0"
325+
CARGO_PROFILE_TEST_DEBUG: "0"
326+
CARGO_INCREMENTAL: "0"
305327
steps:
306328
- uses: actions/checkout@v4
307329
- uses: dtolnay/rust-toolchain@stable
308330
- uses: Swatinem/rust-cache@v2
309-
- name: cargo check (v4 / AVX-512 dispatch arm)
310-
run: env -u RUSTFLAGS cargo --config .cargo/config-v4.toml check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon
311-
- name: cargo check (v4 / AVX-512 + hpc-extras)
312-
run: env -u RUSTFLAGS cargo --config .cargo/config-v4.toml check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon,hpc-extras
313-
- name: prove the arm actually selected (a v4 build must emit vpternlog)
331+
with:
332+
key: ${{ matrix.tier }}
333+
- name: cargo check (${{ matrix.tier }} / AVX-512 dispatch arm)
334+
run: env -u RUSTFLAGS cargo ${{ matrix.config }} check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon
335+
- name: cargo check (${{ matrix.tier }} / AVX-512 + hpc-extras)
336+
run: env -u RUSTFLAGS cargo ${{ matrix.config }} check --target=x86_64-unknown-linux-gnu -p ndarray --features approx,serde,rayon,hpc-extras
337+
- name: prove the arm actually selected (an AVX-512 build must emit vpternlog)
314338
# Runs the witness script in asm-only mode (this runner may lack
315339
# avx512f, so the probe is never executed here) rather than an inline
316340
# copy: the script owns the stale-assembly guard (`rm -f` + `touch` of
317341
# the probe source, without which a rust-cache hit re-emits no `.s`).
318-
run: env -u RUSTFLAGS WITNESS_NO_RUN=1 CARGO_ARGS='--config .cargo/config-v4.toml' bash scripts/codegen-witness.sh avx512
342+
run: env -u RUSTFLAGS WITNESS_NO_RUN=1 CARGO_ARGS="${{ matrix.config }}" bash scripts/codegen-witness.sh avx512
319343

320344
nightly-simd-polyfill:
321345
# TD-SIMD-9 from .claude/knowledge/simd-dispatch-architecture.md.

0 commit comments

Comments
 (0)