Skip to content

perf: keep extension-built suffixes and store inverse representatives - #10833

Open
kim-em wants to merge 1 commit into
mainfrom
perf/perm-group-one-phase
Open

kim-em wants to merge 1 commit into
mainfrom
perf/perm-group-one-phase

Conversation

@kim-em

@kim-em kim-em commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

This PR speeds up compiled Schreier-Sims in HexPermGroup by 3 to 50 times. Group.ofGenerators on the Rubik's cube group drops from 639 ms to 37 ms, and on Co3 from 2.6 s to 49 ms, now 1.3 to 24 times slower than GAP on the groups measured.

Build.build now keeps the chain built by extension during the first level's scan as the suffix, instead of constructing each level's suffix a second time; it is complete started from the trivial suffix, like Build.empty. Kernel.certify builds its own chain since #10814 "perf: smaller perm_group certificates without inverse generators", so stored chains no longer need their lower generators to be Schreier generators. The budgeted builder follows, and the hand-derived C₂ work counts in conformance/HexPermGroup/Limits.lean return to a single trivial suffix.

Orbit gains invs and idReps, with default values and default proofs of invs_eq and idReps_eq, so existing constructors are unchanged. @[csimp] replacements of Chain.sift and Orbit.schreier multiply by the stored inverses and skip identity representatives; the fields' equations make them equal to the definitions on every chain. One conformance example that built a corrupted orbit with { swapOrbit with reps := … } now writes the orbit out, so its stored inverses are recomputed.

Fixtures from hexpermgroup_emit_fixtures are unchanged and all HexPermGroup bench hashes match. reports/20261006-perm-group-compiled-speedups.md records before and after timings against GAP.

🤖 Prepared with Claude Code

@kim-em
kim-em force-pushed the perf/perm-group-small-certificates branch from f142e5b to f4989bf Compare October 6, 2026 14:17
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kim-em
kim-em force-pushed the perf/perm-group-one-phase branch from 2ef6190 to f2f75f3 Compare October 6, 2026 16:01
@kim-em
kim-em changed the base branch from perf/perm-group-small-certificates to main October 6, 2026 16:01

This branch has not been deployed

No deployments
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.

1 participant