Repository navigation
Commit e45413c
A graph transformation stops when its answer has, not only when the graph has (#1206)
#1200's inputs -- a rational coefficient beside a variable, x / x * -x, x ^ 2 / x -- run
away at the safe ceiling: the quotient-regrouping rules recombine members across
classes, so every pass adds fresh e-nodes to the root's class for as long as the budget
allows. Traced on x ^ 2 / x, the root extracts x from the third pass on and never stops
gaining members. A caller who extracts an answer was paying the whole budget, two
seconds, for an answer it had in milliseconds.
Saturation.Run takes a caller's own stop, asked after every pass that merged something,
and the two transformations that extract -- EqualitySaturation, the cheapest member,
and CanonicalizationOverGraph, the least -- pass "the extraction has not changed for two
passes". Two rather than one, because a pass can leave the chosen member alone while
adding what the next pass improves on. ProvesEqual passes nothing: it needs a union,
not an extraction, and keeps saturating.
Measured on the corpus gate's forty problems, the nine inputs of #1200 and the five
pinned ordinary ones, through both public transformations: every answer identical, and
the run of all of them 13,495 ms to 320 ms -- x / x * -x 1,869 to 10 ms, x ^ 2 / x 2,010
to 3 ms, 2 ^ (-1) / sqrt(1/2) 998 to 2 ms. The remark on CanonicalizationOverGraph says
what its canonical form is now modulo: these rules, this budget, and the answer having
settled.
What this does not do is make the rules confluent on that family; the bare graph still
runs away and ConstantFoldTest still says so. #1200 stays open as the question about
the rules, with its practical cost gone.
Part of #746.
Full suite 9610 passed, 0 failed.
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>1 parent ed38186 commit e45413c
2 files changed
Lines changed: 57 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
112 | 122 | | |
113 | | - | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| |||
220 | 230 | | |
221 | 231 | | |
222 | 232 | | |
| 233 | + | |
223 | 234 | | |
224 | 235 | | |
225 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
477 | 484 | | |
478 | 485 | | |
479 | 486 | | |
| |||
673 | 680 | | |
674 | 681 | | |
675 | 682 | | |
676 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
677 | 698 | | |
678 | 699 | | |
679 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
680 | 708 | | |
681 | 709 | | |
682 | 710 | | |
| |||
711 | 739 | | |
712 | 740 | | |
713 | 741 | | |
714 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
715 | 754 | | |
716 | 755 | | |
717 | 756 | | |
| |||
0 commit comments