Skip to content

Saturation overshoots its wall-clock budget by up to 35x on a slow pass #1199

Description

@Rafael-SOWNet

Saturation.Run takes a WorkBudget with a Time and can overshoot it by an order of magnitude.

Measured

Safe ceiling (RulesUpTo(Rearranges)), WorkBudget { Steps = 20_000, Time = 2 s }, one input per
graph, over the growth corpus of RuleGrowthAgreesWithTheCorpusTest (3,630 generated shapes):

input build wall
1/2 * 2 * (1/2) ^ 2 d9b8b374 (before #1198) 69.2 s against a 2 s budget
(2 - 0) * 1/2 * -1/2 d9b8b374 7.3 s
x / x * x * 1/2 98a9420c (after #1198) 4.4 s
2 ^ (-1) / sqrt(1/2) 98a9420c stopped by the step ceiling at 0.8 s, 1,072 e-nodes — the budget worked there

After #1198 folded constants on insertion the 60-second cases are gone, but the 2× overshoot on a
7-node input remains, so it is not the constant runaway that caused it.

What it probably is, unverified

BudgetLedger's remarks say the bound is cooperative and checked once per branch. In
Saturation.Run the check is per class and per rule inside a pass; one rule attempt on one class
extracts a witness term for every member and runs TryApply on each, and on a class with a few
hundred members that single attempt is where the seconds go. If so the fix is to consult the
ledger inside the witness loop (or to charge witness extraction as steps), not to tighten the
clock. This has not been instrumented; the numbers above are the whole of what is known.

Why it matters

A budget that can be overshot 35× is not a bound, and the graph is offered to callers behind
Transformation.CanonicalizationOverGraph(budget) on the strength of being bounded. Nothing
wrong is answered — extraction was correct on every case above — so this is filed as minor.

Found while measuring #746 tier 2 item 4 (PR #1198).

Activity

  1. Rafael-SOWNet commented on Sep 7, 2026

    @Rafael-SOWNet
    MemberAuthor

    The inputs this shows on are the stall family of #1200.

  2. added theissue type on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions