Skip to content

Move Enzyme tests to NoPre test group to fix prerelease CI failures #672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ChrisRackauckas-Claude
Copy link

Summary

  • Creates a new nopre test group for tests that use Enzyme
  • Excludes nopre tests from running on Julia prerelease versions in CI
  • Fixes CI failures on Julia prerelease versions

Problem

The CI is currently failing on Julia prerelease versions due to Enzyme compatibility issues, as seen in https://github.com/SciML/NonlinearSolve.jl/actions/runs/16851672503/job/47738829623

While all existing Enzyme tests in subpackages already have VERSION.prerelease checks to skip on prerelease Julia, having a dedicated test group provides better CI-level control.

Solution

  1. Created a new test group nopre that can contain tests that should not run on Julia prerelease
  2. Added the nopre group to the CI matrix for NonlinearSolve and SimpleNonlinearSolve
  3. Added an exclusion rule in CI to prevent nopre tests from running when version: "pre"
  4. Created test/enzyme_tests.jl with example Enzyme tests that demonstrate the pattern

Test plan

  • Verified all existing Enzyme tests have VERSION.prerelease checks
  • Added nopre test group to CI configuration
  • Created example Enzyme tests in the nopre group
  • CI should pass on prerelease Julia after this change

🤖 Generated with Claude Code

This change addresses CI failures on Julia prerelease versions by:
- Creating a new 'nopre' test group for tests that use Enzyme
- Adding the nopre group to CI configuration for NonlinearSolve and SimpleNonlinearSolve
- Excluding nopre tests from running on Julia 'pre' version in CI
- Creating enzyme_tests.jl with example Enzyme tests that skip on prerelease

All existing Enzyme tests in subpackages already have VERSION.prerelease
checks, but this change provides an additional CI-level control to prevent
these tests from running on prerelease Julia versions.

Fixes test failures seen in https://github.com/SciML/NonlinearSolve.jl/actions/runs/16851672503/job/47738829623

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
ChrisRackauckas and others added 3 commits August 10, 2025 06:48
Instead of creating new tests, this moves existing tests that could
potentially use Enzyme through default autodiff settings to the nopre group:

- Basic PolyAlgorithms: Uses RobustMultiNewton() and FastShortcutNonlinearPolyalg()
- PolyAlgorithms Autodiff: Tests autodiff with polyalgorithms
- 23 Test Problems: PolyAlgorithms: Tests with default polyalgorithms
- ForwardDiff.jl Integration: Tests with FastShortcutNonlinearPolyalg() and nothing
- Ensemble Nonlinear Problems: Uses nothing as algorithm
- Out-of-place Matrix Resizing: Uses polyalgorithms without explicit autodiff
- Inplace Matrix Resizing: Uses polyalgorithms without explicit autodiff
- Default Algorithm Singular Handling: Uses default solver

These tests may trigger Enzyme usage through default autodiff backends,
so moving them to nopre group ensures they don't run on Julia prerelease.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ChrisRackauckas
Copy link
Member

Update: Moved existing tests to nopre group

As requested, I've removed the new test file and instead moved existing tests that could potentially use Enzyme through default autodiff settings to the nopre group:

Tests moved from :core to :nopre:

  1. Basic PolyAlgorithms - Uses RobustMultiNewton() and FastShortcutNonlinearPolyalg() without explicit autodiff
  2. PolyAlgorithms Autodiff - Tests autodiff functionality with polyalgorithms
  3. 23 Test Problems: PolyAlgorithms - Tests with default polyalgorithms
  4. ForwardDiff.jl Integration - Includes FastShortcutNonlinearPolyalg() and nothing as algorithms
  5. Ensemble Nonlinear Problems - Uses nothing as the algorithm
  6. Out-of-place Matrix Resizing - Uses polyalgorithms without explicit autodiff
  7. Inplace Matrix Resizing - Uses polyalgorithms without explicit autodiff
  8. Default Algorithm Singular Handling - Uses the default solver

Verification of Enzyme imports

✅ All using Enzyme statements in test files are already properly guarded with if isempty(VERSION.prerelease) checks:

  • lib/SimpleNonlinearSolve/test/core/rootfind_tests.jl
  • lib/NonlinearSolveFirstOrder/test/rootfind_tests.jl (4 instances)
  • lib/NonlinearSolveQuasiNewton/test/core_tests.jl (3 instances)
  • lib/SciMLJacobianOperators/test/core_tests.jl (3 instances)
  • lib/NonlinearSolveHomotopyContinuation/test/allroots.jl

These changes ensure that tests which might trigger Enzyme usage through default autodiff backends won't run on Julia prerelease versions, preventing CI failures.

- Remove Enzyme from regular test dependencies in Project.toml
- Add Enzyme as an EXTRA_PKG that's loaded conditionally in runtests.jl
- Only load Enzyme for the nopre group when not on prerelease Julia
- This ensures Enzyme is only loaded when needed and won't cause issues on prerelease

This complements the previous change of moving tests to the nopre group,
ensuring Enzyme is truly optional and only loaded when appropriate.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit 7eb78ff into SciML:master Aug 10, 2025
40 of 49 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.

2 participants