Skip to content

Six more rule sets describe the rules they run - #1109

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
registry-repoint-common
Aug 30, 2026
Merged

Six more rule sets describe the rules they run#1109
Rafael-SOWNet merged 1 commit into
masterfrom
registry-repoint-common

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Collaborator

The second tranche of the repoint. #1108 took the thirteen sets with no described arm at all,
where the change could only add metadata. These six are the other free case: one arm to one rule,
so their existing descriptions carry across unchanged and the rules that had none gain one.

CollapseTrigonometricFunctions, InvertNegativeMultipliers, InvertNegativePowers,
PerfectSquare, PolynomialGcdCancellation, SetOperator. Nineteen rules.

The identities

Sixteen already carried theirs as a comment. Three did not, and those were read off the rules rather
than guessed from their names:

rule identity
a-quotient-of-polynomials-is-put-in-lowest-terms n / d = (n / g) / (d / g), for g the gcd of n and d
a-sum-or-difference-that-is-a-perfect-square a +- 2*sqrt(a)*sqrt(b) + b = (sqrt(a) +- sqrt(b))^2
an-intersection-distributes-over-a-union-on-its-left (B \/ C) /\ A = (B /\ A) \/ (C /\ A)

The third is the mirror of the rule above it, whose comment covers both — the two exist separately
because each builds its answer with the operands in the order it found them, which a single
commutative pattern would lose.

Where a comment carried commentary as well as the identity, only the identity is taken:
sin(a) / cos(a) = tan(a) without the sentence about how the pattern says "of the same argument",
which is a remark about the encoding rather than about the mathematics.

No count moves, and that is the check

The registry stays at 397 arms. That is what confirms these six really are one for one:
AddressableRulesTest.TheRegistryIsAddressableAsFarAsItSaysItIs asserts the total, and it did not
fire. So unlike #1108 there is no arm-count change here — only names, descriptions, tiers and
PatternSource move, and BREAKING-CHANGES.md's existing entry is widened rather than joined by a
new one.

Was Is
described rules in the registry 135 147
rules carrying a tier of their own 40 59
sets describing what they run 14 20

The 147 is measured, not computed: seven of these nineteen rules were already described from their
arms, so the arithmetic is not 135 + 19. I wrote 146 first and the measurement corrected it.

What is left

Of the eleven sets not repointed, three are the CanonicalOrder family, which still runs its
switch
— describing it is honest there, and they are not a target.

The other seven are where repointing still costs something today: Common would lose 33 descriptions
and Power 22. Porting those identities is the next change, and it is the last of the work — after
which every set that stopped running its switch also stops describing it, and #825's remaining
question is only whether the dead switch methods may be deleted at all. They are the oracle
MatchedRulesAgreeWithTheSwitchTest proves the data form against, so that stays a maintainer
decision rather than mine.

State

Full suite: 8974 passed, 14 skipped, 0 failed. No public API change.

Part of #746 tier 2 and #825.

The second tranche of the repoint. #1108 took the thirteen sets with no described arm at
all, where the change could only add metadata. These six are the other free case: **one arm
to one rule**, so their existing descriptions carry across unchanged and the rules that had
none gain one.

CollapseTrigonometricFunctions, InvertNegativeMultipliers, InvertNegativePowers,
PerfectSquare, PolynomialGcdCancellation, SetOperator. Nineteen rules; sixteen already
carried their identity as a comment and three did not, and those three were read off the
rules rather than guessed from their names:

- `a-quotient-of-polynomials-is-put-in-lowest-terms` divides both sides by the gcd;
- `a-sum-or-difference-that-is-a-perfect-square` is `a +- 2*sqrt(a)*sqrt(b) + b`;
- `an-intersection-distributes-over-a-union-on-its-left` is the mirror of the rule above it,
  whose comment covers both -- the two exist separately because each builds its answer with
  the operands in the order it found them.

Where a comment carried commentary as well as the identity, only the identity is taken:
`sin(a) / cos(a) = tan(a)` without the sentence about how the pattern says "of the same
argument", which is a remark about the encoding rather than the mathematics.

**No count moves.** The registry stays at 397 arms, which is the check that these six really
are one for one -- `AddressableRulesTest` did not fire, and it is the assertion that would
have. Described rules go from 135 to **147**, measured rather than computed: seven of these
nineteen were already described from their arms, so the arithmetic is not simply +19 and the
first version of this message had it one out.

Rules carrying a tier of their own go from 40 to 59. Nineteen of the thirty sets now describe
what they run. Of the eleven left, three are the CanonicalOrder family, which still *runs*
its `switch` -- describing it is honest there. The other seven are where repointing still
costs something: `Common` would lose 33 descriptions today and `Power` 22, and porting those
identities is the next change.

Full suite: 8974 passed, 14 skipped, 0 failed. No public API change.

Part of #746 tier 2 and #825.
@Rafael-SOWNet
Rafael-SOWNet merged commit 3b03e62 into master Aug 30, 2026
31 checks passed
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