You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ecb43fa
Browse filesBrowse the repository at this point in the historyBrowse files
Extraction is a fixed point from the leaves up, and a budget is honoured to the millisecond (#1202)
#1199 recorded Saturation overshooting a two-second wall by up to thirty-five times.
Instrumenting the loop on the worst input put 99% of the time in e-match attempts, one
of which ran 1.9 s on a thirteen-member class; timing the steps of that one attempt's
first binding put the whole 1.9 s in a single graph.Extract of one bound class -- on a
graph of 253 e-nodes. The walk was top-down with a visiting-set cycle guard and a memo
that fills only on completion, and a graph full of union-made cycles defeats that: any
class on the stack blocks memoisation of everything beneath it, so sibling paths walk
the same subgraph again and again. That, not the ledger, was the overshoot.
Extraction is now a fixed point from the leaves up: a round recomputes every class from
its children's current best, in class order and member order so ties fall the same way
they did, and the rounds stop when one changes nothing. No recursion, so no depth guard
and no stack to exhaust -- a chain three hundred deep extracts as itself where it used
to come back null. The result is kept for as long as the graph does not change and the
cost is the same delegate, and only a union can change what an existing class extracts
as, so Union is where it is dropped. And the e-matcher charges the ledger once per
binding it tries after the first, so an attempt over a class with a thousand members
is a thousand steps and not one.
Measured on the inputs of #1199, same budget of 20,000 steps and 2 s: total 2000 ms
and 2000 ms where it was 2435 and 2595, the longest single attempt 4 ms where it was
1918, the longest extraction 3 ms. The Transformations tests hold every pin they held,
the corpus figures included.
One of my own claims does not survive this and is corrected where it was made. With
the walk no longer the cost, the inputs #1200 called a stall are two things: x ^ 2 / x,
x / x * -x and x / x * x * 1/2 are genuine runaways, ten to twelve thousand e-nodes in
thirty seconds, and 2 * x * 1/2 and its relatives plateau at some 560 e-nodes and stop
only when 200,000 steps run out. "Bounded at 135-583 e-nodes after thirty seconds" was
the slow extraction, not the graph. ConstantFoldTest says so now, and its pin is
renamed to what it pins: bounded by the budget, and extracting right.
Part of #746. Fixes#1199.
Full suite 9610 passed, 0 failed.
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
0 commit comments