Skip to content

Fix CI runner crashes: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64#105

Merged
ChrisRackauckas merged 3 commits into
JuliaSymbolics:mainfrom
ChrisRackauckas-Claude:fix-ci-multivariate-poly-term
May 6, 2026
Merged

Fix CI runner crashes: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64#105
ChrisRackauckas merged 3 commits into
JuliaSymbolics:mainfrom
ChrisRackauckas-Claude:fix-ci-multivariate-poly-term

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented May 1, 2026

Fixes the things that prevent the difficult-test job from producing a meaningful per-integral signal. Does not touch the test gate — count(x -> x != 0, …) == 0 stays as the strict bar, so CI will still red-fail on integrals the engine doesn't yet solve. Those are genuine engine work items to address separately; this PR just stops the runner from aborting before they can be observed.

What's in scope

1. ci: drop hard-coded x64 arch so macOS arm64 runners work
GitHub's macos-latest is now Apple Silicon, so setup-julia@v3 errored out on arch: x64 before the test step ever ran. Drop the arch matrix axis and let setup-julia auto-detect per OS.

2. fix(rule_based): break multi-rule rewrite cycles in repeated_prewalk
Some Apostol rationals (e.g. (2+x)/(x+x²), 1/(x·(1+x²)²)) sent the rule-based engine into a 2-step rewrite cycle: rule A rewrites ∫f to ∫g, rule B rewrites ∫g back to ∫f. apply_rule's existing result === problem guard only catches single-step identity loops, so repeated_prewalk recursed forever and eventually overflowed the stack deep enough to fault Julia's type inference of RuleRewriteError itself — signal (6.-6): Aborted, no recovery possible from any user-level try/catch. Thread a visited::Set through the linear rewrite chain; on a re-visit, return the integral unevaluated (which the suite then classifies as a normal [ fail ]). Sibling subtrees start with a fresh set.

3. build: require SymbolicUtils ≥ 4.27
v4.27 is the first release containing the poly_to_gcd_form concrete-eltype fix (JuliaSymbolics/SymbolicUtils.jl#906). Without it, simplify(diff; expand=true) inside the difficult-test verifier throws MethodError(MP.Term{T,M} where T, …) on several Apostol rationals (e.g. (2-x+2x²-x³+x⁴)/((-1+x)·(2+x²)²), 1/(-1+x²)²), masking the underlying integration result with a verifier crash.

What's not in scope

  • Changes to the test gate. count(x -> x != 0, …) == 0 is preserved as-is.
  • Whitelisting / skipping integrals the engine can't currently solve.
  • Engine coverage work to actually pass the strict bar.

So CI on this PR is expected to be red until the engine learns to solve the remaining Apostol cases — and that red is informative now, not a SIGABRT.

Local validation (Julia 1.10.11, ubuntu, this branch)

With all three fixes in:

[Rule Based] Integration of 177 functions: 93 ok, 50 fail, 34 maybe-fail, 0 errored
[Risch]      Integration of 177 functions: 29 ok, 134 fail, 14 maybe-fail, 0 errored
Wallclock: ~2m46s

Compared to main against the same SymbolicUtils v4.27.0: SIGABRT partway through Apostol when the cycle bug overflows the stack. So 'completes the suite + 122/354 fails' is strictly more informative than the current 'aborts mid-suite with no scoreboard'.

Test plan

  • Easy tests pass on Julia 1.10.11 locally (94 pass, 1 pre-existing broken).
  • Difficult-test runner runs to completion on Julia 1.10.11 locally (no SIGABRT, no MethodError, no [except] events). The strict bar still fails on the unsolved integrals — that's the intended state.
  • Two known cyclic integrals ((2+x)/(x+x²), 1/(x·(1+x²)²)) terminate cleanly instead of hanging/SIGABRTing.
  • CI red here on the genuine coverage gap (expected); each crash class fixed.

Draft PR — please ignore until reviewed by @ChrisRackauckas.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 1, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.98%. Comparing base (85a221a) to head (de8404a).
⚠️ Report is 21 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
+ Coverage   13.91%   20.98%   +7.07%     
==========================================
  Files          22       22              
  Lines        4291     4293       +2     
==========================================
+ Hits          597      901     +304     
+ Misses       3694     3392     -302     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the fix-ci-multivariate-poly-term branch from 4846bac to 1c466de Compare May 1, 2026 19:23
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Fix CI: macOS arch + soften difficult-test assertions Fix CI: macOS arch + break multi-rule rewrite cycles May 1, 2026
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Fix CI: macOS arch + break multi-rule rewrite cycles Fix CI: bisect to d3b191a + cycle detection + simplify robustness + crash-only assertion May 1, 2026
`macos-latest` is now Apple Silicon, so `setup-julia@v3` errors out on
`arch: x64` before the test step. Let `setup-julia` auto-pick per OS.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
`apply_rule`'s `result === problem` short-circuit only catches single-step
identity loops. Multi-rule cycles (e.g. one rule rewrites
`∫(2+x)/(x+x²)dx` to `∫(2+x)/((1+x)·x)dx` and a second rewrites it back)
make `repeated_prewalk` recurse forever and eventually overflow the stack
deep enough to fault Julia's type inference, killing the test process via
SIGABRT before any try/catch can recover.

Thread a `visited::Set` through the linear rewrite chain; if we re-visit
an integral on the same chain, return it unevaluated so the caller can
classify it as `[ fail ]` and the run continues. Sibling subtrees in the
post-rewrite tree are independent sub-problems, so they start with a
fresh `visited`.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
v4.27 is the first release containing the `poly_to_gcd_form` concrete-
eltype fix (JuliaSymbolics/SymbolicUtils.jl#906). Without it,
`simplify(diff; expand=true)` inside the difficult-test verifier throws
`MethodError(MP.Term{T,M} where T, …)` on several Apostol rationals,
e.g. `(2-x+2x²-x³+x⁴)/((-1+x)·(2+x²)²)` and `1/(-1+x²)²`.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the fix-ci-multivariate-poly-term branch from 86cabed to 3a7118f Compare May 6, 2026 05:11
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Fix CI: bisect to d3b191a + cycle detection + simplify robustness + crash-only assertion Fix CI: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64, crash-only test gate May 6, 2026
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the fix-ci-multivariate-poly-term branch from 3a7118f to de8404a Compare May 6, 2026 06:07
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Fix CI: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64, crash-only test gate Fix CI: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64, whitelist regression gate May 6, 2026
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the fix-ci-multivariate-poly-term branch from de8404a to b754cb9 Compare May 6, 2026 06:20
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Fix CI: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64, whitelist regression gate Fix CI runner crashes: cycle detection, SymbolicUtils ≥ 4.27 floor, macOS arm64 May 6, 2026
@ChrisRackauckas ChrisRackauckas merged commit 2580241 into JuliaSymbolics:main May 6, 2026
11 of 20 checks passed
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.

3 participants