Fix test incompatibilities with numpy 2.5 - #2376
Merged
juanitorduz merged 1 commit intoAug 24, 2026
Merged
Conversation
11 tasks
jessegrabowski
approved these changes
Aug 24, 2026
Member
|
i'd rather people not add the claude co-author line on their commits, but I am losing this battle. |
Contributor
Author
I can open a brand new PR (I did not know about this) |
Member
|
no need, just edit the commit message and force-push |
numpy 2.5 broke three tests on main (all CI jobs failing since it was picked up): - test_convolve2d seeded default_rng with a tuple containing the shape tuples; SeedSequence now raises "does not accept nested sequences". Flatten the seed entropy instead. - test_searchsortedOp_on_right_side and the numba test_Searchsorted compared np.searchsorted against the pytensor/numba implementations on UNSORTED arrays. That is documented undefined behavior, and numpy 2.5's reworked binary search now returns different (equally valid) results than the C/numba implementations. Use sorted inputs.
juanitorduz
force-pushed
the
fix-numpy-2.5-test-compat
branch
from
August 24, 2026 13:37
27ce089 to
176caed
Compare
Contributor
Author
|
Done: removed the co-author line and force-pushed (here and on #2375). |
Member
|
thanks, feel free to merge when ci is green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CI on
mainhas been failing since numpy 2.5 was picked up (e.g. this run on main) — 8 jobs fail, all reducing to three test-side incompatibilities:tests/tensor/signal/test_conv.py::test_convolve2d(108 parametrizations, alltensor scipy+blas+padjobs in every mode): the test seedednp.random.default_rng((172, kernel_shape, data_shape, sum(map(ord, mode))))— a tuple containing tuples. numpy 2.5'sSeedSequencerejects nested sequences withTypeError: SeedSequence does not accept nested sequences.Fixed by flattening the entropy tuple (still deterministic per parametrization).tests/tensor/test_extra_ops.py::TestSearchsortedOp::test_searchsortedOp_on_right_side(NUMBAtensor *restjobs) andtests/link/numba/test_extra_ops.py::test_Searchsorted[a1-v1-left-None-None](numba linkjob): both comparednp.searchsortedagainst the pytensor/numba implementations on unsorted arrays.searchsortedon unsorted input is documented undefined behavior; numpy 2.5's reworked binary search now returns different (equally valid) results than numba's reimplementation, so the comparisons diverge. (CVM-mode jobs kept passing because the C implementation delegates to numpy's own routine.) Fixed by using sorted inputs — the same patterntest_searchsortedOp_on_sorted_inputalready uses.Test-only changes; no library code touched. Verified locally with numpy 2.5.2: all 108
test_convolve2dparams, the fullTestSearchsortedOpsuite, and alltest_Searchsortedparams pass (110 failed before).These same failures currently show up on open PRs (e.g. #2375), where they are unrelated to the PR's changes.
Related Issue
main(run 32712791280) and red checks on open PRs such as Fix numba failure on gradient of chained batched Convolve1d #2375Checklist
Type of change