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

In OSCAR, polynomial rings should all be constructed with cached = false #2455

Open
HereAround opened this issue Jun 7, 2023 · 13 comments
Open
Assignees

Comments

@HereAround
Copy link
Member

This was brought to my attention by @fieker. Apparently, this happens in particular for schemes. Hence, I cc @HechtiDerLachs , so we can discuss this at some point.

@fingolfin fingolfin changed the title In OSCAR, polynomial rings should all be constructed with cached = false In OSCAR, polynomial rings should all be constructed with cached = false Jun 14, 2023
@fingolfin
Copy link
Member

There is some relevant text on the caches in the AA documentation, as part of the ring interface. We should check if this text still reflects what we want, and then copy it (after editing) into the OSCAR dev docs.

Also we need to think about allowing optional specification of parents in more functions, e.g. hilbert_series; there is an open PR #2084 by @HechtiDerLachs on this, which we need to get finished and merged.

@fingolfin
Copy link
Member

fingolfin commented Apr 30, 2024

The overall situation is still rather bad, it wouldn't hurt to evangelize this again, and task some people to work on it.

Running

git grep -n '\bpolynomial_ring(' src | fgrep -v 'julia> ' | fgrep -v 'src/InvariantTheory' | egrep -v 'cached\s*=\s*false' 

to find examples in Oscar.jl where code creates cached polynomial rings, one finds (excluding some obvious false hits):

@ederc
Copy link
Member

ederc commented Apr 30, 2024

@RafaelDavidMohr and I will take care of this.

@lgoettgens
Copy link
Member

Since @ederc and @RafaelDavidMohr are working on this, triage had nothing to discuss

@ederc
Copy link
Member

ederc commented Jun 6, 2024

I looked a bit more into this issue, but to tell you the truth, I may not understand completely what to do. At the moment we have this behaviour:

julia> R, (x,y) = polynomial_ring(QQ, ["x", "y"]; cached = false)
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y])

julia> S, (x,y) = polynomial_ring(QQ, ["x", "y"]; cached = false)
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y])

julia> R == S
false

So this means that many tests will break if we are not caching internally constructed rings since the objects we return are usually connected with those rings. Looking at the code checking equality of non-cached rings R == S it boils down to

==(x, y) = x === y

in julia Base.jl. Is this really what we want?

@thofma
Copy link
Collaborator

thofma commented Jun 6, 2024

Yes, I think this is what we want. Can you elaborate on the

So this means that many tests will break if we are not caching internally constructed rings since the objects we return are usually connected with those rings.

Which tests are among the many tests?

@fieker
Copy link
Contributor

fieker commented Jun 6, 2024 via email

@ederc
Copy link
Member

ederc commented Jun 6, 2024

Well, let's say something like this from AffineRationalPoint.jl:

  A2 = affine_space(GF(2), [:x, :y]);
  (x, y) = coordinates(A2);
  X = algebraic_set(x*y);

  pA = A2([1,0])

  A2a = affine_space(GF(2), [:x, :y]);
  @test A2a([1,0]) == pA

@fieker
Copy link
Contributor

fieker commented Jun 6, 2024 via email

@ederc
Copy link
Member

ederc commented Jun 6, 2024

@fieker @thofma I can understand the behaviour of non-cached rings, the problem is just that then this issue is nothing @RafaelDavidMohr and I can solve on our own globally. Then everybody has to take care of her/his own code. I don't think it is a good idea if @RafaelDavidMohr and I change tests for code where we do not have expertise.

@thofma
Copy link
Collaborator

thofma commented Jun 6, 2024

Agreed.

@ederc
Copy link
Member

ederc commented Jun 19, 2024

Once the referenced PRs are all merged, this issue can be closed. As discussed, the open PRs need adjustments in tests. I asked the corresponding authors for support.

@fingolfin
Copy link
Member

Thank you @ederc

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

No branches or pull requests

6 participants