Skip to content

Check for cancellation before each exact evaluation of the perfect-square collapse - #1995

Draft
Rafael-SOWNet wants to merge 1 commit into
masterfrom
a-search-past-its-budget-stops
Draft

Rafael-SOWNet wants to merge 1 commit into
masterfrom
a-search-past-its-budget-stops

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

The perfect-square collapse's numeric checks evaluate exactly at sample points. Over coefficients like b^335, one point is seconds of rational arithmetic. Rubi's 1.1.2.4:565 spent three and a half minutes in one Simplify of a substitution, nearly all of it there. It then ran on for a minute after its budget had cancelled it, because no evaluation asked. Each evaluation in DiffersNumerically, AgreesNumerically and the sample check now checks for cancellation first, as the other steps that can run long do.

This makes a budget bind where it did not, and it moves the corpus count. Measured on 8a1ef454:

Run Problems Master Branch
Pocket 884 873 solved 873 solved
Family 1, 40 a file 1,381 1,362 1,362
Family 0, whole 1,814 1,789 1,789
Families 2 to 8, sampled 2,410 2,362 2,362

Re-run alone, 3.2.1:292 and 3.5:37 move from answered to timed out. Master answers them in 23–24 s under the harness's 5 s budget, but only because nothing on their path checked for cancellation. With this change they stop at the budget. The other rows the corpus counts at 17–25 s under 5 s are likely to move the same way. Agent AW's branch, queued for measurement, makes most of them fast.

Draft until that branch lands, so that the measured coverage does not drop and then rise again. No answer changes: a cancelled integration leaves the integral unevaluated, as it should.

IntegrationCancelTest checks the mechanism with no clock in it: a cancelled perfect-square test stops before it evaluates. The 188 multithreading and expansion tests pass.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…uare collapse

The collapse's numeric checks evaluate exactly at sample points, and over
coefficients like b^335 one point is seconds of rational arithmetic. Rubi's
1.1.2.4:565 spent three and a half minutes in one Simplify of a
substitution, nearly all of it there, and ran on for a minute after its
budget had cancelled it, since no evaluation asked. Each evaluation now
checks for cancellation first, as the other steps that can run long do.

A budget now binds where it did not: 3.2.1:292 and 3.5:37, answered in
23-24 s under a 5 s budget because nothing on their path asked, time out at
the budget instead.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant