-
Notifications
You must be signed in to change notification settings - Fork 120
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
Randomized tests failing for AlgClosure{fqPolyRepField}
#2691
Comments
Funny. Perhaps the simplest situation where a failure is reported is
Up to now, I cannot reproduce the failures locally. |
The line where the error happens is this: function (a::fqPolyRepField)(b::fqPolyRepFieldElem)
k = parent(b)
da = degree(a)
dk = degree(k)
if k == a
return b
elseif dk < da
da % dk != 0 && error("Coercion impossible")
f = embed(k, a)
return f(b) # <--- error is here
else
dk % da != 0 && error("Coercion impossible")
f = preimage_map(a, k)
return f(b)
end
end
So presumably |
Following |
My interpretation of the |
I am (still) looking at this. I could finally manage to reproduce it locally. |
Here is how to reproduce it:
It is unrelated to caching and looks more like a bug in the embedding code (the theory of which is "described" here: https://dl.acm.org/doi/abs/10.1145/3282678.3282682). Because of its recursive nature, it is a bit tedious to follow. Feel free to look at it. Otherwise I will discuss it with @fieker once he is back from holiday. |
Thanks @thofma, this looks very interesting. |
Here are some bread crumps, so that I don't forget about it:
will call
(https://github.com/Nemocas/Nemo.jl/blob/master/src/embedding/embedding.jl#L301)
|
OK, part of the issue is indeed this function (following the hint by @lgoettgens) in this code: function is_embedded(k::T, K::T) where T <: FinField
d = degree(K)
ov = overfields(k)
# We look for an embedding that has k as domain and K as codomain
if haskey(ov, d)
for f in ov[d]
if domain(f) == k && codomain(f) == K
return f
end
end
end
end Clearly this function returns a cached value if available -- and otherwise nothing (funnily it never returns a boolean, despite being called So it seems the return value of Perhaps it suffices to replace the check for |
This should be fixed by PR #2739 ; however, there are more issues hidden in the subfield lattice code, which need to be addressed. We asked @mjrodgers to look into some of this. |
I am still seeing this sort of failure in run https://github.com/oscar-system/Oscar.jl/actions/runs/6023945049/job/16341680795?pr=2741. The PR has been rebased to the latest master in the morning and ran around noon today. Please have a brief look. |
This error looks similar, from today (#2764):
|
I haven't seen this bug recently, so maybe it is fixed (or at least this aspect of it) after all? |
Not really, it happened again here, 2 hours ago on master: Basic functions: Error During Test at /Users/runner/.julia/packages/AbstractAlgebra/Ry0na/test/Rings-conformance-tests.jl:96
Test threw exception
Expression: equality((a + b) + c, a + (b + c))
MethodError: objects of type Nothing are not callable
Stacktrace:
[1] (::fqPolyRepField)(b::fqPolyRepFieldElem)
@ Nemo ~/.julia/packages/Nemo/yGn7K/src/flint/fq_nmod.jl:660
[2] op(f::typeof(+), a::AlgClosureElem{fqPolyRepField}, b::AlgClosureElem{fqPolyRepField})
@ Oscar.AlgClosureFp ~/work/Oscar.jl/Oscar.jl/src/Rings/AlgClosureFp.jl:129
[3] +(a::AlgClosureElem{fqPolyRepField}, b::AlgClosureElem{fqPolyRepField})
@ Oscar.AlgClosureFp ~/work/Oscar.jl/Oscar.jl/src/Rings/AlgClosureFp.jl:132
[4] macro expansion
@ ~/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
[5] macro expansion
@ ~/.julia/packages/AbstractAlgebra/Ry0na/test/Rings-conformance-tests.jl:96 [inlined]
[6] macro expansion
@ ~/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
[7] macro expansion
@ ~/.julia/packages/AbstractAlgebra/Ry0na/test/Rings-conformance-tests.jl:70 [inlined]
[8] macro expansion
@ ~/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
[9] test_NCRing_interface(R::AlgClosure{fqPolyRepField}; reps::Int64)
@ Main ~/.julia/packages/AbstractAlgebra/Ry0na/test/Rings-conformance-tests.jl:31 and here as well, 10 hours ago: Arithmetic for Finite field of degree 1 over GF(3): Error During Test at /Users/runner/work/Oscar.jl/Oscar.jl/test/Rings/AlgClosureFp.jl:89
Test threw exception
Expression: a * (b + c) == a * b + a * c
MethodError: objects of type Nothing are not callable
Stacktrace:
[1] (::FqField)(b::FqFieldElem)
@ Nemo ~/.julia/packages/Nemo/yGn7K/src/flint/fq_default_extended.jl:705
[2] op(f::typeof(+), a::AlgClosureElem{FqField}, b::AlgClosureElem{FqField})
@ Oscar.AlgClosureFp ~/work/Oscar.jl/Oscar.jl/src/Rings/AlgClosureFp.jl:129
[3] +(a::AlgClosureElem{FqField}, b::AlgClosureElem{FqField})
@ Oscar.AlgClosureFp ~/work/Oscar.jl/Oscar.jl/src/Rings/AlgClosureFp.jl:132
[4] macro expansion
@ ~/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
[5] macro expansion
@ ~/work/Oscar.jl/Oscar.jl/test/Rings/AlgClosureFp.jl:89 [inlined]
[6] macro expansion
@ ~/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1586 [inlined]
[7] macro expansion
@ ~/work/Oscar.jl/Oscar.jl/test/Rings/AlgClosureFp.jl:77 [inlined]
[8] macro expansion
@ ~/hostedtoolcache/julia/1.9.3/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
[9] top-level scope
@ ~/work/Oscar.jl/Oscar.jl/test/Rings/AlgClosureFp.jl:8 One is for |
Just an update on this, I have been taking a look on it and reading about how this lattice of embedded subfields is handled in Magma. As for these randomized tests failing, it is something I haven't been able to recreate at the moment. |
Starting with #2684, I noticed some seemingly random fails on the master CI with different julia versions.
All are pretty lengthy, but contain something like the following multiple times:
Full logs for 1.6 (https://github.com/oscar-system/Oscar.jl/actions/runs/5871596739/job/15921330205#step:6:1010) and nightly (https://github.com/oscar-system/Oscar.jl/actions/runs/5869443753/job/15914431074?pr=2644#step:6:1010).
cc @ThomasBreuer
The text was updated successfully, but these errors were encountered: