Skip to content
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

Add conformance tests for some adhoc operations #1867

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

fingolfin
Copy link
Member

@fingolfin fingolfin commented Oct 18, 2024

Work in progress towards #1817...

@fingolfin
Copy link
Member Author

Nice, this found already a genuine bug in AA (see second commit)

src/julia/Integer.jl Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.13%. Comparing base (f137e0a) to head (8d6746d).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/generic/MPoly.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1867   +/-   ##
=======================================
  Coverage   88.13%   88.13%           
=======================================
  Files         120      120           
  Lines       30282    30286    +4     
=======================================
+ Hits        26689    26694    +5     
+ Misses       3593     3592    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fingolfin
Copy link
Member Author

Seems to be passing locally now but reveals issues in Nemo (and/or Nemo reveals issues in the tests, dunno 😂 )

fingolfin added a commit to Nemocas/Nemo.jl that referenced this pull request Oct 27, 2024
The following lead to a crash (uncovered by Nemocas/AbstractAlgebra.jl#1867)
```julia
using Nemo
R, t = ZZ[:t]
zero(R) - ZZ(0)
```
This is due to a bug in FLINT's `fmpz_poly_sub_fmpz`.
fingolfin added a commit to Nemocas/Nemo.jl that referenced this pull request Oct 27, 2024
The following lead to a crash (uncovered by Nemocas/AbstractAlgebra.jl#1867)
```julia
using Nemo
R, t = ZZ[:t]
zero(R) - ZZ(0)
```
This is due to a bug in FLINT's `fmpz_poly_sub_fmpz`.
fingolfin added a commit to Nemocas/Nemo.jl that referenced this pull request Oct 28, 2024
The following lead to a crash (uncovered by Nemocas/AbstractAlgebra.jl#1867)
```julia
using Nemo
R, t = ZZ[:t]
zero(R) - ZZ(0)
```
This is due to a bug in FLINT's `fmpz_poly_sub_fmpz`.
fingolfin added a commit to Nemocas/Nemo.jl that referenced this pull request Oct 28, 2024
The following lead to a crash (uncovered by Nemocas/AbstractAlgebra.jl#1867)
```julia
using Nemo
R, t = ZZ[:t]
zero(R) - ZZ(0)
```
This is due to a bug in FLINT's `fmpz_poly_sub_fmpz`.
@fingolfin fingolfin marked this pull request as ready for review October 28, 2024 11:35
@@ -516,9 +516,15 @@ for op in (:+, :-, :*)
return UnivPoly{T}($op(data(p),n), S)
end

$op(n::Union{Integer, Rational, AbstractFloat}, p::UnivPoly) = $op(p,n)
function $op(n::Union{Integer, Rational, AbstractFloat}, p::UnivPoly{T}) where {T}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh, the UnivPoly adhoc subtraction was wrong since my recent PR #1877. Luckily the tests here caught it.

@fingolfin
Copy link
Member Author

This of course fails the NemoCI tests against the current Nemo release as that still has bugs (uncovered by this PR!). But the NemoCI master tests should pass. I would argue this is fine then for a non-breaking release, as the changes don't break Nemo, just ] test Nemo

@fingolfin
Copy link
Member Author

(But it is also OK for me to punt this a bit longer, it's not that urgent. But I look forward to the increased code coverage)

@lgoettgens
Copy link
Collaborator

I am fine with putting this in a patch release (after I had a chance to look at it, let's put it on my to-do list).
To still have green CI here, I already prepared Nemocas/Nemo.jl#1931.

@lgoettgens lgoettgens self-requested a review October 29, 2024 14:49
print(io, "Integers")
end

function show(io::IO, R::Integers{T}) where T
print(io, "Integers{$T}()")
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a similar show change for Rationals and Floats as well? I think it would be great to have these three as aligned as possible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the printing tweak from this PR and put it into a separate PR. It can adjusted there (or not) as people have time, without holding up this useful PR (including the bug fix in it) further

@lgoettgens lgoettgens merged commit e25bc98 into master Oct 30, 2024
28 of 29 checks passed
@lgoettgens lgoettgens deleted the mh/conformance-test-adhoc branch October 30, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants