Skip to content

A candidate already registered is not registered again: SimplifyHard -64% allocation - #1207

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
speed-registration
Sep 7, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
speed-registration

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

The second registration lever, found by the same temporary hook as #1205, split by stage this time.

What the split showed

At level 4 on SimplifyHard: 363 registrations, 298 of them repeats — a pass that changes
nothing registers the same tree again. Each registration is a CanonicalOrder rewrite (the Sort
rules, ~2.4 MB a time on this input) and an inner simplification before the history set declines
the repeat: 874 MB of sorting and 718 MB of simplifying to add nothing. The ratings were already
cheap (294 KB in all) after #1205's cost cache.

What changes

Alternate keeps a set of what it has registered and AddHistory returns at once for a tree
already in it. Same tree, same registration — the rewrite and the rating are deterministic — so
the set of candidates is unchanged, and the answer with it.

Measured

Same machine as this morning's 1930th column and this afternoon's 1931st (#1205):

1931st (#1205) this change allocation time
SimplifyHard 2,027,771,744 733,188,536 −63.8% 924 → 371 ms
SolveHard 1,057,996,016 859,268,416 −18.8% 772 → 700 ms
SolveMediumHard 126,162,152 94,415,256 −25.2% 78 → 67 ms
SimplifyEasy 115,763 116,291 +0.5% 89 → 71 µs

Since this morning's 1930th column: SimplifyHard −80%, SolveHard −41%, SolveMediumHard −43%.
SimplifyEasy's 528 bytes more are the set itself, which on a fifteen-node input has nothing to
save; every other row is unchanged. Timings carry the performance file's usual rider.

The gate's baseline is updated in the same change, for the reason its document gives for a drop.
Every pinned Simplify answer and the corpus gate hold.

Part of #746.

Checks

Full suite 9610 passed, 0 failed, 14 skipped. Two tests re-pinned rather than loosened: ThePathIsASmallPartOfWhatHappened and TheDerivationIsFarShorterThanTheRawRecording asserted the raw recording is 20× the path and over 100 steps — ratios calibrated to the re-sorting this removes; it is 63 against 4 now (15×), and the claim they make is the same.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…-64% allocation

After #1205 a SimplifyHard level was still 431 MB of candidate registration, and the
same temporary hook, split by stage, said why: at level 4 there were 363 registrations
of which 298 were repeats. A pass that changes nothing registers the same tree again,
and each registration is a CanonicalOrder rewrite -- the Sort rules, 2.4 MB a time on
this input -- and an inner simplification before the history set declines the repeat.
874 MB of sorting and 718 MB of simplifying to add nothing.

Alternate keeps a set of what it has registered and AddHistory returns at once for a
tree already in it. The same tree registers the same way -- the rewrite and the rating
are deterministic -- so the set of candidates is what it was, and the answer with it.

Measured by the inter-version benchmark on the same machine as this morning's 1930th
column and this afternoon's 1931st, against the 1931st:

  SimplifyHard      2,027,771,744 ->   733,188,536 bytes   -63.8%   924 ms -> 371 ms
  SolveHard         1,057,996,016 ->   859,268,416 bytes   -18.8%   772 ms -> 700 ms
  SolveMediumHard     126,162,152 ->    94,415,256 bytes   -25.2%    78 ms ->  67 ms
  SimplifyEasy            115,763 ->       116,291 bytes    +0.5%    89 us ->  71 us

Since this morning's 1930th column, SimplifyHard is -80%, SolveHard -41% and
SolveMediumHard -43%. SimplifyEasy's 528 bytes more are the set itself, which on a
fifteen-node input has nothing to save. Every other row is unchanged.

The suite holds every pinned Simplify answer and the corpus gate. The gate's baseline
is updated in the same change, for the reason its document gives for a drop.

Part of #746.

Full suite 9610 passed, 0 failed. Two tests re-pinned: they asserted the raw recording is
twenty times the derivation path and over a hundred steps, ratios calibrated to the re-sorting
this removes; it is 63 against 4 now and they say so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 10ca691 into master Sep 7, 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