Skip to content

Honour inline_linear_sccs for time-independent systems - #197

Open
asinghvi17 wants to merge 2 commits into
mainfrom
fix/nonlinear-linear-scc-inlining-v2
Open

asinghvi17 wants to merge 2 commits into
mainfrom
fix/nonlinear-linear-scc-inlining-v2

Conversation

@asinghvi17

Copy link
Copy Markdown

🤖 Automated comment from an AI agent running as @asinghvi17 — not written or reviewed by Anshul.

Replaces #190 with the same two commits, re-created with the License/Copyright trailers the commit check requires (no code change versus #190).

An explicit request to inline linear SCCs was silently ignored for systems without time. 14-line fix plus one regression test, made independent of MTK's tearing.

🤖 Generated with Claude Code

https://claude.ai/code/session_014mFQHufqGmwfiZHWwWB4qh


🤖 Posted by an AI agent — harness: Claude 2.1.332 · model: claude-opus-5-5
Conversation: factory head hd_4d32af60 on m_4242afb3ce622d22c2c40d9e9baf1f9a (no session URL)

asinghvi17 and others added 2 commits November 30, 2026 11:58
License: AGPL-3.0-only
Copyright: JuliaHub, Inc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test relied on `mtkcompile(...; max_linear_scc_tearing = 0)` to keep the
2x2 linear block untorn. That keyword only exists in unreleased
ModelingToolkit 11.48; registered 11.46.1 silently ignores it, tears the
block to a single variable and solves it analytically, so no runtime
`A \ b` block was emitted and the test failed in the ModelingToolkitTearing
CI job.

Exercise the runtime path with a block whose coefficients depend on the
unknown `z`, which tearing cannot solve on any version, and keep the
parameter-coefficient system for the symbolic path.

License: AGPL-3.0-only
Copyright: JuliaHub, Inc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com>

@ambujone ambujone left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that the new testset fails on the merge base (6 failures: the unknowns stay [z, y, x] and no inline block is reported) and passes with the change, and the full MTKTearing suite passes on 1.13.

One design question, since the comment this removes recorded an intent: "iv === nothing implies a nonlinear system; SCCNonlinearProblem should be used instead of this pass". Is there still a reason to prefer SCCNonlinearProblem for nonlinear systems, or is honouring an explicit inline_linear_sccs = true the agreed behaviour? It would help to say so in the PR description, since this changes the default-off flag from "ignored" to "applied" for these systems.

Also, the promote reference now has iv only when it exists. A case with a system input and no iv would cover the remaining branch of reference_args.

Aside, not for this PR: inline_linear_sccs_preprocessing! is an empty function with an iv::SymbolicT signature and no callers.

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