From 11c326739af7921d12bc4764203c3539a1325453 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 8 Oct 2026 20:48:57 +0000 Subject: [PATCH] simd-matrix: key the native-resolving caches by the runner's target features The nightly and host-native rows build under target-cpu=native on a heterogeneous runner pool, but cached under a job-only key. A proc-macro .so compiled for one runner's CPU was restored on another and rustc died loading it (SIGILL in the cached paste .so, ndarray #344). Key both caches by the target features rustc resolves for native on the runner. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFw2WdKr1oxvaKCJC2ua2R --- .github/workflows/simd-matrix.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/simd-matrix.yaml b/.github/workflows/simd-matrix.yaml index a2cc781c..7ab27bbb 100644 --- a/.github/workflows/simd-matrix.yaml +++ b/.github/workflows/simd-matrix.yaml @@ -154,7 +154,18 @@ jobs: with: persist-credentials: false - uses: dtolnay/rust-toolchain@stable + # The build below resolves `target-cpu=native` on THIS runner, and the + # pool is heterogeneous (see host-native). A cache keyed only by job + # restores proc-macro .so files compiled for another runner's CPU, and + # rustc dies loading them with SIGILL (seen on ndarray #344: the cached + # `paste` .so). Key the cache by the target features rustc resolves for + # `native` here, which is exactly what decides those artifacts. + - name: native target features (cache key) + id: cpu + run: echo "features=$(rustc +stable --print cfg -C target-cpu=native | grep target_feature | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT" - uses: Swatinem/rust-cache@v2 + with: + key: host-native-${{ steps.cpu.outputs.features }} - name: what silicon is this runner run: lscpu | sed -n '1,/^Flags/p' | head -30 - name: masking parity (host-native, unpinned — READ THE HEADER LINE) @@ -272,9 +283,18 @@ jobs: with: persist-credentials: false - uses: dtolnay/rust-toolchain@nightly + # The build below resolves `target-cpu=native` on THIS runner, and the + # pool is heterogeneous (see host-native). A cache keyed only by job + # restores proc-macro .so files compiled for another runner's CPU, and + # rustc dies loading them with SIGILL (seen on ndarray #344: the cached + # `paste` .so). Key the cache by the target features rustc resolves for + # `native` here, which is exactly what decides those artifacts. + - name: native target features (cache key) + id: cpu + run: echo "features=$(rustc +nightly --print cfg -C target-cpu=native | grep target_feature | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT" - uses: Swatinem/rust-cache@v2 with: - key: nightly + key: nightly-${{ steps.cpu.outputs.features }} - name: masking parity (nightly-simd) run: bash scripts/masking-parity.sh nightly - name: lib tests on the nightly arm