Repository navigation
A set Settings.Budget caps lids and arguments, and replaces allowances - #2475
Merged
Merged
Conversation
Each BudgetLedger.For call site now declares a BudgetRole, and a set
MathS.Settings.Budget does to it what that role calls for:
- Allowance (SolveSystem's 10,000 steps / 60 s, Gröbner's 5 s): replaced,
as before, so "raise MathS.Settings.Budget to allow more" stays true.
- Lid (the perfect-square proof's 2,000 steps / 50 ms): the smaller limit
on each axis, so a set budget, Unlimited included, never lifts it.
- Argument (EqualitySaturation, CanonicalizationOverGraph, AreEqual):
the argument is the allowance and the set budget caps it, so an
explicit budget inside an Unlimited scope is spent as passed.
The lid is tightened on both axes rather than the clock alone: a lid is
never raised, so the incomparability of steps between algorithms does
not bite, and a caller who set steps is not ignored. The proof completes
in 15 to 1,203 steps over the unit suite (median 212) and a stopped
proof falls back to the symbolic test; Factorize and Simplify answers
were measured unchanged under unset, Unlimited, {Steps = 1} and
{Steps = 1_000_000}.
What moves: EqualitySaturation and CanonicalizationOverGraph with an
explicit budget inside a scope set to Unlimited, measured against the
2.7.0 package; BREAKING-CHANGES.md has the rows. The four test-only
ledgers pass their own budget, so they are Argument.
Part of #2454
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2475 +/- ##
==========================================
- Coverage 86.97% 86.96% -0.01%
==========================================
Files 324 324
Lines 71849 71864 +15
Branches 20955 20957 +2
==========================================
+ Hits 62492 62498 +6
- Misses 5024 5031 +7
- Partials 4333 4335 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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 semantics decided on #2454: a set
MathS.Settings.Budgetacts by the role of each site that reads it.BudgetLedger.For(where, ownDefault, BudgetRole)now requires the role, and every site states it in a comment.EquationSolver.SolveSystemBuchberger)Saturation.ProvesEqual, the perfect-square proofEqualitySaturation,CanonicalizationOverGraph,MathS.AreEqualbudgetargumentUnlimitednever makesSimplifyorFactorizerun longer. The minimum is taken on both axes, not on time alone: steps not being comparable between algorithms matters only when one's ceiling would be raised by a number chosen for another, and a lid is never raised, while taking only the clock would ignore a caller who set the reproducible axis exactly where they asked for less. Over the whole unit suite the proof completes in 15 to 1,203 steps (median 212); one stopped early is "not proved" and falls back to the symbolic test, so a tight budget costs time, not answers.AreEqual(a, b, budget)inside a scope set toUnlimitedused to run unlimited.MathS.Settings.Budgetdoc describes the three, and says that{ Steps = 1_000_000 }also removes the solver's 60 s, since aWorkBudgetcannot say "no opinion" on one axis: that is v3 (Goal: Math OS — a ten-year vision for AngouriMath as an open mathematical reasoning platform #746, budgets as values).Answers move only under a user-set budget. Measured against the 2.7.0 package, with
{ Steps = 5, Time = 30 s }inside a scope set toUnlimited, and recorded inBREAKING-CHANGES.md:EqualitySaturation(budget).ApplyOrKeep("x * 2 * 3 + x")x * 7EqualitySaturation(budget).ApplyOrKeep("2 * sqrt(2) * sqrt(3)")2 * sqrt(6)CanonicalizationOverGraph(budget).ApplyOrKeep("a * b + b * a")2 * a * ba * b + a * bCanonicalizationOverGraph(budget).ApplyOrKeep("x + 0 + 2 * x")3 * x2 * x + xFactorizeandSimplifygive 2.7.0's answers under no budget,Unlimited,{ Steps = 1 }and{ Steps = 1_000_000 }on the perfect-square shapes checked.BudgetRoleTest: 11 tests; with the old replace-always rule restored, 5 of the first 9 fail. Full check before the rebase onto 73b77bf (clean): 20,130 unit tests, 0 failed; MCP 444, Terminal 69, F# 134, Interactive 19; AOT OK; BoundCheck 0 disagreements, RootCheck 596/596, CasBench 120/121 with 0 wrong, SimpSweep 10463/10463, RuleCheck clean, CanonCheck and Confluence at their baselines. After the rebase: budget, system, saturation, factorisation, equality and API tests, 1,253 passed.Closes #2454.
🤖 Generated with Claude Code