Skip to content

Fix SimpleGroupsIterator for start values just below 10^18 - #6512

Open
fingolfin wants to merge 1 commit into
masterfrom
mh/fix-simplegroupsiterator-second-table
Open

Fix SimpleGroupsIterator for start values just below 10^18#6512
fingolfin wants to merge 1 commit into
masterfrom
mh/fix-simplegroupsiterator-second-table

Conversation

@fingolfin

Copy link
Copy Markdown
Member

The orders of the non-PSL(2,q) simple groups come in two lists, the second loaded on demand. The iterator asked for it once start reached 10^18, but the first list ends already at 911215823217986880, so for a start value between the two nothing was loaded, the search for the first relevant entry returned fail, and building the iterator broke on indexing the list with it.

Load the second list when the search comes up empty instead, which is what NextIterator_SimGp already does, and report an order beyond the documented range rather than indexing with fail -- that case failed the same way above the second list.

Assistance from Claude Code (Claude Opus 5): diagnosis from a stack trace, the fix, and the regression test.

The orders of the non-PSL(2,q) simple groups come in two lists,
the second loaded on demand. The iterator asked for it once
`start` reached 10^18, but the first list ends already at
911215823217986880, so for a start value between the two nothing
was loaded, the search for the first relevant entry returned
`fail`, and building the iterator broke on indexing the list with
it.

Load the second list when the search comes up empty instead, which
is what `NextIterator_SimGp` already does, and report an order
beyond the documented range rather than indexing with `fail` --
that case failed the same way above the second list.

Assistance from Claude Code (Claude Opus 5): diagnosis from a
stack trace, the fix, and the regression test.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them kind: bug: unexpected error Issues describing bugs in which computation unexpectedly encounters an error, and PRs fixing them release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels Aug 15, 2026
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.91%. Comparing base (8636b5a) to head (857e552).

Files with missing lines Patch % Lines
grp/simple.gi 77.77% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6512   +/-   ##
=======================================
  Coverage   78.91%   78.91%           
=======================================
  Files         685      685           
  Lines      294159   294170   +11     
  Branches     8669     8646   -23     
=======================================
+ Hits       232142   232155   +13     
+ Misses      60213    60212    -1     
+ Partials     1804     1803    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ThomasBreuer ThomasBreuer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice.
Once we are at it, the documentation can can be fixed as well.

Comment thread grp/simple.gi
pos:=PositionProperty(SIMPLEGPSNONL2,x->x[1]>=start);
if pos=fail then
Error("List of simple groups only available up to order ",
SIMPLE_GROUPS_ITERATOR_RANGE);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The effect is that already the SimpleGroupsIterator( start ) call errors with a useful message if start is too large, which is good. (This can be even tested cheaply now.)

The documentation of SimpleGroupsIterator

This function returns an iterator that will run over all nonabelian simple groups, starting at order start if specified, up to order 10^27 (or -- if specified -- order end).

is not correct if end is larger than 10^27.

Comment thread grp/simple.gi
if start>=10^18 then LOADSIMPLE2(); fi;
pos:=First([1..Length(SIMPLEGPSNONL2)],x->SIMPLEGPSNONL2[x][1]>=start);
# Running off the end of the first list is what says the second one is
# needed. Testing `start' against a fixed bound instead left a window between

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment describes the current change.
As a comment in the code, it might be irritating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: bug: unexpected error Issues describing bugs in which computation unexpectedly encounters an error, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants