Skip to content

Name the functions shared between layers - #71

Merged
fingolfin merged 2 commits into
masterfrom
name-shared-layer-functions
Aug 7, 2026
Merged

Name the functions shared between layers#71
fingolfin merged 2 commits into
masterfrom
name-shared-layer-functions

Conversation

@fingolfin

Copy link
Copy Markdown
Member

First step towards #67. No behaviour change; every array entry stays, so
sglppow and SOTGrps keep working untouched.

Extending the library currently means filling six arrays by number, ending
with the line both extension packages contain:

SELECT_SMALL_GROUPS_FUNCS[ SOTGRPS_POS ] := SELECT_SMALL_GROUPS_FUNCS[ 11 ];

Nothing says what 11 is. A survey found the tangle is smaller than the file
layout suggests — exactly three functions are used across layers, and
everything else is within one layer:

slot name
SELECT_SMALL_GROUPS_FUNCS[11] SMALL_GROUPS_SELECT_GENERIC
ID_GROUP_FUNCS[8] ID_GROUP_BY_TREE
CODE_SMALL_GROUP_FUNCS[8] CODE_SMALL_GROUP_FROM_LIB

Only the generic selection moves file, from small3 to gap/small.gi, since
it belongs to no layer and that file is read first.

SMALL_GROUP_FUNCS also held three helpers taking arguments other than
( size, i, inforec ), which no inforec ever dispatched to — they were
parked in the dispatch table. They become SMALL_GROUP_1152_1920_FROM_CODE,
SMALL_GROUP_P6_NUMBER and SMALL_GROUP_P6_EXPONENT, freeing slots 13, 22
and 23 and ending the collision between SMALL_GROUP_FUNCS[13] and the
unrelated ID_GROUP_FUNCS[13]. Each gets a DeclareGlobalName where it is
first used rather than moving, to keep the diff reviewable.

tst/small.tst asserts which slots are occupied, so its expectation changes
accordingly.

Verified

  • smallgrp test suite, 0 failures in 11 files
  • tst/verify-indices.g, 0 failures
  • manual builds without warnings
  • sglppow, 0 failures in 3 files, unmodified
  • SOTGrps, 0 failures in 5 files, unmodified

The last two are the point: both reference SELECT_SMALL_GROUPS_FUNCS[11] by
number, and exercise the compatibility aliases against released code.

@fingolfin
fingolfin force-pushed the name-shared-layer-functions branch from 3889864 to 13203bb Compare August 6, 2026 22:28
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.86047% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.88%. Comparing base (1dd4724) to head (47fb0b1).

Files with missing lines Patch % Lines
gap/small.gi 93.75% 3 Missing ⚠️
id3/idgrp3.g 66.66% 2 Missing ⚠️
id4/idgrp4.g 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   99.87%   99.88%   +0.01%     
==========================================
  Files         502      507       +5     
  Lines      338190   370982   +32792     
==========================================
+ Hits       337758   370557   +32799     
+ Misses        432      425       -7     
Files with missing lines Coverage Δ
id10/idgrp10.g 98.87% <100.00%> (ø)
id2/idgrp2.g 71.55% <100.00%> (+0.12%) ⬆️
id6/idgrp6.g 96.15% <100.00%> (ø)
small10/smlgp10.g 98.29% <100.00%> (ø)
small11/smlgp11.g 97.96% <100.00%> (+2.03%) ⬆️
small2/smlgp2.g 85.91% <100.00%> (+0.06%) ⬆️
small3/smlgp3.g 94.79% <100.00%> (+0.17%) ⬆️
small4/smlgp4.g 91.10% <100.00%> (ø)
small6/smlgp6.g 99.67% <100.00%> (+<0.01%) ⬆️
small7/smlgp7.g 94.13% <100.00%> (ø)
... and 5 more

... and 5 files with indirect coverage changes

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

Extending the library means filling six arrays by number, ending with

    SELECT_SMALL_GROUPS_FUNCS[ SOTGRPS_POS ] := SELECT_SMALL_GROUPS_FUNCS[ 11 ];

as sglppow and SOTGrps both do. Nothing says what 11 is: the generic
selection, sitting in layer 3 because that is where it was first needed.
Three functions are used across layers; give them names.

    SELECT_SMALL_GROUPS_FUNCS[ 11 ]  SMALL_GROUPS_SELECT_GENERIC
    ID_GROUP_FUNCS[ 8 ]              ID_GROUP_BY_TREE
    CODE_SMALL_GROUP_FUNCS[ 8 ]      CODE_SMALL_GROUP_FROM_LIB

Only the generic selection moves file, from small3 to gap/small.gi, which
belongs to no layer and is read first. Every array entry stays, so
extensions written against the numbers keep working; sglppow and SOTGrps
pass untouched.

SMALL_GROUP_FUNCS also held three helpers taking arguments other than
( size, i, inforec ), which no inforec ever dispatched to:

    SMALL_GROUP_FUNCS[ 13 ]  SMALL_GROUP_1152_1920_FROM_CODE
    SMALL_GROUP_FUNCS[ 22 ]  SMALL_GROUP_P6_NUMBER
    SMALL_GROUP_FUNCS[ 23 ]  SMALL_GROUP_P6_EXPONENT

They are used above their definition, so they get a DeclareGlobalName
rather than moving. This frees 13, 22 and 23, and ends the collision
between SMALL_GROUP_FUNCS[ 13 ] and the unrelated ID_GROUP_FUNCS[ 13 ].

Towards #67.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fingolfin
fingolfin force-pushed the name-shared-layer-functions branch from 13203bb to 30c48fb Compare August 6, 2026 23:47
The 4912 groups of order 768 without a normal Sylow subgroup are read from
four separate files, and no test built one. Of the orders p^7 only 5^7 was
built, by tst/ordering.tst. 72 ms for the lot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fingolfin
fingolfin merged commit ce4a0e6 into master Aug 7, 2026
4 of 5 checks passed
@fingolfin
fingolfin deleted the name-shared-layer-functions branch August 7, 2026 16:49
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