Skip to content

Require ModelingToolkit 11.47 and test stationary unknown counts - #744

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/mtk-11-47-stationary
Nov 26, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/mtk-11-47-stationary

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

ModelingToolkit 11.47 no longer tears large linear blocks of stationary systems, so a stationary PDE discretization now keeps every interior node as an unknown. Previously unknowns could be dropped and the nonlinear solve could fail to converge, which is why the mixed-derivative steady state test was marked broken. That @test_broken now passes, which makes master CI report an unexpected pass, so this turns it into a regular @test.

Changes:

  • Raise the ModelingToolkit compat floor to 11.47 (ModelingToolkitBase's floor is unchanged, since ModelingToolkit 11.47 itself requires Base 1.78 or newer).
  • Add stationary tests asserting the unknown count and a successful Newton solve: 2D Laplace with Dirichlet conditions on 8x8 and 9x9 grids (36 and 49 unknowns, interior solution matches the exact one), a Neumann case on a 9x9 grid (56 unknowns), and a 31x31 grid checked for its unknown count only (841), since default tolerances report Stalled there.

Tests: GROUP=Stationary 19/19 pass, GROUP=Mixed_Derivatives 3 pass with 2 remaining broken (other lines), GROUP=Components passes.

🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1

…all interior unknowns

ModelingToolkit 11.47 no longer tears large linear blocks of stationary
systems, so the mixed-derivative steady state problem now converges and its
test_broken becomes a regular test. New stationary tests assert the unknown
count for Dirichlet and Neumann Laplace problems.

Agent-Harness: Claude Code 2.1.325
Agent-Model: claude-sonnet-5-5
Agent-Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

PR: #744

Reviewed head: 0e1af42
Raw SHA-256: 1b98550fca7def919cbeebfdca6c81e99358b61da1f3ba1fca3a781bfa76dd98
Source SHA-256: f237f02c2b45c15ab0214300bc89e6c45f2bef611476b20d938a4c4405a14523
Source: standard-review-v1 (harness-log)
Reviewer session: 01a2148d-06f3-72f1-98e4-eda9d98bd58c
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML4)
  • Verdict: CHANGES
  • Reviewed head: 0e1af42

Review report

VERDICT: CHANGES
Round: 1
Head: 0e1af42
Slot: 1
CI: green
Session: 01a2148d-06f3-72f1-98e4-eda9d98bd58c
Reviewer: codex-cli 0.170.0; model: gpt-6.2-sol

Risk

medium-low (ML4: raises the ModelingToolkit compat floor from 11.42 to 11.47)

Blocking findings

  • Blocking priorities: P2

  • [P2] test/Mixed_Derivatives/MOL_Mixed_Deriv.jl:129 — The enabled return-code assertion leaves this mixed PDE without an active accuracy check. The inherited broken comparison uses u=x*y, whose mixed derivative is 1, for an equation with right-hand side 0. On the head the existing fixture returned Success and differed from that reference by 0.0771. In a manufactured test with right-hand side 1, both signs of the mixed derivative returned Success. The correct sign had maximum interior error 6.11e-16, while the reversed sign had error 0.154.

    Implementation fix: In the Mixed steady state problem testset, set the right-hand side to 1, keep the existing Dirichlet data and use the documented approx_order=2 keyword to preserve the exercised order. Keep the hard success assertion and replace the broken comparison with a hard maximum-error assertion on the interior against x*y evaluated on the independently constructed 20-point grid. Check the reported axes against that grid. The stencil is exact for this polynomial in real arithmetic, so a unit-scale floating-point bound of sqrt(eps(Float64)) gives a margin for numerical error. The corrected fixture returned MaxIters with interior error 1.29e10 on the old dependency set and passed both criteria on the head. The reversed-sign control must fail the field assertion. This change is confined to the testset.

Non-blocking findings

  • test/Stationary/MOL_NonlinearProblem.jl:136 — The two Dirichlet testsets duplicate the PDE and boundary setup. The comment above the first testset describes release history.

    Implementation fix: Delete the two-line comment starting with # ModelingToolkit 11.47 no longer. Extend the existing grid-size loop to (8, 9, 31), assert (n - 2)^2 unknowns in each case, and keep the existing default-Newton success and field assertions on the two small grids. The existing three count cases cover the consolidation. No new test or call-site change is needed.

What I ran

  • Julia 1.12.4, ModelingToolkit 11.47.0 and ModelingToolkitTearing 1.20.9, using the repository test runner in a scratch copy. Pkg.test(; allow_reresolve=false) with GROUP=Stationary reported 19 passes. With GROUP=Mixed_Derivatives it reported 3 passes and 2 inherited broken expectations. Both runs exited 0.
  • Ran the stationary and mixed-sign probes against that resolved environment and an old allowed graph with ModelingToolkit 11.46.1 and ModelingToolkitTearing 1.20.8. The two small Dirichlet grids, the quadratic Neumann case and the large Dirichlet grid retained 7, 8, 13, 30 states before and 36, 49, 56, 841 after. The original mixed fixture changed from MaxIters to Success. The Neumann probe on the head had maximum interior error 1.55e-15 and boundary-slope error 1.69e-14. For the 31×31 Dirichlet grid, default Newton changed from MaxIters with interior error 5.81e22 to Stalled with error 8.88e-16. With an explicit stencil-scaled absolute residual tolerance of 256 * eps(Float64) * 8 / h^2, the old graph still returned MaxIters and the head returned Success with error 3.22e-15.
  • Julia 1.10.12 resolved ModelingToolkit 11.47.0, ModelingToolkitBase 1.81.0 and PDEBase 0.1.42. uv run --locked python --version printed Python 3.13.13 and warned that --locked has no effect outside a project. The checkout has no Python lockfile.
  • git diff --name-status -M origin/master...HEAD reported three modified files and zero renames. Each path was checked for H6. Runic 1.13.0, typos on the changed files and git diff --check origin/master...HEAD exited 0. The checkout was clean after verification.

What I did not verify

  • The full test matrix, QA, downstream packages, and test execution on Julia 1.10. CI status is supplied metadata.

AUTHOR_GRADE: {"task":"bugfix","score":4,"difficulty":3,"rounds":1,"author_harness":"Claude Code 2.1.325","author_model":"claude-sonnet-5-5","note":"The new dependency floor fixes the reproduced stationary failures, but the changed mixed regression still lacks a valid hard accuracy check."}

Head link: 0e1af42


🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a2148d-06f3-72f1-98e4-eda9d98bd58c (no session URL)

Use a manufactured right-hand side of 1 so u = x*y solves the equation, compare the interior against it with a hard bound, and cover n = 31 in the Dirichlet loop of the stationary tests.

Agent-Harness: Claude Code 2.1.325
Agent-Model: claude-sonnet-5-5
Agent-Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
@xtalax-droid

Copy link
Copy Markdown
Contributor Author

Review round 1 addressed. The mixed steady state test now uses a right-hand side of 1 so that xy is an exact solution, with approx_order = 2, the hard success assertion, grid axis checks, and a hard interior max-error bound of sqrt(eps(Float64)) against xy. A control with the mixed-derivative sign reversed fails that assertion. In the stationary tests, the release-history comment is gone and the Dirichlet loop now covers n = 8, 9 and 31, asserting (n - 2)^2 unknowns each time, with solve and field checks on the two small grids only. GROUP=Mixed_Derivatives and GROUP=Stationary pass locally.

🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

PR: #744

Reviewed head: 4f0f1c3
Raw SHA-256: 9d282e1daf8a91a752fa6cfd0789ec54920680e328abd4d96e85a743d44ce67c
Source SHA-256: 169a0faa130aa1307130ca34fa1a9dc27f23576cfa86575edfc4ed24edba8a52
Source: standard-review-v1 (harness-log)
Reviewer session: 01a21576-731c-70f1-b41d-bc744d4dae55
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML4)
  • Verdict: MERGE
  • Reviewed head: 4f0f1c3

Review report

VERDICT: MERGE
Round: 2
Head: 4f0f1c3
Slot: 1
CI: green
Session: 01a21576-731c-70f1-b41d-bc744d4dae55
Reviewer: codex-cli 0.170.0; model: gpt-6.2-sol

Risk

medium-low (ML4: raises the ModelingToolkit compatibility floor from 11.42 to 11.47)

Blocking findings

None.

Non-blocking findings

None.

What I ran

  • Ran GROUP=<group> julia --project=. --startup-file=no -e 'using Pkg; Pkg.offline(true); Pkg.test(; allow_reresolve=false)' in a scratch copy of the head. Julia 1.12.4 resolved ModelingToolkit 11.47.0 and ModelingToolkitTearing 1.20.9. Both groups exited 0. Stationary reported 19 passes. Mixed_Derivatives reported six passes and one inherited broken test.
  • The mixed probe used the independent field u=x*y, whose mixed derivative is 1, and a constant initial guess of 1.0. The correct, reversed and omitted mixed derivatives all gave Newton Success, with maximum interior errors of 3.33e-16, 0.154 and 0.0732, respectively. Both mutations exceed the test's sqrt(eps(Float64)) bound. With ModelingToolkit 11.46.1 and ModelingToolkitTearing 1.20.8, the correct equation returned MaxIters with error 1.29e10.
  • The head retained 36, 49 and 841 unknowns on the three Dirichlet grids and 56 on the Neumann grid. The two small Dirichlet cases retained 7 and 8 unknowns and stalled on the older dependency set. On the head, the Neumann boundary-slope error was 1.11e-14. The 31×31 case returned Stalled at default tolerances with field error 6.66e-16 and Success with a stencil-scaled absolute residual tolerance. The head probe exited 0 with 26 passes. The older probe used one OpenBLAS thread.
  • Compared the supplied delta with the Git comparison between rounds. The full diff has three modified paths and zero renames. I checked all three for H6. Runic 1.13.0, typos on the changed files, and git diff --check origin/master...HEAD exited 0. The checkout was clean.
  • uv run --locked python --version printed Python 3.13.13 and warned that --locked has no effect outside a project. The checkout has no Python lockfile. The running Codex harness supplied the session ID in the header.

What I did not verify

  • I stopped the supplementary older-dependency run after an hour while it was solving the 31×31 case, before it reached Neumann. Both cases ran on the head.
  • Full test matrix, QA, downstream packages, and test execution on Julia 1.10. CI status is supplied metadata.

AUTHOR_GRADE: {"task":"bugfix","score":5,"difficulty":3,"rounds":2,"author_harness":"Claude Code 2.1.325","author_model":"claude-sonnet-5-5","note":"The new mixed accuracy assertion rejects reversed and missing derivatives, the older dependency set reproduces the solve failure, and both affected groups pass on the head."}

Head link: 4f0f1c3


🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a21576-731c-70f1-b41d-bc744d4dae55 (no session URL)

@ChrisRackauckas
ChrisRackauckas merged commit ee45cac into SciML:master Nov 26, 2026
91 checks passed
ChrisRackauckas referenced this pull request Nov 26, 2026
Bump version to 1.7.0
Bump version to 1.7.0

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: AI agent <[email protected]>
Agent-Harness: hourly_releases
Agent-Model: none (deterministic)
Agent-Session: local job hourly-release-a8196c0d-e4da-4761-a5ea-083bedf7f947 (no session URL)
Agent-Session: local job hourly-release-cd233b8b-1693-433c-8d21-4c21ffddc425 (no session URL)
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.

4 participants