Move the library of perfect groups into the PerfGrp package - #6488
Move the library of perfect groups into the PerfGrp package#6488fingolfin wants to merge 3 commits into
PerfGrp package#6488Conversation
The Holt/Plesken/Hulpke library of finite perfect groups, its access functions, and the methods for computing perfect and simple subgroups of a finite group now live in the new PerfGrp package, which is added to the list of packages needed by GAP. This removes about 29 MB of data from the core system and allows the library to be updated independently of GAP releases. `IsPerfectGroup` and `PerfectResiduum` stay in the library, as do the declarations of `RepresentativesPerfectSubgroups`, `RepresentativesSimpleSubgroups` and `ConjugacyClassesPerfectSubgroups`. The latter two attributes get generic fallback methods that answer the solvable case and otherwise report that PerfGrp is required, so that GAP started via `gap --bare` still behaves sensibly. Prepared with the help of Claude Code (Claude Opus 5), which performed the extraction, wired up the package, and adjusted documentation and tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PerfGrp package
|
Perhaps a good idea to check in advance which packages should have |
limakzi
left a comment
There was a problem hiding this comment.
I have not reviewed the code; I like the change to move perfect-groups to package.
|
@gap-package-distribution-bot test |
PackageDistro test for #6488
Full reportPackage Evaluation Report for GAP
|
|
Actually, no, wait, that can't work now, without the PerfGrp package in the distro. My bad. I'll cancel that CI run. We first need to generally agree on this. In particular, that definitely needs @hulpke to weigh in, who after all did most of the work on the perfect groups library in GAP; and in general I'd like to let this sit a while to give more people a chance to ponder this and to comment. No rush on this anyway. |
hulpke
left a comment
There was a problem hiding this comment.
I have no problem with moving this into a package if someone considers it as important.
Just the caveat that this data is absolutely necessary for computing subgroups -- there is no fallback possibility in the subgroup lattice algorithm, so this package cannot become optional.
|
@hulpke glad to hear! BTW I've sent you an invite for https://github.com/gap-packages/perfgrp so you have full access to that. If you have some time, please have a look at it, even a brief one, at least at README at And yeah with this PR, Right now the |
…age-extraction-002a39
Two of the five classes of maximal subgroups of A_6 are perfect, and perfect subgroups cannot be reached by cyclic extension, so the lattice fallback used by `MaximalSubgroupClassReps` cannot find them once the perfect groups library lives in a package that is not loaded. Guard the test accordingly. Also use `ErrorNoReturn` rather than `Error` in the fallback methods for `RepresentativesPerfectSubgroups` and `RepresentativesSimpleSubgroups`, since there is nothing sensible to return from them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Lost test coverage for the
|
| PrimGrp | PerfGrp | what happens |
|---|---|---|
| yes | yes | MaximalSubgroupsSymmAlt succeeds, the recursion path is never entered |
| no | no | path entered, but cannot complete — only a clean error is observable |
| no | yes | path entered and completes — this is the real test |
testinstall covers the first row and testinstall-bare the second, so after
this PR the fix from #6482 is exercised by no CI configuration. Note also that
the third row cannot be reached by a normal GAP start, because PrimGrp is
itself a needed package; it takes gap --bare plus an explicit
LoadPackage("perfgrp"). I checked that it does work:
$ gap -q --bare -c 'LoadPackage("perfgrp");; SetInfoLevel(InfoPerformance,0); \
G:=AlternatingGroup(6);; m:=MaximalSubgroupClassReps(G);; \
Print(SortedList(List(m,H->Index(G,H))),"\n"); QUIT;'
[ 6, 6, 10, 15, 15 ]
Options, roughly in increasing order of effort:
- Accept the gap. The fix in
lib/maxsub.giis small and unlikely to regress
unnoticed, and an infinite recursion would show up as a CI timeout anyway. - Assert only that it fails cleanly in the bare case, which at least rules out
the recursion. I tried this and backed out:#@commands may not appear
inside an expected-output block, so an#@elsebranch matching the error
text does not parse without contortions, and matching the message text is
brittle. - Add a small test that runs in the third configuration above, i.e.
--bare
plusLoadPackage("perfgrp"). This is the only option that restores the
original assertion. It does not fittst/testinstall/, so it would need
either atst/testspecial/-style script or an extra CI step.
I have no strong preference and have gone with (1) for now, since it keeps this
PR focused. Happy to implement (3) here or in a follow-up if you would rather
not lose the coverage.
Written with Claude Opus 5 in Claude Code, which also carried out the
investigation and the test runs quoted above.
Summary
This moves the Holt/Plesken/Hulpke library of finite perfect groups out of the GAP core system and into a new package
PerfGrp, in the same way that the small groups, transitive groups and primitive groups libraries were moved intoSmallGrp,TransGrpandPrimGrpsome years ago.The library keeps working exactly as before for anyone running a normal GAP:
PerfGrpis added to GAP's list of needed packages, so it is loaded at startup just like the other three.Why now
Thomas Breuer and I have talked about this on and off over the years and agreed it was probably a good idea, but neither of us ever got as far as filing an issue about it. I was about to finally do that, and instead decided to find out whether Claude Opus 5 could carry out the split. It could, so here is the pull request rather than the issue.
What moves
grp/perf.gdandgrp/perf.grp, i.e. the declarations and the access functions for the library.grp/perf0.grp…grp/perf34.grp, about 28 MB.RepsPerfSimpSubfromlib/grplatt.gi, together with the methods it backs forRepresentativesPerfectSubgroupsandRepresentativesSimpleSubgroups.doc/ref/grplib.xml, which becomes a chapter of the package manual.In total this removes 35 files and about 530 000 lines from the repository, and shrinks
grp/from roughly 35 MB to 6.8 MB. Outside the data files the diff is 24 files, +66/−948 lines.What stays
IsPerfectGroupandPerfectResiduum, which have nothing to do with the data library.RepresentativesPerfectSubgroups,RepresentativesSimpleSubgroupsandConjugacyClassesPerfectSubgroupsinlib/grp.gd, along with their documentation in the reference manual. These are part of GAP's group theory interface; only the implementation that needs the data library moves out.ConjugacyClassesPerfectSubgroupsmethod and theRepresentativesPerfectSubgroupsmethod for solvable groups.Behaviour without the package
Since
PerfGrpis a needed package, this only matters forgap --bareand similar developer scenarios. There:RepresentativesPerfectSubgroupsandRepresentativesSimpleSubgroupsfall back to methods that answer the solvable case directly and otherwise raise an error naming the package.PerfGrpinstalls the real methods at a higher rank.lib/init.gbindsPerfectGroup,PerfectIdentification,PerfGrpLoad,NumberPerfectGroups/NrPerfectGroupsandPERFRecto dummy values, in the same style as the existing stubs forIdGroup,SmallGroupandPrimitiveGroup. Without these, library references to those names produce "unbound global variable" syntax warnings at every startup.IsomorphismFpGroupfor nonabelian simple permutation groups (lib/gpfpiso.gi) andStructureDescription(lib/grpnames.gi). Both keep working withoutPerfGrp, just without the shortcut.#@if IsPackageMarkedForLoading( "perfgrp", "" ), as is already done forsmallgrpandprimgrpelsewhere intst/.The package
The package is prepared at gap-packages/perfgrp, next to
SmallGrpandPrimGrpand set up the same way: the shared workflow files, the same test layout, an AutoDoc manual,TestFileinPackageInfo.g. Releases are made with the usualgap-actions/release-pkgautomation, which also compresses the data files and updates the package website.Alexander Hulpke is listed as author and maintainer, and Holt, Plesken and Felsch are credited as authors for the original library and its conversion to GAP format. "The GAP Team" is listed as a further maintainer, as with the other group libraries distributed with GAP, so that routine upkeep — CI, release mechanics, keeping the package working with new GAP versions — does not have to wait on any one person.
The manual now also cites The perfect groups of order up to two million where it describes the classification of the orders not covered by Holt and Plesken, which the reference manual never did.
The package can be loaded into GAP 4.16 and earlier, where it is a no-op because GAP still provides the library itself. This is meant to make the transition easier: the package can be released and enter the distribution before this pull request is merged.
It has not been released yet, so there is still room to adjust details: how the repository is laid out, how the manual is organised, the exact author and credit lines. Suggestions welcome.
Sequencing
This cannot be merged before
PerfGrphas been released and added to the package distribution, since GAP will refuse to start without it. CI here will fail until then.Testing
testinstallpasses, both normally and with--bare.testbugfixpasses (517 files).teststandardfiles that exercise the perfect groups library pass.stable-4.16build, where it loads as a no-op.AI disclosure
The split was carried out by Claude Opus 5 running in Claude Code: locating everything that had to move, moving it, setting up the package, adjusting the documentation and tests, and running the test suites. I directed the work and reviewed the result. The commits are co-authored accordingly.
🤖 Generated with Claude Code