Skip to content

Answer the borderline rows inside the budget by four guards on slow declines - #2004

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
borderline-rows-answer-inside-the-budget-aw
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
borderline-rows-answer-inside-the-budget-aw

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

About forty of Rubi's problems were answered only in 12–25 s, against the corpus harness's 5 s budget. They flip between solved and timed out with machine load, and they will time out for good once the budget binds (#1995). Four guards and reorderings get the answering route reached sooner, with no answer changed:

  • The pair rule before the first sum split. SolvePairOfHyperbolicPowersTwoApart is asked for sums just before the SolveBySplittingSum that follows the linear-factor reduction. That split had spent 9–12 s declining each elliptic term before the pair rule answered at its later position; the rule's own remark says "before the split". It returns null unless the exponents are fractional, and then no term of the split is elementary alone.
  • Exact pre-checks in five readers, read before the expensive numerator:
    • a whole power ≥ 2 of something in x below the bar, for SolveAPowerOfALinearBesideTheDerivativeOfAQuadraticOverItsPower, SolveAPowerOfALinearOverAPowerOfAQuadratic and SolveARationalFunctionOverAPowerOfASymbolicQuadratic;
    • the root below the bar, for SolveXOverACubicBinomialBesideTheRootOfAnother;
    • an arctangent, for SolveAnArctangentOverAPowerOfOnePlusICXUnderTheTangent.
      For 7.2.4:599, each had been expanding a numerator of thousands of terms.
  • SolveByCombiningRadicals and an inverse hyperbolic function's logarithm. It counts the root inside such a logarithm as no root. It had rewritten ln(1/u + sqrt(1 + 1/u^2)) into a spelling nothing reads, then spent 18 s declining, before the inverse-hyperbolic substitution answered in 0.1 s (7.6.2:23).
  • The substitution search's repeat test covers more candidates. It now covers any function of one trigonometric function of a linear, a quadratic mirrored across its vertex, and even powers of a quotient of linears. Its two values are compared in doubles, and nothing is refused where a double cannot hold them. It is skipped past a power of x of 64: an exact subtraction of two 1,900-digit rationals had hung x^24 (a x + b x^38)^12.

Measured on 8270086f, branch against master:

Run Problems Master Branch
Pocket: the 2–12 s band, the borderline rows and 370 fast rows 710 691 solved 694 solved
Family 1, 40 a file 1,381 1,368 1,368
Family 0, whole 1,814 1,789 1,789
Families 2 to 8, sampled 2,410 2,380 2,381

On the pocket's problems answered on both builds, allocation falls from 1,361 GB to 1,071 GB. All eleven moves re-run alone are answered on the branch, against nine on master:

Row Master alone Branch alone
7.6.2:23 24.7 s, 41 GB 29 ms
3.2.1:292 23.4 s, 34 GB 6.2 s, 7 GB
4.7.7:117 22.3 s 4.6 s
1.2.3.4:111 22.1 s 4.9 s
7.2.4:599 timed out 3.9 s
1.2.1.4:1120 timed out 9.0 s

None allocates more. The four the pocket showed lost are 22–25 s rows that flipped under load; each is answered alone on both builds.

Answers are identical across 710 rows. A sweep of 5,018 rows of 1.1.1.x, 1.1.3.x and 1.1.4.x found no answer changes, allocation 12.7% lower, and nothing slower; it was made after the 1.1.4.2:487 fix. No run had a wrong answer.

Rebased over #2002, which adds a vertex test for quadratic candidates at the same call site; this branch's repeat test runs first. On the combined build both PRs' rows answer at their measured cost, and their 781 tests pass. SlowDeclinesAheadOfTheAnsweringRuleIntegralTest differentiates nine rows back, with no duration asserts. No answer changes, so BREAKING-CHANGES.md has no entry.

Part of #233.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…eclines

- The pair rule SolveAPairOfHyperbolicPowersTwoApart is asked for sums just
  before the first sum split, which spent 9-12 s declining each elliptic
  term before the pair rule answered at its later position.
- Exact pre-checks read before the expensive numerator in five readers: a
  whole power >= 2 of something in x below the bar, a root below the bar,
  an arctangent present.
- SolveByCombiningRadicals counts the root inside the logarithm of an
  inverse hyperbolic function as no root, where it had rewritten
  ln(1/u + sqrt(1 + 1/u^2)) into a spelling nothing reads.
- The substitution search's repeat test covers any function of one
  trigonometric function of a linear, a quadratic mirrored across its
  vertex, and even powers of a quotient of linears; its two values are
  compared in doubles, and nothing is refused where a double cannot hold
  them, and it is skipped past a power of x of 64 -- an exact subtraction of
  two 1,900-digit rationals had hung 1.1.4.2:487.

Rubi's 7.6.2:23 goes from 34.8 s and 39.5 GB to 0.6 s, 6.6.1:24-26 and
6.1.1:123-125 from about 23 s to 0.1 s, and 7.2.4:599, 3.2.1:292,
4.7.7:117, 1.2.1.4:1120, 1.2.3.4:111 and 4.1.2.1:659 to 5-11 s. Every answer
is unchanged, character for character, across 710 rows; over 300 rows of
the 2-12 s band CPU falls 18.6% and allocation 19.0%.

Part of #233.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 21, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit a567c8b into master Oct 21, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant