Skip to content

Refactor polysubst.jl #1889

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

Merged
merged 3 commits into from
Dec 12, 2024
Merged

Conversation

lgoettgens
Copy link
Member

@lgoettgens lgoettgens commented Oct 30, 2024

Contains #1888 to avoid conflicts.

This goes in hand with Nemocas/Nemo.jl#1933, but should hopefully be non-breaking on its own. Let's wait for CI to verify that.

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 88.62%. Comparing base (f90e000) to head (ade496d).
Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
src/Poly.jl 70.58% 5 Missing ⚠️
src/NCPoly.jl 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1889      +/-   ##
==========================================
+ Coverage   88.14%   88.62%   +0.48%     
==========================================
  Files         120      119       -1     
  Lines       30288    32831    +2543     
==========================================
+ Hits        26697    29097    +2400     
- Misses       3591     3734     +143     

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

@fingolfin
Copy link
Member

Fine by me but unfortunately it breaks HeckeCI tests:

Error During Test at /home/runner/.julia/packages/Hecke/p6Ffl/test/NumField/Hilbert.jl:1
  Got exception outside of a @test
  MethodError: (::ZZPolyRingElem)(::zzModPolyRingElem) is ambiguous. Candidates:
    (f::PolyRingElem)(a::PolyRingElem) in AbstractAlgebra at /home/runner/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3363
    (f::ZZPolyRingElem)(a::RingElem) in Nemo at /home/runner/.julia/packages/Nemo/0TzOv/src/polysubst.jl:27
    (f::PolyRingElem)(a::RingElem) in AbstractAlgebra at /home/runner/work/AbstractAlgebra.jl/AbstractAlgebra.jl/src/Poly.jl:3371
    (f::ZZPolyRingElem)(a) in Nemo at /home/runner/.julia/packages/Nemo/0TzOv/src/polysubst.jl:16
  Possible fix, define
    (::ZZPolyRingElem)(::PolyRingElem)

Also OscarCI with a similar one

@thofma
Copy link
Member

thofma commented Oct 30, 2024

Good look with the ambiguities.

It is a bit hard to check that this does not introduce regressions. Accidentally this could change things that used to compute f(g) as compose(f, g) to suddenly use evaluate(f, g) instead.

@lgoettgens
Copy link
Member Author

The ambiguities only occur if we only have this patch in but not the one for Nemo. So let me mark this as breaking, and we can apply it with the next breaking release.

Regarding @thofma s comment: I don't see how this could be possible. The only difference is that if one calls f(g) for different types of Polys, then this gets delegated to subst via a different call function than before.

Edit: maybe there are some changes regarding stacks of poly rings. I'll play around with it

@thofma
Copy link
Member

thofma commented Oct 31, 2024

Regarding @thofma s comment: I don't see how this could be possible. The only difference is that if one calls f(g) for different types of Polys, then this gets delegated to subst via a different call function than before.

All I was trying to say is that we (the reviewers) have to check a bit more carefully, since for many argument combinations, both compose(f, g) and evaluate(f, g) give the right result, and so regressions are not detected by the tests.

@fingolfin
Copy link
Member

since for many argument combinations, both compose(f, g) and evaluate(f, g) give the right result, and so regressions are not detected by the tests.

OK but if there are combinations were only one (or neither 😨 ) gives right results, then surely the very first thing we should do is to add those to the tests ... :-)

@thofma
Copy link
Member

thofma commented Dec 5, 2024

OK, let's do this.

@lgoettgens lgoettgens enabled auto-merge (squash) December 12, 2024 14:26
@lgoettgens lgoettgens closed this Dec 12, 2024
auto-merge was automatically disabled December 12, 2024 14:28

Pull request was closed

@lgoettgens lgoettgens reopened this Dec 12, 2024
@lgoettgens lgoettgens enabled auto-merge (squash) December 12, 2024 14:29
@fingolfin fingolfin disabled auto-merge December 12, 2024 16:16
@fingolfin fingolfin merged commit 56ca039 into Nemocas:master Dec 12, 2024
51 of 56 checks passed
@lgoettgens lgoettgens deleted the lg/polysubst-Nemo branch December 12, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants