Skip to content

Fix SCCNonlinearProblem not having u0 field (issue #758) - #759

Merged
ChrisRackauckas merged 7 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-scc-u0-field-758
Dec 22, 2025
Merged

ChrisRackauckas merged 7 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-scc-u0-field-758

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

  • Fix SCCNonlinearProblem solve failing when u0 is not explicitly provided
  • SCCNonlinearProblem does not have a u0 field - each subproblem has its own u0
  • The solve function was incorrectly trying to access prob.u0, causing a FieldError

Changes

  • Remove the u0 = u0 !== nothing ? u0 : prob.u0 fallback since SCCNonlinearProblem has no u0 field
  • The u0 parameter is only used for AD hooks, not for actual solving
  • Add regression test to prevent this from happening again

Test plan

Closes #758

🤖 Generated with Claude Code

ChrisRackauckas and others added 4 commits December 20, 2025 16:10
SCCNonlinearProblem does not have a u0 field - each subproblem has its own u0.
The solve function was incorrectly trying to access prob.u0 when u0 was not
provided, causing a FieldError.

Changes:
- Remove the u0 = prob.u0 fallback since SCCNonlinearProblem has no u0 field
- Add regression test to prevent this from happening again

Closes SciML#758

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The test item needs to explicitly use SciMLBase to access NonlinearProblem
and other types from the module.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Use `import SCCNonlinearSolve: ...` instead of `using SCCNonlinearSolve` to
avoid implicit import of the module name, which causes ExplicitImports tests
to fail on macOS CI.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Additional Fix: ExplicitImports error on macOS CI

The macOS CI was failing due to an ExplicitImports check error:

Module `SCCNonlinearSolveChainRulesCoreExt` is relying on the following implicit imports:
* `SCCNonlinearSolve` which is exported by `SCCNonlinearSolve`

This was a pre-existing issue in the ChainRulesCore extension that became visible during CI. Fixed by changing:

using SCCNonlinearSolve
using SCCNonlinearSolve: SCCAlg, scc_solve_up

to:

import SCCNonlinearSolve: SCCAlg, scc_solve_up

This avoids the implicit import of the module name itself and satisfies the ExplicitImports check.

All tests now pass locally (26/26).

Apply SciML formatting style (spaces around operators and assignments)
to the test file to pass CI code-style checks.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Fix: Code formatting

Fixed code formatting in test file to pass CI code-style checks:

  • Added spaces around = operators in assignments
  • Added spaces around arithmetic operators (+, -, *)

All 26 SCCNonlinearSolve tests pass locally.

ChrisRackauckas and others added 2 commits December 21, 2025 13:41
Align continuation indent for multi-line import statement.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Restore spaces around ≈ operator that were accidentally removed.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI Status Summary

Core tests passing:

  • ✅ test (1, macos-latest)
  • ✅ test (1, ubuntu-latest)
  • ✅ test (1.11, macos-latest)
  • ✅ test (lts, macos-latest)
  • ✅ test (lts, ubuntu-latest)
  • ✅ ModelingToolkit.jl tests (Initialization, InterfaceI, InterfaceII)
  • ✅ OrdinaryDiffEq.jl tests (Interface, Regression)

Pre-existing CI issues (also failed on merged PR #757):

  • Spell Check: Pre-existing typos in NonlinearSolveBaseReverseDiffExt.jl and NonlinearSolveBaseEnzymeExt.jl
  • code-style: Pre-existing formatting issues
  • downgrade / test: CI infrastructure issue (403 errors in workflow telemetry)

All code changes have been tested locally and pass. The PR is ready for review.

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.

SCCNonlinearProblem has no field u0 in SCCNonlinearSolve 1.7

2 participants