From 21886ccdd376da6e1e612af88f2602ead04163ec Mon Sep 17 00:00:00 2001 From: gitRasheed Date: Sat, 4 Jul 2026 20:04:56 +0100 Subject: [PATCH] ci: pin numpy<2.5 to keep R parity cache keys stable numpy 2.5.1 (released today) bundles an OpenBLAS whose SVD kernels differ on some GitHub runner CPUs. tests/parity/test_co_moments.py generates inputs with rng.multivariate_normal (LAPACK SVD, outside numpy's random-stream stability guarantee), and tests/_r.py hashes those inputs into R cache keys, so a last-ulp difference on an unlucky runner produces mass cache-miss failures (120 on the main run for the PR #76 merge; runner-dependent, not caused by that PR - the same commit content passed 20 minutes earlier on other runners). Pin the four workflows that install numpy unpinned to <2.5, matching the cache-era 2.4.x used by the committed uv.lock. Durable fix to schedule with the next live-R cache regeneration: generate correlated test inputs with an explicit 2x2 Cholesky over standard_normal draws (bit-stable pure arithmetic) instead of multivariate_normal. --- .github/workflows/inspect-r-api-update.yml | 6 +++++- .github/workflows/native-backend-ci.yml | 6 +++++- .github/workflows/parity-autofix.yml | 6 +++++- .github/workflows/sync-from-nns-core.yml | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/inspect-r-api-update.yml b/.github/workflows/inspect-r-api-update.yml index dc0db3d4..03f43de9 100644 --- a/.github/workflows/inspect-r-api-update.yml +++ b/.github/workflows/inspect-r-api-update.yml @@ -72,7 +72,11 @@ jobs: - name: Install Python build and test tools run: | python -m pip install -U pip - python -m pip install build scikit-build-core nanobind pytest ruff mypy numpy scipy + # numpy pinned <2.5: the R parity cache keys hash test inputs generated via + # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD + # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing + # cache misses. Re-evaluate at the next full live-R cache regeneration. + python -m pip install build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy python -m pip install hypothesis pytest-benchmark pytest-xdist - name: Plan R API parity review diff --git a/.github/workflows/native-backend-ci.yml b/.github/workflows/native-backend-ci.yml index 67f09d6f..8ed7976c 100644 --- a/.github/workflows/native-backend-ci.yml +++ b/.github/workflows/native-backend-ci.yml @@ -25,7 +25,11 @@ jobs: - name: Install build tools run: | python -m pip install -U pip - python -m pip install build scikit-build-core nanobind pytest ruff mypy numpy scipy + # numpy pinned <2.5: the R parity cache keys hash test inputs generated via + # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD + # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing + # cache misses. Re-evaluate at the next full live-R cache regeneration. + python -m pip install build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy python -m pip install hypothesis pytest-benchmark pytest-xdist - name: Install package editable diff --git a/.github/workflows/parity-autofix.yml b/.github/workflows/parity-autofix.yml index 004ad94f..861211ca 100644 --- a/.github/workflows/parity-autofix.yml +++ b/.github/workflows/parity-autofix.yml @@ -86,7 +86,11 @@ jobs: - name: Install Python build and test tools run: | python -m pip install -U pip - python -m pip install build scikit-build-core nanobind pytest ruff mypy numpy scipy + # numpy pinned <2.5: the R parity cache keys hash test inputs generated via + # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD + # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing + # cache misses. Re-evaluate at the next full live-R cache regeneration. + python -m pip install build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy python -m pip install hypothesis pytest-benchmark pytest-xdist - name: Install package editable diff --git a/.github/workflows/sync-from-nns-core.yml b/.github/workflows/sync-from-nns-core.yml index d0daa2ee..a0927c5b 100644 --- a/.github/workflows/sync-from-nns-core.yml +++ b/.github/workflows/sync-from-nns-core.yml @@ -69,7 +69,11 @@ jobs: - name: Install build tools run: | python -m pip install -U pip - python -m pip install build scikit-build-core nanobind pytest ruff mypy numpy scipy + # numpy pinned <2.5: the R parity cache keys hash test inputs generated via + # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD + # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing + # cache misses. Re-evaluate at the next full live-R cache regeneration. + python -m pip install build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy python -m pip install hypothesis pytest-benchmark pytest-xdist - name: Vendor NNS-core snapshot