Skip to content

Bump SCCNonlinearSolve compat floor to 1.13 to fix downgrade precompile#4657

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-downgrade-scc-floor
Jun 23, 2026
Merged

Bump SCCNonlinearSolve compat floor to 1.13 to fix downgrade precompile#4657
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-downgrade-scc-floor

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Please ignore until reviewed by @ChrisRackauckas.

Problem

The master downgrade CI lanes — Downgrade / Downgrade Tests - InterfaceI and downgrade-sublibraries / test (lib/ModelingToolkitBase) — resolve SCCNonlinearSolve v1.12.1. That version of iteratively_build_sols preallocates a Vector{NonlinearSolution} and stores a LinearSolution (returned for a linear SCC) directly into it, throwing during the SCCNonlinearProblem precompile workload (src/precompile.jl):

MethodError: Cannot `convert` an object of type
  SciMLBase.LinearSolution{Float64, 1, Vector{Float64}, Vector{Float64}, Nothing, Nothing, Nothing}
to an object of type
  SciMLBase.NonlinearSolution{...}
  [1] setindex!(A::Vector{NonlinearSolution...}, x::LinearSolution..., i1::Int64)
  [2] iteratively_build_sols(alg::SCCNonlinearSolve.SCCAlg{SimpleNewtonRaphson...}, probs::Vector{Any}, ...)
    @ SCCNonlinearSolve .../SCCNonlinearSolve.jl:119

This fails precompilation of ModelingToolkit and its OrdinaryDiffEq extensions on the LTS downgrade run (24 such errors in the InterfaceI lane).

Root cause

The fix for this lives in SCCNonlinearSolve 1.13.0 (commit c5c8120, "fix vector-form SCCNonlinearProblem with linear SCCs"), which routes a linear SCC through a solve_single_scc helper that converts the LinearSolution into a stripped, well-typed NonlinearSolution before storing it. The registered 1.12.1 tree does not contain this helper. The current compat floor SCCNonlinearSolve = "1.8.1" lets the downgrade resolver pick the broken 1.12.1.

Fix

Raise the floor to SCCNonlinearSolve = "1.13" in both Project.toml and lib/ModelingToolkitBase/Project.toml. SCC 1.13s SciMLBase compat (2.153.0 - 3) remains compatible with ModelingToolkitBases SciMLBase = "3.18" floor.

Local verification (Julia 1.10)

Reproduced both directions by pinning the downgrade-resolved versions (SciMLBase 3.18, SimpleNonlinearSolve 2.11.1) and precompiling ModelingToolkit:

  • Before (SCC 1.12.1, old floor): PRECOMPILE_FAILED, 2× Cannot convert ... LinearSolution ... NonlinearSolution (same iteratively_build_sols stack as CI).
  • After (SCC 1.13.0, new floor): FIX_PRECOMPILE_OK, 0 convert errors, resolves SCCNonlinearSolve v1.13.0.

Scope note

This addresses the SCC 1.12.1 precompile failure that anchors the InterfaceI downgrade lane. The downgrade-sublibraries / ModelingToolkitBase lane also resolves SCC 1.12.1 (first failing package is SCCNonlinearSolveChainRulesCoreExt) but surfaces a separate Module IR does not contain specified entry function cascade that I could not reproduce locally without the full Resolver --min=@alldeps env; this floor bump applies there too and may help, but that lane should be re-checked in CI. The build (Documentation) and Optimization test-group reds are a different root cause — an Optim 2 (NLSolversBase 8) vs NLsolve (NLSolversBase ≤ 7.10, pulled by DiffEqDevTools) resolver deadlock — not addressed here.

🤖 Generated with Claude Code

The downgrade CI lanes ("Downgrade / InterfaceI" and
"downgrade-sublibraries / ModelingToolkitBase") resolved
SCCNonlinearSolve v1.12.1, whose `iteratively_build_sols`
preallocated a `Vector{NonlinearSolution}` and stored a
`LinearSolution` from a linear SCC directly into it, throwing

    MethodError: Cannot `convert` an object of type
    SciMLBase.LinearSolution to SciMLBase.NonlinearSolution

during the `SCCNonlinearProblem` precompile workload
(src/precompile.jl), failing precompilation of ModelingToolkit and
its extensions.

The fix landed in SCCNonlinearSolve 1.13.0 (commit c5c8120 "fix vector-form
SCCNonlinearProblem with linear SCCs"), which converts a linear SCC's
`LinearSolution` into a stripped `NonlinearSolution` before storing it.
Raising the floor from 1.8.1 to 1.13 prevents the downgrade resolver from
selecting a pre-fix version. SCC 1.13's SciMLBase compat (2.153-3) remains
compatible with ModelingToolkitBase's SciMLBase 3.18 floor.

Verified locally on Julia 1.10: with the old floor (SCC 1.12.1 pinned)
ModelingToolkit precompile fails with the convert MethodError; with the
new floor (SCC 1.13.0) precompile succeeds cleanly.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 23, 2026 13:01
@ChrisRackauckas ChrisRackauckas merged commit 7d349b6 into SciML:master Jun 23, 2026
69 of 91 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