-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
zn_poly removal #32841
Comments
Branch: u/mjo/ticket/32841 |
Author: Michael Orlitzky |
Commit: |
Last 10 new commits:
|
comment:2
There's a discussion on sage-devel about how much/whether we're giving up speed by switching from zn_poly to NTL. I'd like to do some benchmarking before removing this package. |
comment:3
No problem, I'm not in a hurry. Is it even possible to hit the zn_poly branch from within the normal sage user interface? The only call to |
comment:4
Yes. Line 257 of hypellfrob.pyx calls |
comment:5
Replying to @roed314:
Ah, I didn't see |
comment:6
Has anyone asked David Harvey about this? |
comment:7
Replying to @JohnCremona:
No, but his webpage is pretty clear:
It's maintained by the sage team and essentially has been (via patches) for over a decade. With all due respect, if he's not going to help maintain the code, what can his opinion change? If there's a huge performance regression (I'll need help with realistic test cases that don't make zn_poly fail and fall back to NTL unusually often), then we'll have to keep it around until NTL gets faster. But otherwise, the decision whether to keep it for nostalgia's sake alone should rest with the people who are going to have to maintain it. |
comment:8
I've been throwing examples at this for an hour or so. I've hacked my local tree to make I'll cut to the chase: the biggest difference between the two in favor of zn_poly is on the order of...
Typically, they're a bit closer together, with zn_poly having a slight edge. And when zn_poly fails, of course, the NTL-only strategy wins by a huge margin (however long it takes zn_poly to fail). So the question is, is a slowdown like this (for the cases that zn_poly can handle) a deal-breaker, considering the improvement in the cases it cannot? |
comment:9
My suggestion would be to downgrade |
comment:10
Replying to @mkoeppe:
I'm willing to do this, but first, can I selfishly request at least one user come forward who would actually use it? |
comment:12
As one of the people who initially requested a speed comparison, I'm content with the removal of I'll check with Alex to see if he agrees, and then am happy to review this. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
|
comment:19
needs a rebase |
Last 10 new commits:
|
Changed branch from u/mjo/ticket/32841 to u/dimpase/ticket/32841 |
Reviewer: Dima Pasechnik |
comment:21
Thanks, I don't have sage built anywhere at the moment so it would have taken me a lot longer to do that. |
comment:22
I'll hit "positive review" as soon as tests are run and OK |
comment:23
it works, and so let Sage have one obsolete dependency less. |
Changed branch from u/dimpase/ticket/32841 to |
This function isn't used anywhere in the sage library, and according to its own documentation, "is a technology preview. It might disappear or be replaced without a deprecation warning." Today is that day.
This file uses the assert() macro provided by <cassert> in C++. In the past it was included transitively; but soon it won't be, so.
Our interval_products_wrapper() wrapped three different implementations: * ntl_interval_products (ZZ_p version) * ntl_interval_products (zz_p version) * zn_poly_interval_products But "the zn_poly version occasionally fails," and when that happens, the NTL implementation is used anyway. Moreover the wrapper takes a "force_ntl" parameter that allows the user to skip the zn_poly attempt entirely. This is the only place that zn_poly is actually used in sagelib anymore, so this commit removes the underlying zn_poly implementation, and eliminates the "force_ntl" parameter that was propagated throughout the "hypellfrob" code. Now NTL is always used, as if force_ntl was enabled.
…mment. The zn_poly package has been removed, so this could only confuse people if we left it in.
…ples. We have a few doctests that list all sage packages, and expect zn_poly to be the last one listed. Having removed zn_poly, however, zlib is now the terminal package. Here we update all such tests.
…ows. The zn_poly SPKG has been removed, so we should not try to build it as part of the cygwin workflows.
The zn_poly SPKG has been removed, so its license no longer affects that of the larger SageMath project.
Being alphabetically ultimate, the "zn_poly" package appears as an example in a few places within our README.md. This commit replaces those examples with "zlib" instead, as zn_poly has been removed.
This tutorial mentions the Harvey-Kedlaya algorithm that "depends only on NTL and zn_poly." But zn_poly has just been excised from that module, and its SPKG removed from SageMath. This commit changes the wording to say "depends only on NTL" instead.
The flint_wrap.h and flint_ntl_wrap.h headers mention "zn_poly and pari" as reasons for doing something specific. The zn_poly SPKG has been removed, however; so we update those comments to mention only pari.
<!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> ### 📚 Description <!-- Describe your changes here in detail --> Cygwin workflows were mangled by a bad merge, leading to syntax errors even whenever the workflow is parsed. Here we fix this; note that the Cygwin workflow is still not functional afterward (the first step, installation of Cygwin with choco, fails). But this will only affect builds of releases and does not happen for PR CI runs. <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> Closes #35048 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open pull requests that this PR logically depends on --> <!-- - #xyz: short description why this is a dependency - #abc: ... -->
The zn_poly SPKG is used by sage in only one place. In hypellfrob.cpp's
interval_products_wrapper()
, there is a case...But sometimes that fails, and the fallback is to use NTL anyway. The zn_poly project was abandoned upstream in 2008:
https://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/index.html
We've forked it to keep it building on modern systems,
https://gitlab.com/sagemath/zn_poly
but the build system is still a mess. Erik started an autotools branch (https://gitlab.com/sagemath/zn_poly/-/tree/autotooling), but it never got finished, because the source layout is a bit weird for autotools and it should most likely be redone from scratch.
And zn_poly is not packaged in Gentoo because of how many hacks it still requires to build on a distro with stronger user experience expectations:
https://github.com/cschwan/sage-on-gentoo/blob/master/sci-libs/zn_poly/zn_poly-0.9.2.ebuild
In short, we're not getting a lot of benefit out of zn_poly these days, and nothing breaks if we remove it, because the one function that uses it falls back to the more-reliable NTL anyway.
In this ticket we remove the zn_poly SPKG, to avoid having to rewrite its build system some day.
CC: @alexjbest
Component: packages: standard
Author: Michael Orlitzky
Branch/Commit:
a5ac5fc
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/32841
The text was updated successfully, but these errors were encountered: