-
-
Notifications
You must be signed in to change notification settings - Fork 600
handle permutations in S_n with n > 2^16 #39999
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
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 4306a45; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the failing tests have nothing to do with these changes. If so, feel free to set this to positive review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except I have one question: did you look at the memory usage of your doctest? Does it require a lot of memory?
In theory it just needs to allocate an array 2**17 of
via:
vs
|
should this extreme high RAM test be marked as |
I added and tried to make the example less memory intensive, but didn't succeed on that front: sage: from resource import *
sage: print(getrusage(RUSAGE_SELF)[2]/1024.**2)
220.046875000000
sage: SymmetricGroup(2**16+1)((2**16,2**16+1))._libgap_()
(65536,65537)
sage: print(getrusage(RUSAGE_SELF)[2]/1024.**2)
319.703125000000 |
can't you make sparse permutations in GAP? (probably not, as I vaguely recall). If not, then any test is bound to be RAM-expensive. |
There are small and large permutations, both stored in the one line representation, see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Thank you |
Yea, it doesn't seem like there is a better solution. I slightly lean towards making it a |
I don't think is such a big issue, I am sure there other tests that take similar amount of memory. |
by the way, was it tested on a 32-bit system? |
I do not know, as I do not have access to such machines. I don't think the behavior will change in 32 bits, as the short permutations use 16 bit arrays, and large ones use 32 bits arrays. Also, gap doesn't support permutation groups larger than 2^32, but one will also encounter other problems before getting there
|
if this test crashes on 32-bit CPU, it should be tagged appropriately. (unless I missed an announcement that we dropped 32-bit) |
I don't see why it would crash a 32bit, we are switching between arrays of
to arrays of
https://github.com/gap-system/gap/blob/master/src/common.h#L94-L97 both types are supported in 32 bits. I am just saying that we never need to go to larger than that |
above you point to a line of code and say that on 32-bit one won't get there |
I was just answering the hypothetical question. Can we handle S_n for n >= 2^32? I don't think so |
I would be curious if there are actually other such tests. This isn’t something we considered so explicitly before, but a policy about this might be good to have. This ended up being such a clear case. |
With regards to 32 bit, I think we will just have to wait to see what Volker says from his testing… Sorry in advance Volker if this breaks on 32 bit. |
sagemathgh-39999: handle permutations in S_n with n > 2^16 This resolves sagemath#39998, as the issue is gap having small and large permutations: https://github.com/gap-system/gap/blob/f0b438db8fa5786d19975e6040076fd46 b08bd85/src/permutat.h#L18-L26 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. URL: sagemath#39999 Reported by: Edgar Costa Reviewer(s): Dima Pasechnik, Julian Rüth, Travis Scrimshaw
sagemathgh-39999: handle permutations in S_n with n > 2^16 This resolves sagemath#39998, as the issue is gap having small and large permutations: https://github.com/gap-system/gap/blob/f0b438db8fa5786d19975e6040076fd46 b08bd85/src/permutat.h#L18-L26 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. URL: sagemath#39999 Reported by: Edgar Costa Reviewer(s): Dima Pasechnik, Julian Rüth, Travis Scrimshaw
This resolves #39998, as the issue is gap having small and large permutations:
https://github.com/gap-system/gap/blob/f0b438db8fa5786d19975e6040076fd46b08bd85/src/permutat.h#L18-L26
📝 Checklist