Six more rule sets describe the rules they run - #1109
Merged
Conversation
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.
This was referenced Aug 30, 2026
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.
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:
a-quotient-of-polynomials-is-put-in-lowest-termsn / d = (n / g) / (d / g), forgthe gcd ofnandda-sum-or-difference-that-is-a-perfect-squarea +- 2*sqrt(a)*sqrt(b) + b = (sqrt(a) +- sqrt(b))^2an-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.TheRegistryIsAddressableAsFarAsItSaysItIsasserts the total, and it did notfire. So unlike #1108 there is no arm-count change here — only names, descriptions, tiers and
PatternSourcemove, andBREAKING-CHANGES.md's existing entry is widened rather than joined by anew one.
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
CanonicalOrderfamily, which still runs itsswitch— describing it is honest there, and they are not a target.The other seven are where repointing still costs something today:
Commonwould lose 33 descriptionsand
Power22. Porting those identities is the next change, and it is the last of the work — afterwhich every set that stopped running its
switchalso stops describing it, and #825's remainingquestion is only whether the dead
switchmethods may be deleted at all. They are the oracleMatchedRulesAgreeWithTheSwitchTestproves the data form against, so that stays a maintainerdecision rather than mine.
State
Full suite: 8974 passed, 14 skipped, 0 failed. No public API change.
Part of #746 tier 2 and #825.