Skip to content

avoid int32 overflows in indexing#17

Merged
ev-br merged 3 commits intoQuansight:masterfrom
ev-br:ilp64_2
Jun 3, 2025
Merged

avoid int32 overflows in indexing#17
ev-br merged 3 commits intoQuansight:masterfrom
ev-br:ilp64_2

Conversation

@ev-br
Copy link

@ev-br ev-br commented May 22, 2025

ILP64 tests will not run on CI. Locally, tested it via $ GULINALG_I32_TEST=1 pytest --pyargs gulinalg on a machine with enough memory.
For a standalone test:

$ cat test_i32_1.py 
import gulinalg as g
import numpy as np

N = 2**31

for i in range(5):
    a = np.ones((1, N+i), dtype=float)
    b = np.ones((N+i, 1), dtype=float)
    c = g.matrix_multiply(a, b)
    print(N+i, c == a @ b)

$ python test_i32_1.py 
2147483648 [[ True]]
2147483649 [[ True]]
2147483650 [[ True]]
2147483651 [[ True]]
2147483652 [[ True]]

@ev-br
Copy link
Author

ev-br commented Jun 3, 2025

Gave it one more read-through, it still makes sense. Let's land this to allow actual user testing. If any further issues surface in real-life usage, will be happy to fix!

@ev-br ev-br merged commit 709e2cb into Quansight:master Jun 3, 2025
8 checks passed
@ev-br ev-br added the bug Something isn't working label Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant