-
-
Notifications
You must be signed in to change notification settings - Fork 710
make sagelib work with singular>=4.3.2.p15 (future 4.4) #37492
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
Conversation
|
This is working fine for me and I'm releasing sagemath 10.3 on void linux with this patch and singular 4.3.2.p16 (with flint 3.1.2) |
|
best to remove "WIP:" from the title if it's ready |
I don't think this is ready unless we want to break support for older singular. |
|
Then probably "positive review" should be replaced by "needs work" |
680283a to
ad3aa56
Compare
|
First attempt at making this work with older singular |
| // coefficients: ZZ/127 | ||
| // number of vars : 3 | ||
| // block 1 : ordering rp | ||
| // block 1 : ordering ip |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this, but do we really want to skip testing that the correct ordering is used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need a mechanism to support backward compatibility. Sprinkling examples with regular expressions to fix stuff like this is quite ugly in terms of documentation.
Similar problems we have right now with gap 4.13 (#37616, see also #37590 (comment)) and all over the place with results that have to be sorted to compare, etc.
For numerical noise there's the # tol tag which affects how the output of a doctest is compared. For order, I think a tag # random_order may be preferable to having to sort in the example. What could we do for this case?
An alternative is to add code in SingularElement._repr_() so the output of old singular is changed into the output of new singular (i.e. replace ordering rp with ordering ip). But this seems a bit hacky...
| ringorder_lp | ||
| ringorder_dp | ||
| ringorder_rp | ||
| ringorder_ip |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| singular_name_mapping = { | ||
| 'lex' : 'lp', | ||
| 'invlex' : 'rp', | ||
| 'invlex' : invlex_singular_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be the only place we need a different code for different versions of singular.
| // coefficients: ZZ/2[a]/(a^8+a^4+a^3+a^2+1) | ||
| // number of vars : 10 | ||
| // block 1 : ordering rp | ||
| // block 1 : ordering ip |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
src/sage/libs/singular/ring.pyx
Outdated
| from sage.interfaces.singular import singular_version_number | ||
| if int(singular_version_number()[0:3]) < 432 or (int(singular_version_number()[0:3]) == 432 and int(singular_version_number()[3:]) < 15): | ||
| order_dict["rp"] = ringorder_rp | ||
| else: | ||
| order_dict["ip"] = ringorder_ip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unnecessary if we keep using ringorder_rp for the time being.
EDIT: wrong.. still need "rp" or "ip" 🤔
EDIT 2: Could just add both as in
"rp" : ringorder_rp, # this is deprecated
"ip" : ringorder_ip,
As a matter of fact, ringorder_rp is an alias for ringorder_ip in old and in new singular. The only thing changed now is the name "rp" was changed to "ip".
|
antonio-rojas/sage@singular-4.4...tornaria:sage:singular This is my attempt to support singular 4.3.2p10 and before. This is built on top of your first commit here, but I dropped the others.
I've tested with 4.3.2p10 (old) and 4.3.2p16 (new). If you like the approach, feel free to take my commits into your PR, rebase at will. I don't make a PR to your PR since I am dropping some of your commits. Note that I left out the stuff about |
|
@antonio-rojas I've rebased my branch develop...tornaria:sage:singular on top of 10.4.beta2. I adjusted the noexcept conflict in your commit, and my commits rebase cleanly. |
|
Documentation preview for this PR (built with commit d999b20; changes) is ready! 🎉 |
|
I've tested this with: The tests include a mixture of platforms where Singular is built from the SPKG or taken from the system. |
9667bdd to
bb5b360
Compare
|
I modified the ordering string replacement to happen only in doctests. Otherwis it can be confusing to get a different output for Singular code when run from inside Sage. |
|
Tested again with #37570 (and some other upgrades) with the full CI Linux in https://github.com/mkoeppe/sage/actions/runs/8761823524, looking good. |
|
Is there anything else to do here? From my side, this would be a positive review. |
Not that I'm aware of |
|
I have been including it in the latest beta release for sage-on-gentoo and everything looks fine. |
|
merge conflict |
Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
This reverts commit ad3aa56.
Function `hilb` now returns a `bigintvec` object and the coercion to a sage vector was implemented in the previous commit. Here we add a doctest for this coercion.
This makes the output independent of changes in the version of singular
Add two fallback compatibility `#define`s: - `ringorder_ip` - `BIGINTVEC_CMD` Also for old singular: - patch the term_order mappings to send `rp` to singular instead of `ip` - patch the display of a ring so it prints `ip` instead of `rp`
8f10ebc to
d999b20
Compare
|
Rebased over beta 4 |
sagemathgh-37492: make sagelib work with singular>=4.3.2.p15 (future 4.4) Two major breaking changes: - The `rp` ordering is renamed to `ip` - `hilb` now returns a `bigintvec` object (which isn't even exposed in the C++ API, seems to be an instance of `bigintmat`) This branch builds and works fine with 4.3.2.p15, but I have no idea how to make it work with both old and new singular, suggestions welcome. URL: sagemath#37492 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, Gonzalo Tornaría, Matthias Köppe
sagemathgh-37570: build/pkgs/singular: Update to 4.4.0 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Includes - [x] Singular/Singular#1205 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#37492 URL: sagemath#37570 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
sagemathgh-37570: build/pkgs/singular: Update to 4.4.0 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Includes - [x] Singular/Singular#1205 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#37492 URL: sagemath#37570 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
sagemathgh-37570: build/pkgs/singular: Update to 4.4.0 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Includes - [x] Singular/Singular#1205 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#37492 URL: sagemath#37570 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
sagemathgh-37570: build/pkgs/singular: Update to 4.4.0 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Includes - [x] Singular/Singular#1205 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#37492 URL: sagemath#37570 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
sagemathgh-37570: build/pkgs/singular: Update to 4.4.0 <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Includes - [x] Singular/Singular#1205 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> - Depends on sagemath#37492 URL: sagemath#37570 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
Two major breaking changes:
rpordering is renamed toiphilbnow returns abigintvecobject (which isn't even exposed in the C++ API, seems to be an instance ofbigintmat)This branch builds and works fine with 4.3.2.p15, but I have no idea how to make it work with both old and new singular, suggestions welcome.