Open rgommers opened 2 days ago
Some of the NumPy wheels at https://anaconda.org/scientific-python-nightly-wheels/numpy/files are 11 days old, which is due to gh-26810. So if the fix landed already in numpy's main
branch, it may still not have propagated.
I'm able to reproduce random failures and seg faults on this test using the wheel. I think rebuilding it will make this test more stable.
That said, I do see a failure running a different test in the same file on the latest numpy main
:
No idea why this fails randomly (a few percent of the time on my M3 Mac) in this way.
Thanks for checking @ngoldbaum.
That second failure looks like a problem in either CPython or Cython:
self = <concurrent.futures.thread.ThreadPoolExecutor object at 0x266bfb95f10>
fn = functools.partial(<function dwt at 0x266bfcc05a0>, wavelet='haar')
args = (array([1., 1., 1., 1., 1., 1., 1., 1.]),), kwargs = {}
def submit(self, fn, /, *args, **kwargs):
> with self._shutdown_lock, _global_shutdown_lock:
E TypeError: descriptor '__enter__' for '_thread.RLock' objects doesn't apply to a '_thread.lock' object
args = (array([1., 1., 1., 1., 1., 1., 1., 1.]),)
fn = functools.partial(<function dwt at 0x266bfcc05a0>, wavelet='haar')
kwargs = {}
self = <concurrent.futures.thread.ThreadPoolExecutor object at 0x266bfb95f10>
../../.pyenv/versions/3.13.0b2-nogil/lib/python3.13/concurrent/futures/thread.py:165: TypeError
=============================== short test summary info ================================
FAILED pywt/tests/test_concurrent.py::test_concurrent_dwt - TypeError: descriptor '__enter__' for '_thread.RLock' objects doesn't apply to a '_thread.lock' object
============================= 1 failed, 3 passed in 0.39s ===================
I can't find any existing bug report for this; _thread.RLock
does have a ton of bug reports related to it not being pickle-able, but nothing is doing that in this test case.
We have a set of concurrent tests that use
concurrent.futures.ThreadPoolExecutor
. It has never failed before AFAIK; the tests also passed a number of times already with the new Linux free-threaded CI. It just now failed for the first time in the macOS arm64 free-threaded wheel build job (from the CI log):That looks like a missing lock around a cache in NumPy, which is probably already fixed by one of @ngoldbaum's PRs.