Fix singular Z2m ring creation and polynomial comparison#40855
Merged
vbraun merged 1 commit intosagemath:developfrom Oct 27, 2025
Merged
Fix singular Z2m ring creation and polynomial comparison#40855vbraun merged 1 commit intosagemath:developfrom
vbraun merged 1 commit intosagemath:developfrom
Conversation
052cbc8 to
23522a2
Compare
23522a2 to
4d557f2
Compare
|
Documentation preview for this PR (built with commit 4d557f2; changes) is ready! 🎉 |
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Oct 20, 2025
sagemathgh-40855: Fix singular Z2m ring creation and polynomial comparison See the new test, previously it fails. The `n_Z2m` ring creation is caused by sagemath#39075. Singular source code contains ``` // is exponent <=2^(8*sizeof(unsigned long)) mp_bitcnt_t l=mpz_scan1 (modBase,0); if ((l>0) && (l<=8*sizeof(unsigned long))) { ``` so the limit is taken from there. The polynomial comparison fix is workaround for Singular/Singular#1293. sagemath#39018 touches this part of the code, although I think it doesn't introduce the bug. Fix sagemath#40838 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40855 Reported by: user202729 Reviewer(s): Travis Scrimshaw
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Oct 26, 2025
sagemathgh-40855: Fix singular Z2m ring creation and polynomial comparison See the new test, previously it fails. The `n_Z2m` ring creation is caused by sagemath#39075. Singular source code contains ``` // is exponent <=2^(8*sizeof(unsigned long)) mp_bitcnt_t l=mpz_scan1 (modBase,0); if ((l>0) && (l<=8*sizeof(unsigned long))) { ``` so the limit is taken from there. The polynomial comparison fix is workaround for Singular/Singular#1293. sagemath#39018 touches this part of the code, although I think it doesn't introduce the bug. Fix sagemath#40838 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40855 Reported by: user202729 Reviewer(s): Travis Scrimshaw
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.
See the new test, previously it fails.
The
n_Z2mring creation is caused by #39075.Singular source code contains
so the limit is taken from there.
The polynomial comparison fix is workaround for Singular/Singular#1293. #39018 touches this part of the code, although I think it doesn't introduce the bug.
Fix #40838
📝 Checklist
⌛ Dependencies