Repository navigation
Add SCCSteadyStateProblem, the SCC-split form of a steady-state problem - #1642
ChrisRackauckas wants to merge 2 commits into
Conversation
A steady state whose residual is block-lower-triangular is represented by the same blocks as SCCNonlinearProblem, but as an AbstractSteadyStateProblem, so pseudo-transient solvers can integrate each block and the solution is stored in the compressed SCC layout with symbolic indexing through prob.f.sys. The SII methods and remake are shared between the two SCC types; conversions in both directions reuse the block containers. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <[email protected]> Agent-Harness: Devin CLI 3000.11.3 Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium Agent-Session: local headless run, log /Users/chrisrackauckas/sandbox/master/green/scc-ssprob/log.txt
`remake(prob; p)` on an SCC problem with `parameters_alias` skipped (tuple blocks) or threw on (vector blocks) `LinearProblem` blocks with `u0 = nothing`, so those blocks kept their old parameters and `A`/`b`. Both helpers now share one per-block update that pushes `p` into guess-less blocks and splits a supplied `u0` by `size(A, 2)`. The SCC constructors inferred the state type from the first block only, so mixing guess-less linear blocks with blocks that have a state either hid the other blocks' states or concatenated `nothing` into the state vector. Such mixed inputs now throw an `ArgumentError`; all-stateful and all-guess-less inputs behave as before. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <[email protected]> Agent-Harness: Devin CLI 3000.11.3 Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium Agent-Session: local headless run, log /Users/chrisrackauckas/sandbox/master/green/fu/SciML_SciMLBase.jl-1642-1951/log.txt
PR: #1642 Reviewed head: 867dba9 Risk assessment
Review reportVERDICT: CHANGES Riskhigh (H1: the existing public This affects users constructing SCC problems directly, symbolic modeling front ends that construct them for initialization, and solver packages that call Blocking findings
Nonblocking findings
What I ran
What I did not verify
Head link: 867dba9 🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol |
This fixes a failure on the default branch's CI. The diagnosis and the evidence below come from the investigating agent's report; "confirmed by running" and "read in logs" are kept apart there.
Part of a three-PR stack implementing Chris's direction (2026-10-14) to replace the post-solve SCC reversal with an SCC form of SteadyStateProblem stored in the compressed layout: SciMLBase (new type) → ModelingToolkit (constructs it) → SteadyStateDiffEq (solves it). Supersedes SciML/SteadyStateDiffEq.jl#175 and #177; fixes SciML/SteadyStateDiffEq.jl#171. CI on the downstream PRs cannot pass until the upstream ones are released.
SciMLBase.jl
Branch
scc-steadystate(on master365283c6)ef607783Add SCCSteadyStateProblem, the SCC-split form of a steady-state problemProject.toml(3.58.0 → 3.59.0),src/SciMLBase.jl(export),src/problems/nonlinear_problems.jl(type, docstring, conversions to and fromSCCNonlinearProblem, SII methods shared overUnion{SCCNonlinearProblem, SCCSteadyStateProblem}),src/remake.jl(shared SCC remake),docs/src/interfaces/Algebraic_Problem_Types.md,test/scc_steady_state_problem.jl(new),test/runtests.jl,test/public_interface.jl.remake_tests.jlandpublic_interface.jlwere green as well. Runic --check and typos: clean.UndefVarError(see the SSDE before-run).Branch
scc-steadystate-remove-lowered(stacked onef607783; checked out in worktreescratch/SciMLBase-remove)bfc48343Remove SteadyStateProblem.lowered_problem (breaking, 4.0.0). This is therevert of Add a lowered_problem slot to SteadyStateProblem #1603, resolved by hand: the field,
the type parameter, the constructor/
remakekeyword,constructorof,NonlinearProblem(::SteadyStateProblem)and its testset. Version is 4.0.0.Project.toml,src/problems/{nonlinear_problems,steady_state_problems}.jl,src/remake.jl,test/problem_building_test.jl.rm_scc_steady_state.logSCCSteadyStateProblem | 57 57;rm_remake.logremake | 4605 4605;rm_problem_building.logandrm_public_interface.logall green.SciMLBase below 4, so this branch could not be tested with MTK or SSDE. The MTK/SSDE
branches declare
SciMLBase = "3.59", so they would also need a"3.59, 4"compat topick up 4.0.
Open design questions for Chris
SteadyStateProblem+ nonlinear alg. WithNewtonRaphson()the solution'ssol.probis the convertedNonlinearProblem, as before the lowering existed (onlySSRootfind/DynamicSS/SICNMgivesol.prob isa SteadyStateProblem). The testsencode this. Should SSDE rewrap it? I left it alone because it changes the dispatch
surface that SciMLSensitivity uses.
lowered_problemgo now as SciMLBase4.0 (
scc-steadystate-remove-lowered), or stay deprecated-but-unused in 3.x? The 4.0path needs
SciMLBase = "3.59, 4"compat in MTK/SSDE and in every package that capsSciMLBase below 4.
SCCNonlinearProblem(::SteadyStateProblem)method was a public-ish extension in MTKBase 1.77. I released its removal as a minor
(1.78.0), on the grounds that it was only meaningful with the lowering. A strict reading
makes it a major.
SCCSteadyStateProblem(sys, op)builds a fullSteadyStateProblem(including its initialization problem) only to processop, thencompiles the residual system.
build_initializeprob = falsebreaks hierarchicalinitialization_eqs. Is a lighter op-processing path worth adding?DynamicSS(Tsit5())withthe default
tspan = Infruns out of maxiters before the termination callback fires,even though the ODE is globally stable. A hand-written
SteadyStateProblembehaves thesame, so this is not caused by this change. The tests use
tspan = 100. Worth an SSDEissue?
SteadyStateSolution(=NonlinearSolution) on anSCCSteadyStateProblemcarries the compressed layout throughsol.prob.f.sys, and nodedicated SCC solution type was added. Is that the intended end state?
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (fix), Claude Code 2.1.285 (PR) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium / claude-opus-5-5
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)
🤖 Generated with Claude Code
Independent review (Codex CLI 0.162.1 gpt-6.1-sol, head 867dba9)
VERDICT: CHANGES
The new SCC steady-state type is documented and tested, and the guess-less linear-block remake fix has reproducible failing-before/passing-after evidence. However, the shared constructor validation rejects an existing SCCNonlinearProblem input that solves successfully on the base. This is a breaking change in a proposed 3.59.0 release. Four failing CI checks also remain unclassified against master.
Validation: Julia 1.12.7, JULIA_NUM_THREADS=4, JULIA_NUM_PRECOMPILE_TASKS=4, timeout 3600. Base source was extracted from 365283c; tracked head files were untouched. The complete new test file passes 117/117 at head. Existing problem_building_test.jl and remake_tests.jl pass (4,777 assertions across 81 reported testsets). Extracting the new linear-block regression testsets for SCCNonlinearProblem gives 18/18 and 12/12 at head; the first testset on base reports 4 passed, 5 failed, 1 errored, including stale parameters, a wrong linear solution, and length(::Nothing). Logs and scripts are under tmp/.
G1: no numerical algorithm or tolerance changes; the linear-block regression checks the independent solution of 2x = 4. G2: no GPU kernels, AD rules, Reactant tracing, or MPI implementation changes. G3: the parameter-propagation tests catch stale subproblem state and check that the original matrix remains unchanged. These gates do not excuse the compatibility regression or the outstanding CI comparison.
src/problems/nonlinear_problems.jl:595 — confirmed by running: preserve working SCCNonlinearProblem inputs with mixed initial-guess availability. The new all(has_state) check is reached by the existing public constructor. This reproducer succeeds on base 365283c with sol.u = [2.0, 3.0] and ReturnCode.Success, but throws ArgumentError at construction on head 867dba9:
using SciMLBase, SCCNonlinearSolve, LinearSolve, Test
lin1 = LinearProblem([2.0;;], [4.0])
lin2 = LinearProblem([3.0;;], [9.0]; u0 = [0.0])
prob = SCCNonlinearProblem((lin1, lin2), (Returns(nothing), Returns(nothing)))
sol = solve(prob, SCCNonlinearSolve.SCCAlg())
@test sol.u ≈ [2.0, 3.0]
@test SciMLBase.successful_retcode(sol)
I ran
julia --startup-file=no --project=tmp/baseenv tmp/mixed-linear.jlsuccessfully and the same script with tmp/mixed-headenv fails at the new check. Both environments use SCCNonlinearSolve 1.16.0 and LinearSolve 5.18.2. See tmp/mixed-base-final.log and tmp/mixed-head.log. Initial guesses are optional for these direct linear solves, so rejecting the container removes a working use case. Preserve existing SCCNonlinearProblem acceptance, or separate this restriction into an explicitly approved major release; the new mixed-block rejection tests do not establish backward compatibility. This matches H1, regardless of the additive steady-state API (ML7) and the separately verified remake fix (ML1).checks.txt:1 — suspected from reading; verification blocker, not a confirmed code defect: the supplied snapshot reports failures for Catalyst/All/1, LinearSolve.jl/All, and SymbolicIndexingInterface on Julia 1 and lts. No failing-job logs or matching master evidence are supplied. Attempts to retrieve them with gh failed because no GitHub credentials are available. Establish the cause of each failure and compare it with master before asserting no test regressions. I did not classify any of these failures as pre-existing.
Not verified: the four failing CI jobs versus master, CI reruns, the full Core/QA/downstream suites locally, or the complete three-package solve workflow. The supplied issue-171.json describes an unrelated 2022 SciMLBase PR, not the SteadyStateDiffEq issue linked in the PR body; retrieving the correct issue with gh was blocked by missing authentication. Successful CI statuses are taken from the supplied snapshot, not independently inspected logs.
🤖 Posted by an AI agent — harness: Codex CLI 0.162.1 · model: gpt-6.1-sol
Conversation: Codex exec session 01a14b16-ae24-7a63-b73b-b1709517e4ec (no public URL)
Codex CLI gpt-6.1-sol rated it high (H1) at head 867dba9