Skip to content

An integral already being worked out is a cycle, and is declined at once - #1234

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
integrator-cycle-guard
Sep 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
integrator-cycle-guard

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Follows #1233, same issue #1232.

#1233 bounded the descent, which stopped the integrator killing the process. That was necessary and it was not sufficient. The descent branches, so 32 levels of a cycle is still an enormous search.

Measured on Rubi's independent test suites, problems 1400–1450:

build time for those fifty
v2.4.0 44 s
#1233's depth bound alone 985 s — one integrand held the run for over ten minutes
declining at the first repeat 37 s

The renaming is the whole point

The set is keyed on the integrand with its variable renamed to one canonical name. SolveBySubstitution names each new variable with Variable.CreateUnique, so a level and the level it came from are alpha-equivalent rather than equal. A set keyed on the integrand as written would never see the same entry twice — which is exactly why the memo added in #1157 could not stop this, and why the first fix had to be a depth bound rather than a visited set.

DeepestDescent stays, as a backstop for anything this does not model rather than as the mechanism.

Checked

Full suite green: 8499 and 1485. The Calculus chunk, which holds the integration tests, is 1 m 07 s against 1 m 13 s before this change, so the per-call rename is not costing anything measurable where it is most exercised.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

#1233 bounded the integrator's descent, which stopped it killing the process.
That was necessary and it was not sufficient: the descent branches, so 32 levels
of a cycle is still an enormous search. Measured on Rubi's independent test
suites, problems 1400-1450 took 985 seconds under the bound alone where v2.4.0
took 44. One integrand held the run for over ten minutes.

Declining at the first repeat instead: 37 seconds over the same fifty problems,
which is v2.4.0's figure and slightly under it.

The set is keyed on the integrand with its variable renamed to one canonical
name, and that renaming is the whole point. SolveBySubstitution names each new
variable with Variable.CreateUnique, so a level and the level it came from are
alpha-equivalent rather than equal. A set keyed on the integrand as written
would never see the same entry twice -- which is exactly why the memo added in
#1157 could not stop this either, and why the first fix had to be a depth bound
rather than a visited set.

DeepestDescent stays as a backstop for anything this does not model, rather than
as the mechanism.

#1232

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit ab7a8bd into master Sep 9, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the integrator-cycle-guard branch September 9, 2026 15:28
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