-
Notifications
You must be signed in to change notification settings - Fork 59
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
Prep flint 2.7: resolves #860, resolves #870 #919
Conversation
Great, thanks. |
src/flint/fq.jl
Outdated
square_root(x::fq) | ||
> Return the square root of $x$ in the finite field. If $x$ is not a square | ||
> an exception is raised. | ||
""" |
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.
square_root(x::fq) | |
> Return the square root of $x$ in the finite field. If $x$ is not a square | |
> an exception is raised. | |
""" | |
square_root(x::fq) | |
Return the square root of $x$ in the finite field. If $x$ is not a square | |
an exception is raised. | |
""" |
src/flint/fq.jl
Outdated
issquare(x::fq) | ||
> Returns `true` if $x$ is a square in the finite field (includes zero). | ||
""" |
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.
issquare(x::fq) | |
> Returns `true` if $x$ is a square in the finite field (includes zero). | |
""" | |
issquare(x::fq) | |
Return `true` if $x$ is a square in the finite field (includes zero). | |
""" |
src/flint/fmpq_mpoly.jl
Outdated
dic = Dict{fmpq_mpoly, Int}() | ||
for i in 0:fac.num-1 | ||
f = R() | ||
# use get_base instead of swap_base if convert is to preserve input |
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.
@rfourquet Is it ok if this function destroys its input? I just didn't want make another useless copy of the polynomials...
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.
Why did you implement a convert
method? Or was it there before?
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.
if I implement a convert function, there is less copy+paste and fewer lines of code
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.
The problem with convert
is that it will be called implicitely without the users knowledge (for example in array or dictionary assignments), making the destructive behavior rather unfortunate.
How about implementing (::Factor{fmpq_poly})(::fmpz_poly_factor)
? Or convert_and_destroy
, something that indicates that the input will be garbage.
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.
Yes I agree with @thofma
Sorry, I was a bit sloppy with my comment. The signature I meant was (::Type{Fac{nmod_mpoly}})(f::nmod_poly_factor) So that one calls it as I can push those changes if you want. |
Project.toml
Outdated
@@ -24,7 +24,7 @@ AbstractAlgebra = "^0.11.1" | |||
Antic_jll = "~0.2.2" | |||
Arb_jll = "~2.18.1" | |||
BinaryProvider = "0.4, 0.5" | |||
FLINT_jll = "~2.6.3" | |||
FLINT_jll = "~200.690.0" | |||
LoadFlint = "^0.3.4" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Sure, there are a few other changes that are necessary. |
Project.toml
Outdated
@@ -24,7 +24,7 @@ AbstractAlgebra = "^0.11.1" | |||
Antic_jll = "~0.2.2" | |||
Arb_jll = "~2.18.1" | |||
BinaryProvider = "0.4, 0.5" | |||
FLINT_jll = "~2.6.3" | |||
FLINT_jll = "~200.690.0" | |||
LoadFlint = "^0.3.4" |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Good to go from my side. |
The failure on nightly looks scary. Might be due to some bad choices in the random test. I will try to reproduce it locally. |
The problem is that fq_ctx_init_modulus expects 4 arguments but gets only 3. |
Thanks. I will fix it. Weird that it passed for the other jobs. |
Actually it makes me concerned, I now wonder what other similar issues are hidden there... |
@tthsqe12 please check my fix. |
I've submitted PR #923 to enable code coverage tracking. That shows (see https://codecov.io/gh/Nemocas/Nemo.jl/tree/9e9e763d9cb56919ebf94ce81f985c3a6e4a405d/src) that about 80% of the code base is already covered by tests, which is good. But on the downside that means 20% are not yet tested at all. Of course just because a line of code is executed as part of a test doesn't ensure it is bugfree (as the issue at hand demonstrates), but at least it's slightly less likely than when the code is never tested... I really wonder if there is a technology that might help with catching these API mismatches: wrong number of arguments, wrong types... I guess it would have to be code that parses C header files to compute the corresponding data. And then somehow match it to our ccalls. Hrm |
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.
@thofma looks fine. I am sorry I missed that one. It would be nice to have some of these errors caught automatically... |
@fingolfin I know for a fact that there are other mismatched signatures even from before version 2.6. But, they work currently :) Here are the unpleasant secrets of nemo in order:
I will go through all of the ccalls soon and remove the nonexistant functions and fix the bad arguments. I didn't want to change too much right now. |
There are still a bunch of code change suggestions by @rfourquet which someone with the right permissions could apply |
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
Co-authored-by: Rafael Fourquet <fourquet.rafael@gmail.com>
This comment has been minimized.
This comment has been minimized.
I don't see square roots for finite fields. Did you add them @tthsqe12? |
This only thing missing is |
Would you mind adding it? That would be great. |
@tthsqe12 the Codecov comment above is updated whenever this PR is rebuilt. It also contains links to the full report: https://codecov.io/gh/Nemocas/Nemo.jl/pull/919 for this PR. On https://codecov.io/gh/Nemocas/Nemo.jl/pull/919/diff you can just see the changes introduced by this PR, and whether they are covered or not. They currently have a coverage of 90.75% which is above average! Here's an example of a Let me know if you have any questions about Codecov, I am quite familiar with it (including a lot of annoying warts... but hey, it's free) |
(Also, while I of course think it'd be useful to increase coverage, getting to 99% is quite ambitious, and perhaps not the best idea to hold up this PR too much just to increase coverage? We can increase it further later, and add corresponding fixes then as well. |
@fingolfin `200.690` is too old to push Nemocas/Nemo.jl#919 over the finish line. Did I bump the version correctly? Or should I bump the patch version?
This is now waiting for a new flint version, see JuliaPackaging/Yggdrasil#2265. |
The Flint release is waiting on a final PR from @tthsqe12 I think that should be the final issue to deal with and then we can issue a new rc and final release. |
* [FLINT] new version @fingolfin `200.690` is too old to push Nemocas/Nemo.jl#919 over the finish line. Did I bump the version correctly? Or should I bump the patch version? * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl
New Flint and LoadFlint are out. Anything else that needs to be done? |
I pushed the last commit this morning to make everything green. I will do some cleaning up later this day. |
Yay! |
resolves #860, resolves #870
I'll do the nmod_mpoly/gfp_mpoly thing in a later pr.
One thing at a time