Skip to content

Speed up AutomorphismGroup for solvable Frattini-free groups - #6500

Merged
fingolfin merged 1 commit into
gap-system:masterfrom
fingolfin:claude/gap-autgrp-use-isfrattinifree
Aug 14, 2026
Merged

Speed up AutomorphismGroup for solvable Frattini-free groups#6500
fingolfin merged 1 commit into
gap-system:masterfrom
fingolfin:claude/gap-autgrp-use-isfrattinifree

Conversation

@fingolfin

Copy link
Copy Markdown
Member

Follow-up to #6487, implementing what @hulpke pointed out there:

The only reason for the HasIsFrattiniFree check in morpheus was the lack of a general IsFrattiniFree method (on which it would have hung). Once it exists the Has bit can be removed.

For a solvable group, AutomorphismGroup tested HasIsFrattiniFree(G) and IsFrattiniFree(G) before using AutomorphismGroupFrattFreeGroup, so that path was only ever taken for groups which had the property set beforehand -- in practice only those produced by the group construction and random isomorphism code. Now that IsFrattiniFree can be computed, the property is simply asked for.

Deciding IsFrattiniFree is cheap compared to constructing the automorphism group. Timings for the complete AutomorphismGroup call, so the cost of the new test is included in the "new" column:

group new old
SmallGroup(864,4675) 25ms 122ms
SmallGroup(600,148) 10ms 58ms
WreathProduct(SymmetricGroup(3),SymmetricGroup(3)) 29ms 84ms
SmallGroup(1080,497) 37ms 90ms
DihedralGroup(100) (not Frattini-free) 48ms 54ms

Note that AutomorphismGroupFrattFreeGroup was previously not reached by the test suite at all, and that the new route also applies to permutation and matrix groups, which the old one essentially never saw. It therefore seemed prudent to check it more broadly than the test suite does: for every solvable, non-nilpotent, Frattini-free group of order at most 200 the resulting automorphism group order was compared with the one obtained from AutomorphismGroupSolvableGroup, and for order at most 100 also with the one from the independent AutomorphismGroupMorpheus; the same was done for permutation representations of these groups. This covered 340 pc groups and 124 permutation groups without a single mismatch. The added test in AutomorphismGroup.tst makes sure the code path is exercised by CI from now on.

grppcext.gi guards a similar use of the property when deciding whether reducing a set of extensions is worthwhile. There the test whether the property is already known looks like a deliberate cost heuristic -- it sits next to a HasAutomorphismGroup check -- so it is left alone here; happy to revisit if that is wrong.

AI disclosure: prepared with the help of Claude Code (Opus 5), which made the change, ran the cross-checks and test suites described above, and drafted this description.

@fingolfin fingolfin added release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: performance bugs or enhancements related to performance (improvements or regressions) topic: library labels Aug 11, 2026
@lgoettgens

Copy link
Copy Markdown
Member

Seems sensible, but unfortunately tst/testbugfix/2012-06-05-t00245.tst:9 fails now due to StructureDescription failing on the resulting automorphism group

@hulpke

hulpke commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Seems sensible, but unfortunately tst/testbugfix/2012-06-05-t00245.tst:9 fails now due to StructureDescription failing on the resulting automorphism group

Presumably the issue is that the output is not marked as automorphism group, and so no methods apply.

@lgoettgens

Copy link
Copy Markdown
Member

Seems sensible, but unfortunately tst/testbugfix/2012-06-05-t00245.tst:9 fails now due to StructureDescription failing on the resulting automorphism group

The failure is a bit misleading, the error happens already in AutomorphismGroup. I tracked this down to the fact that the results of ComplementClassesRepresentativesSolvableWBG(G, K) do not know that they are finite in case that G is finite.

The respective call stack is AutomorphismGroupFrattFree -> Pcgs -> CompositionSeries, where there is no matching method if the input (which is obtained from ComplementClassesRepresentativesSolvableWBG does not know about itself being finite.

For a solvable group, AutomorphismGroup checked HasIsFrattiniFree before
using AutomorphismGroupFrattFreeGroup, so that path was taken only for
groups that had the property set beforehand, in practice only those coming
from the group construction and random isomorphism code. The reason was
that IsFrattiniFree had no method to compute it, so asking for it would
have run into an error.

Now that IsFrattiniFree is computable, ask for it directly. Deciding it is
cheap compared to constructing the automorphism group, and for the groups
it applies to the resulting speedup is a factor of two to six; for groups
which are not Frattini-free the extra test does not measurably cost
anything.

AutomorphismGroupFrattFreeGroup needs a pcgs not just for the group itself
but also for a complement of its Fitting subgroup, which for example is not
available for finitely presented groups. It is therefore only used for
groups that can easily compute a pcgs, which covers the pc groups and
solvable permutation groups the speedup was measured for.

Note that grppcext.gi guards a similar use of the property, in order to
decide whether reducing a set of extensions is worth it. There the check
whether the property is already known is a deliberate cost heuristic,
alongside a HasAutomorphismGroup check, so it is left alone.

Prepared with the help of Claude Code (Opus 5), which made the change,
cross-checked the results against the previous code path and against
AutomorphismGroupMorpheus, and ran the test suites.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fingolfin
fingolfin force-pushed the claude/gap-autgrp-use-isfrattinifree branch from 7df4b04 to 6b2b972 Compare August 13, 2026 23:49
@fingolfin

Copy link
Copy Markdown
Member Author

Fix committed

@fingolfin
fingolfin merged commit b8b9eab into gap-system:master Aug 14, 2026
30 checks passed
@fingolfin
fingolfin deleted the claude/gap-autgrp-use-isfrattinifree branch August 14, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: library topic: performance bugs or enhancements related to performance (improvements or regressions)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants