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

Replace some setprecision!(::ParentObject) #1522

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

joschmitt
Copy link
Collaborator

@joschmitt joschmitt commented May 21, 2024

This replaces many setprecision!(::ParentObject) calls by with_precision blocks.
Also removes prime_field in the context of local fields.

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 40 lines in your changes are missing coverage. Please review.

Project coverage is 75.28%. Comparing base (1ddad8b) to head (f2ab7d9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1522      +/-   ##
==========================================
- Coverage   75.37%   75.28%   -0.10%     
==========================================
  Files         354      354              
  Lines      112815   112827      +12     
==========================================
- Hits        85032    84938      -94     
- Misses      27783    27889     +106     
Files Coverage Δ
src/Deprecations.jl 100.00% <ø> (ø)
src/LocalField/Poly.jl 63.24% <100.00%> (-0.05%) ⬇️
src/LocalField/automorphisms.jl 82.97% <100.00%> (+0.09%) ⬆️
src/QuadForm/Quad/NormalForm.jl 99.55% <100.00%> (ø)
src/HeckeTypes.jl 84.36% <50.00%> (ø)
src/LocalField/Elem.jl 81.20% <96.15%> (-0.13%) ⬇️
src/LocalField/LocalField.jl 74.26% <85.71%> (-0.74%) ⬇️
src/Misc/UnitsModM.jl 69.26% <0.00%> (ø)
src/LocalField/Ring.jl 72.00% <50.00%> (+0.45%) ⬆️
src/NumField/NfAbs/MPolyAbsFact.jl 70.98% <97.43%> (+1.13%) ⬆️
... and 6 more

... and 22 files with indirect coverage changes

Copy link
Contributor

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

This PR is big and has been sitting here since May. I tried to give it a review, but the precision changes seem rather delicate to me, and there are so many changes in here, most unrelated, that I gave up halfway through :-(. Sorry about that (I am not the most qualified person for this anyway, so perhaps not a big loss).

But I noticed that the "change constructors to snake case" part is huge, yet mostly trivial. Perhaps that could be split into a separate PR (and perhaps some of the other precision related changes into yet another) which then might make each individual PR easier and quicker to review?

Zp = maximal_order(Qp)
Qq, gQq = QadicField(minimum(P), f, prec_padics, cached = false)
Qq, gQq = unramified_extension(Qp, f, precision = prec_padics, cached = false)
Copy link
Contributor

Choose a reason for hiding this comment

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

I have no detail about the maths in here, so I just trust this change (which unlike the others seems not completely "obvious") is correct

r = with_precision(Q, p) do
return r - qf(r)*o
end
if precision(r) >= n
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me that before, the precision of r resp. Q was always restricted to n if precision(r) >= n, while now it might stay at a larger value. Presumably this is fine, though, or even an improvement?

Unfortunately this particular case does not seem to be covered by CI.

for x = lf
if is_splitting(C) || degree(x[1]) == degree(Q)
append!(rt, roots(Q, x[1], max_roots = 1))
with_precision(Q, n) do
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be better to move the with_precision outside the for x = lf loop?

@joschmitt
Copy link
Collaborator Author

joschmitt commented Sep 11, 2024

This PR is big and has been sitting here since May. I tried to give it a review, but the precision changes seem rather delicate to me, and there are so many changes in here, most unrelated, that I gave up halfway through :-(. Sorry about that (I am not the most qualified person for this anyway, so perhaps not a big loss).

Oh, sorry, I thought this was marked as draft. I didn't really proceed with this: there is a lot of code that apparently assumes that the precision of some field is set correctly at some point before. Since I don't know half of the involved theory, most of this was educated guessing and trial and error with the CI tests.
This also breaks OSCAR for the same reason: functions in OSCAR seem to assume that some functions in Hecke set the precision "correctly". I have a local branch where I tried to fix that, but gave up at some point.

Splitting off the trivial renamings and such sounds like a good idea. I'll look into it.

@joschmitt joschmitt marked this pull request as draft September 11, 2024 07:45
@joschmitt
Copy link
Collaborator Author

I rebased this now on top of #1605. There seems to be a new test failure (I have the vague feeling that I once debugged this one already, apparently it is back). And it still breaks OSCAR of course.

If people are interested in this and there is nothing better to do for me, I can try to get this and a corresponding OSCAR pull request done during the coding sprint next week. Possibly with the help of some of people who know a bit more about $p$-adics.

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.

2 participants