From 778b2e81a37a166b5879eb8d7f07832431856517 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 7 Jul 2026 23:23:16 +0200 Subject: [PATCH] Fix test_validate_transcendentals skip to match SVML dispatch Resolves: RHEL-161528 --- ...test_validate_transcendentals-x86_64.patch | 40 +++++++++++++++++++ python3.14-numpy.spec | 7 +++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 fix-test_validate_transcendentals-x86_64.patch diff --git a/fix-test_validate_transcendentals-x86_64.patch b/fix-test_validate_transcendentals-x86_64.patch new file mode 100644 index 0000000..e575a0f --- /dev/null +++ b/fix-test_validate_transcendentals-x86_64.patch @@ -0,0 +1,40 @@ +From 8845f7ac440a6469e84030847c2271930a1d538b Mon Sep 17 00:00:00 2001 +From: Charalampos Stratakis +Date: Sat, 25 Apr 2026 05:03:20 +0200 +Subject: [PATCH] TST: fix test_validate_transcendentals skip condition to + match SVML dispatch + +The test was running on machines with FMA3+AVX2 or AVX512F, but the +SVML code path requires AVX512_SKX (F+BW+DQ+VL). On machines without +AVX512_SKX, the glibc libm scalar fallback is used, which exceeds the +2 ULP tolerance for some float64 cbrt inputs. +--- + numpy/_core/tests/test_umath_accuracy.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/numpy/_core/tests/test_umath_accuracy.py b/numpy/_core/tests/test_umath_accuracy.py +index 5707e92..2c44e97 100644 +--- a/numpy/_core/tests/test_umath_accuracy.py ++++ b/numpy/_core/tests/test_umath_accuracy.py +@@ -18,14 +18,14 @@ + UNARY_OBJECT_UFUNCS.remove(np.invert) + UNARY_OBJECT_UFUNCS.remove(np.bitwise_count) + +-IS_AVX = __cpu_features__.get('AVX512F', False) or \ +- (__cpu_features__.get('FMA3', False) and __cpu_features__.get('AVX2', False)) ++# SVML is only dispatched on AVX512_SKX (see loops_umath_fp.dispatch.c.src) ++IS_SVML = __cpu_features__.get('AVX512_SKX', False) + + IS_AVX512FP16 = __cpu_features__.get('AVX512FP16', False) + +-# only run on linux with AVX, also avoid old glibc (numpy/numpy#20448). ++# only run on linux with SVML, also avoid old glibc (numpy/numpy#20448). + runtest = (sys.platform.startswith('linux') +- and IS_AVX and not _glibc_older_than("2.17")) ++ and IS_SVML and not _glibc_older_than("2.17")) + platform_skip = pytest.mark.skipif(not runtest, + reason="avoid testing inconsistent platform " + "library implementations") +-- +2.54.0 + diff --git a/python3.14-numpy.spec b/python3.14-numpy.spec index ca577d9..47fd4ee 100644 --- a/python3.14-numpy.spec +++ b/python3.14-numpy.spec @@ -44,6 +44,10 @@ Source0: https://github.com/%{modname}/%{modname}/releases/download/v%{ve # https://github.com/numpy/numpy/pull/31819 Patch: coverity-fixes.patch +# Fix test_validate_transcendentals skip to match SVML dispatch +# Sent upstream: https://github.com/numpy/numpy/pull/31333 +Patch: fix-test_validate_transcendentals-x86_64.patch + BuildRequires: python%{python3_pkgversion}-devel BuildRequires: gcc-gfortran gcc gcc-c++ BuildRequires: lapack-devel @@ -217,7 +221,8 @@ export PYTHONPATH=%{buildroot}%{python3_sitearch} %changelog * Tue Jul 07 2026 Charalampos Stratakis - 2.3.4-2 - Fix issues identified via Coverity static analysis -- Fixes: RHEL-137130 +- Fix test_validate_transcendentals skip to match SVML dispatch +- Fixes: RHEL-137130, RHEL-161528 * Thu Oct 23 2025 Tomáš Hrnčiar - 2.3.4-1 - Initial import