-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Do not canonicalize generators when building a permutation group from a libGAP group #37590
Do not canonicalize generators when building a permutation group from a libGAP group #37590
Conversation
d7dc032
to
fed224d
Compare
Shouldn't this be also done for pexpect GAP groups?
here the type of |
It seems right for me. Including |
@dimpase I added a test for that case showing that it works with the change. Is that what you meant? |
hmm, OK, it's all good. |
the CI run shows this error:
|
I thought I got all the tests, but it seems I missed one. Fixed. |
Documentation preview for this PR (built with commit 2a51c3e; changes) is ready! 🎉 |
Thank you. (Unfortunately this means we will be more susceptible to changes in GAP's output order when versions change, but so be it.) |
Apparently soon, see issue #37616 |
one just have to rewrite tests like this in an output-insensitive way. |
Right. I think what is important is that the generators in sage and gap coincide since gap is going to do the hard work. |
I think that is far easier said than done, and it is not always useful to a user looking at the examples. It might just be something we have to deal with when upgrading GAP… |
We must try to come up with some solution, because it's not feasible to assume everybody in every context is using the exact same version of gap. In particular, what shall we do about gap 4.13 (#37616)? |
If the failure of tests is only due to change of orders, it is not necessary a big issue |
If the tests give different answers for 4.12 than for 4.13, it means they will only pass with one particular version of gap. The change has other implications, for instance conjugacy classes are in a different order, which makes character tables different, etc. It's not an easy problem, but it's very critical to support system packages. We are facing a similar issue with singular (#37492). |
Even with the exact same version of GAP, the orders of generators, conjugacy classes etc. can vary if you re-run the same code, due to the use of randomized algorithms in many places. |
Indeed - and it's alarming, as Sage does testing with different random seeds (quite a few real bugs got detected this way), but apparently these seeds don't reach GAP's settings. |
That could probably be fixed with how we set up our testing framework to pass along that seed to GAP. |
There are cases where this order is important because the documentation is demonstrating how to do a particular computation on a particular character/conjugacy class/etc. (Not to mention the cases where having a fixed order makes understanding the function and its outputs much easier.) We might need to have a more dynamic documentation that depends on different versions (we had similar sort of tags for py2 vs py3), or perhaps some general disclaimer that the order might change (via some tag that implicitly sorts output like for a |
for the purpose of demonstrating one can mark such EXAMPLES #random, and do real testing in TESTS: |
@dimpase That would be the easy way out, but it sends a bit of the wrong message. The doctests are not actually random, they just depend on the version of GAP. A user should know the output is the same across runs and sessions (as they will find it useful). |
Actually, I think it is - additionally - important for a user to know that the order of the output may change across versions. |
output may also change if a GAP package is installed or removed |
As a general principle, I agree with you (especially when they change based on the packages installed/used). Although strictly speaking that is impossible to know as we cannot control what GAP might change in the future. However, if a user is relying on a particular order, then a user should understand that this could change across versions (and generally should just construct the element directly, which is not always useful for pedagogical purposes in docstrings). We don’t make an explicit promise that iteration orders in Sage do not change from version to version. |
@dimpase :
Maybe we could have a The general problem is how to have a framework for "testing examples" which allows to have alternate comparison functions somehow. I.e., we want to test that the character table printed out matches (in value and format) the one that is shown as part of the example, but we want to accept the variations that can change under different versions of the software. |
When creating a permutation group in Sage from a libGAP group, the default is to canonicalize the generators. However, when setting the libGAP group to the Sage permutation group, it still knows about its original generators, which can then make the objects out of sync with each other. In particular, if one tries to construct a group homorphism:
We should not canonicalize the group generators when setting the libgap group of the Sage group to the inputted group.
📝 Checklist
⌛ Dependencies