-
Notifications
You must be signed in to change notification settings - Fork 160
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
New Implementation of MTC #843
Conversation
Very nice! I think @james-d-mitchell or one of his students has also implemented a |
Current coverage is 48.92% (diff: 80.62%)@@ master #843 diff @@
==========================================
Files 422 422
Lines 233138 233842 +704
Methods 3479 3480 +1
Messages 0 0
Branches 0 0
==========================================
- Hits 114618 114417 -201
- Misses 118520 119425 +905
Partials 0 0
|
Maybe @fingolfin can have a quick look, then we can merge this? |
# fi; | ||
# as we add homomorphism specific entries, lets be safe and copy. | ||
# aug:=CopiedAugmentedCosetTable(aug); | ||
|
||
TrySecondaryImages(aug); |
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.
What is this newly added but commented out code about? Is this a deadend? Then it should be removed. Is it a place where a future extension is planned? Then it would be good to state that.
Otherwise, we'll just drag this around forever, and in years somebody will wonder what it's about,but unable to find out details...
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.
Oh wait, I now realize that this is part of the old implementation, which has been commented out (I read the diff incorrectly before).
But that doesn't change the general gist of my assesment: I'd prefer to remove this (if somebody wants the old code it is in the repo), or at least add an explanatory commend: "Code for the old MTC starts here:" and later a corresponding "... end here". Though I don't know who would benefit from carrying around this commented out code?
Caveat: I have not yet actually tried the new code in this PR. However, overall, I think it's absolutely great that @hulpke did this! Thanks a ton! While I'd personally wish there were a few more comments, the fact that this very closely follows the presentation in the Handbook should make it much easier to maintain this code in the future. The extra comments I'd hope for mostly would be about explaining a few of the implementation choices. But that's not a blocker to me at all, and I am confident that if need be, we can (a) ask Alexander, and (b) even if Alexander were not around, reverse engineer it with help of the Handbook. So, assuming that this code does not incur a major performance regression, I think it's an absolute nobrainer to merge it -- it should be a much better baseline than what we have right now. That said, of course some more tests, and in particular one that tests for #302 (and verifies that it is fixed by this PR) would be swell... And also a few more comments as suggested by my review comments... but none of these are serious blockers from my point of view, and could be added later on. |
Wow thanks, thats much more thorough that the "quick look" I suggested, thanks for that! I did try the code "by hand" and didn't notice any problems. That is of course not really a principled approach to testing... |
@fingolfin So far the ``old'' code is left in to see clearly what changed. If there is agreement to only rely on git for this change, I'd be happy to take it out as well. What also has not yet been implemented (and what I will do if there is agreement) is the special 1-generator version of the MTC used for `Size':
With that replaced, one can remove all of the ancient MTC, including its kernel functions. |
03f18bc
to
85b343f
Compare
In the current version all uses of the old Mtc are removed (as is the actual library function). Subgroup abelianization and cyclic subgroup presentations are handled by special variants of the Mtc. |
This allows for more flexibility in use and experimentation, as almost all code is in the library. It also will fix the problem of gap-system#302.
This fixes the previously reported bug. Close gap-system#302
by possibly not optimizing.
Also use new TC for cyclic index subgroup when computing size. Quiet option.
Removed library code for old version that is now obsolete.
@hulpke I've tested manual examples - does the new output look OK to you?
|
@alex-konovalov |
@hulpke thanks - and even this one, where the output is missing completely?
|
There has been (in #302) a bug reported in the implementation of GAP's MTC. This is essentially still GAP3 code that was written by Volkmar Felsch in the early 1990s (and the bug was present in GAP 3).
The existing code is hard to understand and to debug as it moves all interesting work into a big kernel function `MakeConsequences'. It also is limited by sticking to some aspects (e.g. decomposition tree) of the MTC that stem from the 1970s and were in response to limited memory at that time. Besides the difficulty of debugging the code, it also makes it hard to experiment with it.
This PR contains a new from scratch implementation of a MTC (and also a plain TC) based on the description in the Handbook of CGT. It uses the fact that we have a memory manager and thus can be more flexible in handling lists.(For example, it seems to be easier to index the coset table by the numbers of the generators, even if it leaves gaps.)
It deliberately only keeps the scanning in a (very small) kernel function to allow for access to all other aspects of the code to allow, for example, easy implementation of other strategies.
Also included is use of this new code for (appropriate) fp group homomorphisms, this fixes #302.
Compared with the ordinary TC in GAP it currently is still a bit slower, but not by magnitudes. (The proposal keeps the existing ordinary TC and RRS in place and only concerns the MTC.)
It allows for using the strategy (that was implemented in the ITC package) of using collapses of a prior TC run to guide the definition process. Doing so can reduce the number of cosets to be defined very substantially and thus improve the result of the presentation produced by the MTC. (Doing so avoids the problem of the MTC choking in the generator elimination stage, which was a frequent occurrence and made it unusable in most cases.)
The functionality is exercised by existing tests, a few specific manual examples will be affected (and have not been changed).
The old MTC code is not yet removed, though it will not run any longer.