Skip to content

SCCNonlinearSolve: solve HomotopyProblem blocks in vector-stored SCC problems - #1321

Merged
ChrisRackauckas merged 2 commits into
masterfrom
scc-vector-homotopy-blocks
Oct 3, 2026
Merged

ChrisRackauckas merged 2 commits into
masterfrom
scc-vector-homotopy-blocks

Conversation

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Opened by an AI agent running as @ChrisRackauckas; Chris has not reviewed this change.
Harness: Claude Code 2.1.280 · Model: claude-opus-5-5[1m]
Conversation: https://claude.ai/code/session_01Wt79fZeNaZxiwQ3LagMYXH

Please ignore until reviewed by @ChrisRackauckas.

What changed and why

iteratively_build_sols for vector-stored blocks calls probvec(first(probs)) to fix the stripped solution type, and probvec had no HomotopyProblem method. So an SCCNonlinearProblem whose blocks are stored in a vector and whose first block is a HomotopyProblem threw a MethodError before solving anything. The tuple path never calls probvec, and solve_single_scc already handles homotopy blocks, so this adds HomotopyProblem to the probvec method that returns u0. The existing homotopy test now runs both container forms.

This is needed by SciML/ModelingToolkit.jl#5202, which stores initialization SCC blocks in a vector at AutoDespecialize, which puts small homotopy initialization problems on this path (ModelingToolkit's test/homotopy_initialization_scc.jl hits it). On current releases it is reachable only with 6 or more blocks.

Verification

Julia 1.12.6, aarch64-linux, test/core_tests__item5.jl run directly against this sub-library.

Before the fix (test change only):

homotopy SCC block is continued, not target-λ solved (tuple)  | Pass 2  Total 2
homotopy SCC block is continued, not target-λ solved (vector): Error During Test
  MethodError: no method matching probvec(::HomotopyProblem{Vector{Float64}, false, SciMLBase.NullParameters, ...
homotopy SCC block is continued, not target-λ solved (vector) | Error 1  Total 1

After:

homotopy SCC block is continued, not target-λ solved (tuple)  | Pass 2  Total 2
homotopy SCC block is continued, not target-λ solved (vector) | Pass 2  Total 2
the inner corrector's autodiff is honored                     | Pass 2  Total 2

GROUP=Core and GROUP=QA for lib/SCCNonlinearSolve: both Testing SCCNonlinearSolve tests passed. Runic: no changes. typos: clean.

Not verified

x86-64; other sub-libraries (none touched). A release of SCCNonlinearSolve is needed before ModelingToolkit can depend on this.


🤖 Posted by an AI agent — harness: Claude Code 2.1.280 · model: claude-opus-5-5[1m]
Conversation: https://claude.ai/code/session_01Wt79fZeNaZxiwQ3LagMYXH

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wt79fZeNaZxiwQ3LagMYXH

Risk assessment

  • Risk: low
  • Blast radius: Only lib/SCCNonlinearSolve. The one-line source change widens the internal probvec(::Union{NonlinearProblem, NonlinearLeastSquaresProblem}) method to also accept SciMLBase.HomotopyProblem. The only thing it affects is SCCNonlinearProblem with vector-stored blocks whose first block is a HomotopyProblem, which currently throws a MethodError. It adds behaviour and changes nothing that already works, so a patch bump fits SemVer. probvec is internal to SCCNonlinearSolve, and HomotopyProblem is exported by SciMLBase, so no non-public dependency internals are used. The test is strengthened, not weakened: the existing homotopy testset now loops over both a tuple and an Any[...] vector of blocks with unchanged assertions. The main downstream consumer is ModelingToolkit initialization, and ModelingToolkit.jl/Initialization downstream CI passes.
  • Evidence: Head f954654af8 has 2 failing checks. Neither is a regression.
    • (1) Downgrade / Downgrade Tests - Core fails on 6: Watson function | alg #2 at test/Core/setup_robustnesstesting.jl:25 (92 passed, 1 failed, 22 broken). It is pre-existing: the latest master push 06b122951a fails the same test with the same counts (run 36634513105), and so do unrelated PR branches (add-complex-roots-option, reactant-jit-solve). It passes on some master commits, so it is flaky. It is also root-package code this PR doesn't touch.
    • (2) downgrade-sublibraries / test (lib/NonlinearSolveFirstOrder) fails with 28 errors, TypeError: in ccall argument 5, expected SVector{2, Float64}, got Vector{Float64} in rootfind_tests__item8.jl:30. It is pre-existing: the same failure appears on the PR's merge base c76316ac7a and on master fafb92a9de and ee114a2bf3. This PR doesn't touch that sub-library.
    • All SCCNonlinearSolve checks pass: Core on Julia 1 and lts, QA, and downgrade. The Julia pre lane passing tells you nothing, because it skips build and test when Julia 1.13.0 is not an RC.
    • CI ran on a base 8 commits behind master. The probvec lines on master are unchanged apart from moving to line 86.
  • Independent review: Devin CLI (Mac) / fusion-claude-opus-5-5-high-sidekick-swe-2-medium rated it low, high confidence: it is a one-method additive fix covered by a test that exercises both container forms, and both CI failures reproduce identically on master or the merge base.
  • Merge: needs human review. Findings:
    • (a) The version bump no longer does anything. Master already has SCCNonlinearSolve 1.15.4, tagged SCCNonlinearSolve-v1.15.4 and registered in General. The PR's 1.15.3 → 1.15.4 edit is identical to master's line, so it merges cleanly, but the fix would ship under an already-registered version. The PR needs a rebase and a bump to 1.15.5, or the release that ModelingToolkit.jl PR 5202 depends on can't happen. The description predates this and doesn't mention it.
    • (b) The PR is marked UNREVIEWED and "Please ignore until reviewed by @ChrisRackauckas".
    • (c) The description says the fix was verified on aarch64-linux only.

🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI (Mac) / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Claude Code 2.1.285 (Claude Code) (Mac) fleet-master head, model claude-opus-5-5[1m]
Conversation: local session 3c311569-dda6-4687-bc9f-65febb212c33 (~/.claude/projects/-Users-chrisrackauckas-sandbox-master/3c311569-dda6-4687-bc9f-65febb212c33.jsonl)

…problems

`iteratively_build_sols` for vector-stored blocks reads the first block's state through
`probvec` to fix the solution type, and `probvec` had no `HomotopyProblem` method, so an
`SCCNonlinearProblem` whose blocks are a vector and begin with a homotopy block threw a
`MethodError`. Tuple-stored blocks never call `probvec`, which is why only the vector form
failed. The homotopy test now runs both container forms.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Agent-Harness: Claude Code 2.1.280
Agent-Model: claude-opus-5-5[1m]
Agent-Session: https://claude.ai/code/session_01Wt79fZeNaZxiwQ3LagMYXH
Claude-Session: https://claude.ai/code/session_01Wt79fZeNaZxiwQ3LagMYXH
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review October 3, 2026 11:43
@ChrisRackauckas
ChrisRackauckas merged commit 61f721b into master Oct 3, 2026
33 of 35 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the scc-vector-homotopy-blocks branch October 3, 2026 11:44
ChrisRackauckas referenced this pull request Oct 14, 2026
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: Fusion (Claude Opus 5.5 Medium + SWE-2 Medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/flash-hour.json

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-generated Opened by an AI agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant