Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #174 +/- ##
==========================================
+ Coverage 71.51% 71.83% +0.31%
==========================================
Files 88 88
Lines 13029 13175 +146
==========================================
+ Hits 9318 9464 +146
Misses 3711 3711
🚀 New features to boost your workflow:
|
fingolfin
force-pushed
the
mh-claude/addtoigs-speedup
branch
2 times, most recently
from
October 3, 2026 22:25
95930aa to
ef37493
Compare
This was referenced Oct 12, 2026
Merged
fingolfin
force-pushed
the
mh-claude/addtoigs-speedup
branch
from
October 17, 2026 10:33
ef37493 to
f930200
Compare
Most of the time went into commutators that were computed only to be
discarded because they already lay in the tail of the igs: for UT(20,5)
with 1000 random elements, about 15,000 of 16,000. A table of lower
bounds for commutator depths, derived from the presentation once per
collector and cached in it, lets the loop skip those without computing
them.
The generators are now taken one at a time, each closed under powers
and commutators before the next is sifted, so the tail limit drops as
early as possible. In groups with infinite relative orders a generator
is reduced only just before it is sifted instead of every time the igs
changes; with many generators that reduction dominated the running
time. In infinite groups with few generators the running time depends
strongly on processing order, and the new order is slower on some
inputs.
Setup:
gap> ut := function(n, p, k) local G; G := UnitriangularPcpGroup(n, p); Reset(GlobalMersenneTwister, 1); return List([1..k], i -> Random(G)); end;;
gap> dt := function(n, k) local G; G := UnitriangularPcpGroup(n, 0); AddHallPolynomials(Collector(G)); Reset(GlobalMersenneTwister, 1); return List([1..k], i -> Random(G)); end;;
gap> sift := function(gens) local t; t := Runtime(); AddToIgs([], gens); return Runtime() - t; end;;
Before:
gap> sift(ut(20, 5, 30));
19245
gap> sift(ut(20, 5, 1000));
18643
gap> sift(ut(25, 5, 1000));
163026
gap> sift(ut(6, 0, 1000));
200
gap> sift(dt(10, 1000));
13987
After:
gap> sift(ut(20, 5, 30));
4424
gap> sift(ut(20, 5, 1000));
7095
gap> sift(ut(25, 5, 1000));
42009
gap> sift(ut(6, 0, 1000));
7
gap> sift(dt(10, 1000));
410
Assisted-by: Generative AI
fingolfin
force-pushed
the
mh-claude/addtoigs-speedup
branch
from
October 22, 2026 23:23
f930200 to
6fe05f3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of the time went into commutators that were computed only to be discarded because they already lay in the tail of the igs: for UT(20,5) with 1000 random elements, 15,000 of 16,000. A table of lower bounds for commutator depths, derived from the presentation once per collector and cached in it, lets the loop skip those without computing them.
The generators are now taken one at a time, each closed under powers and commutators before the next is sifted, so the tail limit drops as early as possible. In groups with infinite relative orders a generator is reduced only just before it is sifted instead of every time the igs changes; with many generators that reduction dominated the running time. Inverse powers of igs entries are cached during sifting.
UT(20,5), 1000 elements: 24 s -> 7 s. UT(25,5): 260 s -> 43 s. UT(30,5): more than 30 min -> 5.4 min. UT(6,Z), 1000 elements: 0.8 s -> 0.02 s. In infinite groups with few generators the running time depends on processing order either way; over 48 seeds in UT(6,Z) with 10 elements the new order is faster on 31 and slower on 10.
Assisted-by: Claude Code (Opus 5.5, Fable 5.1)
Vibe coded, I have not yet reviewed it myself, though the numbers sound impressive.