Skip to content

Index more selection criteria - #69

Merged
fingolfin merged 1 commit into
masterfrom
better-indexing
Aug 6, 2026
Merged

Index more selection criteria#69
fingolfin merged 1 commit into
masterfrom
better-indexing

Conversation

@fingolfin

Copy link
Copy Markdown
Member

SelectSmallGroups, and with it AllSmallGroups, OneSmallGroup and IdsOfAllSmallGroups, constructed every group of an order whenever that order had no property data in the library files. So

AllSmallGroups(1920, IsSolvableGroup, false);

built all 241004 groups of order 1920, although only the last 588 of them are the ones asked for, and

AllSmallGroups(512, RankPGroup, 2);

was hopeless at 10494213 groups.

For most such orders the value of a criterion follows from the position a group has in the library. Add a hook, SMALL_GROUPS_PROPERTIES_FUNCS, in which a layer declares what it knows, and let the generic selection function use it, so that a selection using only indexed criteria constructs no group at all. What the layers contribute:

  • orders of prime power order are nilpotent, hence supersolvable and solvable; those of squarefree order are supersolvable, and only the cyclic one among them is nilpotent; those of cubefree order are solvable unless they have a direct factor PSL(2,p), and their nilpotent and abelian groups coincide, as every Sylow subgroup has order p or p^2; and the orders involving at most two primes are solvable by Burnside, with the nilpotent groups coming first.

  • the ranks and p-classes of the groups of order 512 move from SMALL_GROUPS_INFORMATION[ 18 ] into SMALL_GROUPS_512_TYPES, which the selection functions and the information function now share; the ranks of the orders p^4 and p^5 come from the formulas the corresponding information functions already used.

  • for the orders 5^6, 7^6, 3^7 and 5^7, and for the abelian groups of order 512, nothing was recorded that could be propagated, and the numbers cannot be described independently of p. These were determined once by brute force and are stored in SMALLGRP_P6_INDEX, SMALLGRP_P7_INDEX and SMALL_GROUPS_PROPERTIES_FUNCS[ 18 ]; tst/verify-indices.g checks them against the groups themselves.

Sets of group numbers, which the data files describe by marking the end of a run of consecutive numbers with a negative entry, are described by ranges from here on, as in [ [ 1 .. 3 ], 5, [ 8 .. 11 ] ]. The four local helpers layer 8 used for them become the globals SMALL_IDS_EXPAND, SMALL_IDS_UNION, SMALL_IDS_INTERSECTION and SMALL_IDS_DIFFERENCE, and SMALL_IDS_FROM_LIBRARY translates the description used in the files.

SelectSmallGroups now also preprocesses its query, so that every order treats a criterion alike: IsSolvable, IsNilpotent and IsSupersolvable are replaced by the properties they stand for, a criterion admitting both true and false is dropped, and a property asked for a value which is not a boolean is consistently an error.

Along the way, fix IdsOfAllSmallGroups to honour a given list of group numbers also when every criterion is answered from the property data; IdsOfAllSmallGroups(96, [1, 2, 3], IsAbelian, true) used to ignore the list and return the ids of all abelian groups of order 96.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Closes #4

@fingolfin
fingolfin requested a review from ThomasBreuer August 1, 2026 15:19
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.00071% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.87%. Comparing base (ccac00c) to head (a5b695d).

Files with missing lines Patch % Lines
small2/smlgp2.g 76.66% 7 Missing ⚠️
gap/small.gi 98.76% 3 Missing ⚠️
gap/smlinfo.gi 96.22% 2 Missing ⚠️
small10/smlgp10.g 95.65% 1 Missing ⚠️
small6/smlgp6.g 99.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   99.84%   99.87%   +0.02%     
==========================================
  Files         493      502       +9     
  Lines      327377   338190   +10813     
==========================================
+ Hits       326861   337758   +10897     
+ Misses        516      432      -84     
Files with missing lines Coverage Δ
gap/small.gd 100.00% <ø> (ø)
small11/smlgp11.g 95.93% <100.00%> (+3.42%) ⬆️
small3/smlgp3.g 94.62% <100.00%> (+8.21%) ⬆️
small4/smlgp4.g 91.10% <100.00%> (+0.03%) ⬆️
small7/smlgp7.g 94.13% <100.00%> (+1.51%) ⬆️
small8/smlgp8.g 53.27% <100.00%> (+14.26%) ⬆️
small9/smlgp9.g 99.36% <100.00%> (+0.27%) ⬆️
small10/smlgp10.g 98.29% <95.65%> (+1.12%) ⬆️
small6/smlgp6.g 99.67% <99.87%> (+2.15%) ⬆️
gap/smlinfo.gi 99.03% <96.22%> (-0.63%) ⬇️
... and 2 more

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ThomasBreuer ThomasBreuer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is impressive.

In order to find where the available information is stored, the code of SmallGroupsInformation shows the source of the precomputed data, and one can access them much easier than before.

The new text in CHANGES.md is irritating.
There is the statement that SmallGroupsInformation lists the functions for which precomputed information is available.
For example, IsSupersolvableGroup information is not available for the group orders 1152, 1536, and 1920.
However, the first sentence of the text lists IsSupersolvable as one of the functions for which the selection is now cheaper for these orders.

@ThomasBreuer

Copy link
Copy Markdown

Thanks for the additions.
I have no more comments.

@fingolfin

Copy link
Copy Markdown
Member Author

We've added the "missing" indices for IsSupersolvable, and also added missing indices for IsAbelian. I've also asked the AI to make the changelog entry, documentation, and code comments terser and more on the point in general. I'll have to review the result myself now.

`SelectSmallGroups` constructed every group of an order whenever that
order had no property data in the library files:

    AllSmallGroups(1920, IsSolvableGroup, false);      # 241004 groups
    AllSmallGroups(512, RankPGroup, 2);              # 10494213 groups
    IdsOfAllSmallGroups([1 .. 2000], IsSupersolvableGroup, false);
                                                 # 412 million groups

For most such orders the value follows from where a group sits.
`SMALL_GROUPS_PROPERTIES_FUNCS` lets a layer say what it knows and the
generic selection function uses it, so a selection using only indexed
criteria constructs nothing. What the layers contribute:

* prime power orders are nilpotent, hence supersolvable and solvable;
  squarefree orders are supersolvable and only the cyclic one nilpotent;
  cubefree orders are solvable unless they have a direct factor
  PSL(2,p), and there nilpotent and abelian coincide, every Sylow
  subgroup having order p or p^2.
* an order q^n * p with p occurring once is sorted by normal Sylow
  subgroups: solvable by Burnside, nilpotent first, supersolvable
  exactly with a normal Sylow p-subgroup, or a normal Sylow q-subgroup
  and q = 1 mod p, the irreducible F_q[C_p]-modules being 1-dimensional
  then. Its nilpotent groups are those of order q^n times C_p in the
  same order, so the abelian ones keep their places -- which settles
  `IsAbelian` for 768, 1152, 1536 and 1920, where searching would have
  meant up to 10494213 groups.
* the ranks and p-classes of order 512 move from
  SMALL_GROUPS_INFORMATION[ 18 ] into SMALL_GROUPS_512_TYPES, now shared
  between the two; those of p^4 and p^5 come from the formulas the
  information functions already used.
* what no ordering yields was found once by brute force and stored: the
  abelian groups of order 512, the ranks and p-classes of 5^6, 7^6, 3^7
  and 5^7, and the 13010 groups of order 1152 which are not
  supersolvable. tst/verify-indices.g checks these against the groups.

Sets of group numbers become lists of runs, [ 1, [ 5 .. 8 ], 12 ]. The
four helpers layer 8 kept to itself become SMALL_IDS_EXPAND, _UNION,
_INTERSECTION and _DIFFERENCE, with SMALL_IDS_FROM_LIBRARY for the form
the data files use.

A criterion now means the same for every order: `IsSolvable` and its
kind are replaced by the properties they stand for, one admitting both
`true` and `false` is dropped, and a property asked for a non-boolean is
an error.

Two fixes on the way. Selection by `LGLength` missed the groups having
none, the library storing `false` where the attribute returns `fail`. A
given list of group numbers was ignored when every criterion was
indexed, so `IdsOfAllSmallGroups(96, [1, 2, 3], IsAbelian, true)`
returned all abelian groups of order 96.

Closes #4. Indexing `IsSupersolvableGroup` was Thomas Breuer's
suggestion there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fingolfin
fingolfin merged commit 1dd4724 into master Aug 6, 2026
4 of 5 checks passed
@fingolfin
fingolfin deleted the better-indexing branch August 6, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve SelectSmallGroups to cover more orders efficiently

2 participants