-
-
Notifications
You must be signed in to change notification settings - Fork 602
Incorrect answers given for ranks of large matrices. #35885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here's something:
The |
In joint work with S. Canning and H. Larson we also ran into the issue above. Investigating a bit, I do have some more evidence on what is happening. To see the issue, run the following modified code, which just returns the Vandermonde matrix:
Then if we just print a few entries of
It appears that entries of the matrix I am not super familiar with Cython, but that's what Claude seems to think: https://claude.ai/share/7eb823ff-44da-4a6a-b155-2495a0de77e1 @videlec Do you know what the best way is to proceed? This seems like a rather fundamental issue. |
Oh, for a minimal example of the error (not waiting an hour for the Vandermonde), just run the following code:
|
Indeed, there is possibly a too naive cast in
Both Though, I can not reproduce your example on my machine where sage 10.5 is installed. I got instead the following error message
|
About your experiment: you need a machine with 34 GB of free RAM, the above just says that you don't have enough memory available I think. What Claude was suspecting is that some
If the number |
There is such a call in
|
If your matrix happen to be a
The |
Hey, here is the output of the requested command:
I have compiled a sage branch from scratch before - if you provide a patch branch I can probably manage again. The large server I have access to runs a recent version of Fedora, so probably that should be manageable. So if you provide the fix, I'll try to test it! I guess you no longer have access to the MPI-Bonn servers? |
The PR is at #39671 (I do not know yet whether it compiles, so maybe you can wait for that). |
sagemathgh-39671: fix overflow in Matrix_modn_dense Replace use of `unsigned int` in matrix indices in favor of `Py_ssize_t` to avoid overflow. Fixes sagemath#35885 URL: sagemath#39671 Reported by: Vincent Delecroix Reviewer(s): Dima Pasechnik, schmittj, Vincent Delecroix
Is there an existing issue for this?
Did you read the documentation and troubleshoot guide?
Environment
Steps To Reproduce
On a machine with ample RAM, compute the rank of a matrix with more than 2^32 entries. For example, a Vandermonde matrix like so:
Expected Behavior
The rank should be computed correctly (or, failing that, an error should be raised saying that the matrix is too large).
Actual Behavior
The rank is computed incorrectly once there are more than 2^32 entries. For example, the above code prints 65536 for the rank of the 65537 x 65537 Vandermonde matrix. The user is not warned that the answer might not be correct.
Additional Information
No response
The text was updated successfully, but these errors were encountered: