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 VarietyFunctionField, add base_ring_type method #4417

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

fingolfin
Copy link
Member

The alternative to removing the base_ring method would be to add a base_ring_type method (that's what the first commit in this PR does; the second then removes it and base_ring).

This would benefit from a better test_elem implementation, perhaps @HechtiDerLachs can help out with that.

Also add missing base_ring_type method.
It seems to be only used for one thing, coercing Integer values into VarietyFunctionField elements
@fingolfin fingolfin marked this pull request as draft January 6, 2025 17:45
@fingolfin
Copy link
Member Author

Unfortunately this requires Nemocas/AbstractAlgebra.jl#1946 which is not yet in an AA release. So turning this into a draft for now.

But the general gist here is: all our custom ring types should be run through our conformance tests.

Copy link
Collaborator

@HechtiDerLachs HechtiDerLachs left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up. I would keep base_ring and introduce base_ring_type. It's just the first type parameter of VarietyFunctionField.

As for the test_elem: I think we can copy from what we have for polynomial rings and use that for numerator and denominator?

If you agree, I can check out this PR and do the changes (once I manage to fix up my github client, that is...).

@fingolfin
Copy link
Member Author

Thanks for cleaning this up. I would keep base_ring and introduce base_ring_type. It's just the first type parameter of VarietyFunctionField.

No, it is not:

julia> typeof(KK)
VarietyFunctionField{QQField, AbstractAlgebra.Generic.FracField{QQMPolyRingElem}, CoveredScheme{QQField}, AffineScheme{QQField, MPolyQuoRing{QQMPolyRingElem}}}

julia> typeof(base_ring(KK))
QQMPolyRing

and I ended up with

base_ring_type(::Type{T}) where {FracFieldType, T<:VarietyFunctionField{<:Field, FracFieldType}} = base_ring_type(FracFieldType)

to match what base_ring does.

As for the test_elem: I think we can copy from what we have for polynomial rings and use that for numerator and denominator?

Perhaps, I have no idea how to even construct any element of VarietyFunctionField other than by coercing integers.

If you agree, I can check out this PR and do the changes

Sure!

(once I manage to fix up my github client, that is...).

You can always make another git worktree (or two, or three... ;-) )

(But to be clear, this is not urgent in anyway)

@HechtiDerLachs
Copy link
Collaborator

I cleaned this up to the extent I found reasonable at the moment. @fingolfin : Do you take over again?

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.37%. Comparing base (d1d6926) to head (4ce9a46).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4417      +/-   ##
==========================================
- Coverage   84.39%   84.37%   -0.02%     
==========================================
  Files         659      663       +4     
  Lines       87183    87808     +625     
==========================================
+ Hits        73575    74088     +513     
- Misses      13608    13720     +112     
Files with missing lines Coverage Δ
...icGeometry/Schemes/FunctionField/FunctionFields.jl 81.17% <100.00%> (+4.58%) ⬆️

... and 21 files with indirect coverage changes

@fingolfin fingolfin marked this pull request as ready for review January 9, 2025 00:35

function test_elem(K::VarietyFunctionField)
F = representative_field(K)
P = base_ring(F)::MPolyRing
Copy link
Member Author

Choose a reason for hiding this comment

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

Why the type assertion @HechtiDerLachs ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

To assist the reader of the code. Nothing more.

@fingolfin
Copy link
Member Author

@HechtiDerLachs from my POV this is now good to go, please approve if you agree

@fingolfin fingolfin changed the title Add conformance tests for VarietyFunctionField, remove base_ring(::VarietyFunctionField) method Add conformance tests for VarietyFunctionField, add base_ring_type method Jan 9, 2025
@fingolfin fingolfin enabled auto-merge (squash) January 9, 2025 00:38

function test_elem(K::VarietyFunctionField)
F = representative_field(K)
P = base_ring(F)::MPolyRing
Copy link
Collaborator

Choose a reason for hiding this comment

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

To assist the reader of the code. Nothing more.

@HechtiDerLachs
Copy link
Collaborator

@aaruni96 : Some weird polymake trouble seems to show up in the tests here. Do you have any suggestions what to do about it? Thx!

@aaruni96
Copy link
Member

aaruni96 commented Jan 9, 2025

From what I can tell, it errored out while trying to create a certain file, and that lead to failure.

can't create extension description /Users/aaruni/.julia/scratchspaces/d720cf60-89b5-51f5-aff5-213f193123e7/polymake_8314035208692525497_1.10_depstree_v2/share/polymake/ext/oscarnumber/polymake.ext: Permission denied

The file already exists, and is read-only, and was last modified on 10th November.

This raises an interesting question : if the julia depot is defined to be something else ( /Users/aaruni/Desktop/oscar-runners-runner-1/julia-depot), why is it trying to access anything in /Users/aaruni/.julia ?

@benlorenz any idea ?

@fingolfin fingolfin merged commit 02d2e8d into master Jan 9, 2025
29 of 31 checks passed
@fingolfin fingolfin deleted the mh/VarietyFunctionField-conformance branch January 9, 2025 12:05
@benlorenz
Copy link
Member

From what I can tell, it errored out while trying to create a certain file, and that lead to failure.

can't create extension description /Users/aaruni/.julia/scratchspaces/d720cf60-89b5-51f5-aff5-213f193123e7/polymake_8314035208692525497_1.10_depstree_v2/share/polymake/ext/oscarnumber/polymake.ext: Permission denied

The file already exists, and is read-only, and was last modified on 10th November.

This raises an interesting question : if the julia depot is defined to be something else ( /Users/aaruni/Desktop/oscar-runners-runner-1/julia-depot), why is it trying to access anything in /Users/aaruni/.julia ?

@benlorenz any idea ?

Are you sure that the depot is properly set?
I assume that this is from this run https://github.com/oscar-system/Oscar.jl/actions/runs/12681607918/job/35345634635#step:10:243, which is on one of the macos runners. Have they been switched to proper separate depots?
The registry is in ~/.julia as well

  Installing known registries into `~/.julia`
       Added `General` registry to ~/.julia/registries
    Updating registry at `~/.julia/registries/General.toml`

and further down I see

Failed to precompile Oscar [f1435218-dba5-11e9-1e4d-f1a5fab5fc13] to "/Users/aaruni/.julia/compiled/v1.10/Oscar/jl_Kx1OSx".

which doesn't look like a custom depot is used.

@aaruni96
Copy link
Member

I have just restarted all the macos runners, and reset JULIA_DEPOT_PATH to be separate. Hopefully they will really use separate depots now.

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.

4 participants