From 6a7bcd0a7e246e3e462b3358849c263a4d995ad9 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Wed, 14 Oct 2026 16:06:43 +0900 Subject: [PATCH] fix: exclude OpenBLAS 0.3.34 from the development environment The modal and stack_modal tests stopped with an access violation inside openblas.dll on some hosted CI runners, and on every run on an AMD Zen 4 workstation. The fault is in OpenBLAS 0.3.34, not in CableDyn: a plain DGEMM with an inner dimension above 128 reproduces it with no CableDyn code loaded, and 0.3.33 runs the same calls cleanly. OpenBLAS 0.3.34 enlarges the GEMM blocking on AMD Zen 4/5 CPUs that expose AVX-512, and its Zen and Haswell DGEMM kernels then overrun their stack buffer. It is reached in builds without the AVX-512 kernels, such as the conda-forge Windows package, and with a forced OPENBLAS_CORETYPE (OpenMathLib/OpenBLAS#6013, #6021, fixed upstream after 0.3.34). The dense DSYGV reference of test_modal reached it; the solver's banded LAPACK calls never pass DGEMM an inner dimension above 128, and the release executables use reference LAPACK, so results are unchanged. The CI failures were intermittent because only some runners expose AVX-512. Exclude 0.3.34 in environment.yml, which CI also uses, so that the next OpenBLAS release is admitted, and record the cause in the changelog and the troubleshooting table of DEVELOPMENT.md. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 15 +++++++++++++++ DEVELOPMENT.md | 1 + environment.yml | 9 ++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06114682..efd8f9d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,21 @@ All notable changes to CableDyn are recorded in this file. The format follows ## [Unreleased] +### Fixed + +- The development environment (`environment.yml`) excludes OpenBLAS 0.3.34, which caused the + access violation in the modal analysis tests listed under Known issues for 0.1.1. On AMD + Zen 4 and Zen 5 CPUs that expose AVX-512, OpenBLAS 0.3.34 enlarges the GEMM blocking, + and its Zen and Haswell DGEMM kernels then overrun their stack buffer for an inner + dimension above 128. This happens in builds without the AVX-512 kernels, such as the + conda-forge Windows package, and in any build when `OPENBLAS_CORETYPE` forces one of these + kernels (OpenMathLib/OpenBLAS#6013 and #6021). The dense reference eigensolve + (`DSYGV`) of the modal tests reached it. On hosted CI runners the fault appeared only on + those runners whose AMD CPU exposed AVX-512. The solver itself calls only banded LAPACK + routines and a 4 × 4 eigensolve, none of which passes DGEMM an inner dimension above 128, + and the released Windows executables use reference LAPACK, so results are unchanged. An existing environment takes the exclusion with + `conda env update -f environment.yml`, followed by a fresh build directory. + ## [0.1.1] - 2026-10-09 ### Added diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 5d3d7f13..bad3ba8e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -189,3 +189,4 @@ for details. | `find_package(LAPACK)` fails | no system LAPACK | install `liblapack-dev`, or build inside the conda environment | | Python exits while importing NumPy on Windows | runtime DLL directories on `PATH` | remove them from `PATH`; set `CABLEDYN_LIBRARY` instead | | Windows checkout differs from CI | CRLF line endings | `.gitattributes` enforces LF; run `git add --renormalize .` | +| `modal` test stops with an access violation in `openblas.dll` (AMD Zen 4/5) | OpenBLAS 0.3.34 DGEMM stack overrun (OpenMathLib/OpenBLAS#6013) | `conda env update -f environment.yml`, which excludes 0.3.34, then configure a fresh build directory: the build keeps a staged `openblas.dll` that is newer than the package's | diff --git a/environment.yml b/environment.yml index 2ef5cb06..2aec7fb0 100644 --- a/environment.yml +++ b/environment.yml @@ -45,7 +45,14 @@ dependencies: # BLAS / LAPACK — linked by the Fortran core (banded DGBSV/DGBTRF/DGBTRS and # DPBTRF/DPBTRS; DSBGVX, DSYGV and DSYEV for modal analysis). - - openblas + # + # OpenBLAS 0.3.34 is excluded: on AMD Zen 4/5 CPUs that expose AVX-512, its Zen and + # Haswell DGEMM kernels overrun their stack buffer for an inner dimension above 128 + # in builds without the AVX-512 kernels (the win-64 package), or with a forced + # OPENBLAS_CORETYPE (OpenMathLib/OpenBLAS#6013, #6021; fixed after 0.3.34). The dense + # modal reference (DSYGV) of test_modal faulted there. + - openblas !=0.3.34 + - libopenblas !=0.3.34 - liblapack # Formatting / local commit hooks for Fortran development.