BUG: test_linear_interpolation_formula_symmetric fails on MacOS, local build of numpy and cpython
Author: iritkatrielCreated Jan 8, 2025Updated Sep 17, 2026
Labels00 - Bug05 - Testing
Describe the issue:
I'm using a local build of python and a local build of numpy (fresh checkouts of main branch). I deleted everything under numpy/distutils/tests/ because distutils no longer exists in cpython. I get the test failure below.
This seems to be a different problem than the one that was fixed in https://github.com/numpy/numpy/issues/22073.
Reproduce the code example:
numpy.test()Error message:
================================================================= FAILURES ==================================================================
___________________________________________ TestLerp.test_linear_interpolation_formula_symmetric ____________________________________________
self = <numpy.lib.tests.test_function_base.TestLerp object at 0x11bc33e10>
@hypothesis.given(t=st.floats(allow_nan=False, allow_infinity=False,
> min_value=0, max_value=1),
a=st.floats(allow_nan=False, allow_infinity=False,
min_value=-1e300, max_value=1e300),
b=st.floats(allow_nan=False, allow_infinity=False,
min_value=-1e300, max_value=1e300))
f = <function given.<locals>.run_test_as_given.<locals>.wrapped_test at 0x11bb99190>
self = <numpy.lib.tests.test_function_base.TestLerp object at 0x11bc33e10>
numpy/lib/tests/test_function_base.py:4157:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <numpy.lib.tests.test_function_base.TestLerp object at 0x11bc33e10>, t = 0.5, a = 562949953421314.0, b = -562949953421310.9
@hypothesis.given(t=st.floats(allow_nan=False, allow_infinity=False,
min_value=0, max_value=1),
a=st.floats(allow_nan=False, allow_infinity=False,
min_value=-1e300, max_value=1e300),
b=st.floats(allow_nan=False, allow_infinity=False,
min_value=-1e300, max_value=1e300))
def test_linear_interpolation_formula_symmetric(self, t, a, b):
# double subtraction is needed to remove the extra precision of t < 0.5
left = nfb._lerp(a, b, 1 - (1 - t))
right = nfb._lerp(b, a, 1 - t)
> assert_allclose(left, right)
E AssertionError:
E Not equal to tolerance rtol=1e-07, atol=0
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference among violations: 0.125
E Max relative difference among violations: 0.08333333
E ACTUAL: array(1.625)
E DESIRED: array(1.5)
E Falsifying example: test_linear_interpolation_formula_symmetric(
E self=<numpy.lib.tests.test_function_base.TestLerp object at 0x11bc33e10>,
E t=0.5,
E a=562949953421314.0,
E b=-562949953421310.9,
E )
E Explanation:
E These lines were always and only run by failing examples:
E /Users/iritkatriel/src/numpy-vanilla/numpy/_core/arrayprint.py:1002
E /Users/iritkatriel/src/numpy-vanilla/numpy/_core/arrayprint.py:950
E /Users/iritkatriel/src/numpy-vanilla/numpy/_core/arrayprint.py:997
E /Users/iritkatriel/src/numpy-vanilla/numpy/_core/fromnumeric.py:3049
E /Users/iritkatriel/src/numpy-vanilla/numpy/testing/_private/utils.py:830
E (and 3 more with settings.verbosity >= verbose)
E
E You can reproduce this example by temporarily adding @reproduce_failure('6.104.1', b'AXicY2BgOMCAAEwwkrGZ/z8IPAcAMDoHOg==') as a decorator on your test case
a = 562949953421314.0
b = -562949953421310.9
left = np.float64(1.625)
right = np.float64(1.5)
self = <numpy.lib.tests.test_function_base.TestLerp object at 0x11bc33e10>
t = 0.5
numpy/lib/tests/test_function_base.py:4166: AssertionError
========================================================== short test summary info ==========================================================
FAILED numpy/lib/tests/test_function_base.py::TestLerp::test_linear_interpolation_formula_symmetric - AssertionError:
1 failed, 46078 passed, 1776 skipped, 2637 deselected, 41 xfailed, 10 xpassed in 461.67s (0:07:41)
FalsePython and NumPy Versions:
>>> import sys, numpy; print(numpy.__version__); print(sys.version)
2.3.0.dev0+git20250102.12364e3
3.14.0a2+ (heads/main:c91ccbe4ac0, Jan 7 2025, 23:31:27) [Clang 16.0.0 (clang-1600.0.26.6)]Runtime Environment:
>>> import numpy; numpy.show_runtime()
[{'numpy_version': '2.3.0.dev0+git20250102.12364e3',
'python': '3.14.0a2+ (heads/main:c91ccbe4ac0, Jan 7 2025, 23:31:27) [Clang '
'16.0.0 (clang-1600.0.26.6)]',
'uname': uname_result(system='Darwin', node='Irits-MacBook-Pro.local', release='24.2.0', version='Darwin Kernel Version 24.2.0: Fri Dec 6 18:41:43 PST 2024; root:xnu-11215.61.5~2/RELEASE_X86_64', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}}]
>>>
Context for the issue:
No response
Source: numpy/numpy