Skip to content

Conversation

@SoongNoonien
Copy link
Collaborator

I'm not sure if this makes sense but as far as I understand the random interface this should work. This should just delegate the random element generation to the base ring of the universal polynomial ring.

@JohnAAbbott
Copy link
Collaborator

JohnAAbbott commented Dec 17, 2025

I mention the following (rather aged) PR for Oscar: oscar-system/Oscar.jl#4787
I do hope that something akin to the proposal there will eventually be adopted, though as @thofma pointed out that proposal is noticeably more wordy than the current (impenetrable) interface.

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.04%. Comparing base (0eb3ed5) to head (f191f1e).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2257      +/-   ##
==========================================
- Coverage   88.07%   88.04%   -0.04%     
==========================================
  Files         126      126              
  Lines       31728    31715      -13     
==========================================
- Hits        27946    27925      -21     
- Misses       3782     3790       +8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SoongNoonien SoongNoonien marked this pull request as ready for review December 17, 2025 22:43
Copy link
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

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

This removes the possibility to create a RandomExtensions.jl Sampler object for a universal polynomial ring (on which all of the current random generation is based on). See #1388 for more context (even though the people there disagree with me, I think this should be coordinated with the other parts of AA that rely on RandomExtensions.jl).

If you still want to proceed with something like this here, you could keep the sampler generation code, and there just wrap a sampler of the underlying mpoly ring and delegate all the further rand calls to that sampler

@fingolfin
Copy link
Member

This removes the possibility to create a RandomExtensions.jl Sampler object for a universal polynomial ring (on which all of the current random generation is based on). See #1388 for more context (even though the people there disagree with me, I think this should be coordinated with the other parts of AA that rely on RandomExtensions.jl).

If you still want to proceed with something like this here, you could keep the sampler generation code, and there just wrap a sampler of the underlying mpoly ring and delegate all the further rand calls to that sampler

I think that was @SoongNoonien's intention, but it's difficult to do given the lack of tests and documentation. Plus we do some really funky stuff -- there is a reason why my PR Nemocas/Nemo.jl#1819 has been stalled for 1.5 years: I couldn't figure out how to interact with the RandomExtensions APIs in a way that kept the existing code working without running into invalidations 🤷

As I see it: who needs "samplers" for universal polynomial rings? I am only aware of two people using those at all (@SoongNoonien is one of them), and they certainly are not using those.

I'd much rather have us implement and move to the new proposed rand(om) APIs (see the PR linked to by @JohnAAbbott) and then ditch the entire RandomExtension stuff (except maybe for a few shim methods that ensure select old code using it keeps working).

Anyway: we'll have a look to see if it is realistic to keep the stuff here working instead of removing it; but that'll require being able to write up some test code for it...

@JohnAAbbott
Copy link
Collaborator

!WARNING! we have several "threads" about random object generation, but there seems to be no "index" of them.
I believe THE MAIN ISSUE ABOUT RANDOM GENERATION is https://github.com/oscar-system/Oscar.jl/issues/2896

Other more-or-less related links are:

  1. https://github.com/Nemocas/AbstractAlgebra.jl/issues/1388,
  2. https://github.com/Nemocas/Nemo.jl/pull/1819,
  3. https://github.com/oscar-system/Oscar.jl/pull/4787

If there are missing links, perhaps someone could add them to the list.

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