You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simplify recurses once per nested sum, about 900 deep on one integral, and Release needs more than 384 KB for it #2166
Simplify on one row of RationalIntegralsTest recurses roughly 900 levels deep, one Sumf at a time. A Release build needs more than 384 KB of stack for it, and macOS gives a secondary thread 512 KB.
The row: take (q + p * x) / (c + b * x + a * x ^ 2) ^ 3, integrate it in x, substitute C = 0, a = 1, b = 0.7, c = 1.9, p = 1.3, q = -0.4, then call Simplify. Run on a thread of a fixed stack size (new Thread(fn, size)), on master 583338efe:
build
1.5 MB
1 MB
512 KB
384 KB
Debug
pass
overflow, 654 repeats
overflow, 320 repeats
Release
pass
pass
overflow, 909 repeats
The repeated block is LazyPropertyA.CreateValue, then Sumf.InnerSimplify, InnerSimplifyWithCheck, Evaled, ExpandOnTwoArguments, and back into Sumf.InnerSimplify for the next nested sum. It is entered from the CommonDenominator rule's SumOfFractions, through Expand, ExpandOverSum and CollectLikeTerms.
This is what crashed C# Test's Windows leg on most runs since 2026-09-15, in a Debug build on a 1 MB stack (#2165). That PR moves the leg to Release, which passes. But in Release the macOS leg has under a quarter of headroom on this row, and the depth grows with the size of the sum, so a slightly larger expansion overflows there too.
The frames are already small: 384 KB over 909 repeats is about 430 bytes per five-frame cycle. That means a smaller frame, which fixed #1928, will not help much here. What would help is simplifying a sum over its flattened terms instead of recursing once per nested Sumf.
Activity
A long chain of sums is simplified from the bottom up, not by a recur…