Skip to content

WIP: build implicit DAE Jacobians and sparsity from scalarized array residuals - #5136

Draft
ChrisRackauckas wants to merge 4 commits into
masterfrom
array-dae-jacobian-residuals
Draft

ChrisRackauckas wants to merge 4 commits into
masterfrom
array-dae-jacobian-residuals

Conversation

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

🚧 UNREVIEWED WORK IN PROGRESS — awaiting review by @ChrisRackauckas. Pushed by an AI agent running as @ChrisRackauckas so the work is not lost; Chris has not reviewed it. Please ignore this draft until he does.
Harness: Claude Code 2.1.270 · Model: claude-fable-5-1
Conversation: local Claude Code session 9b5c3ae5-6a0f-41b8-bd69-03bf3b5e7083 (no shareable URL available)

Work in progress. jacobian_dae_sparsity and the generated DAE Jacobian differentiated the raw right-hand sides of array equations; this scalarizes the residuals first (skipping empty-shaped equations), combines the two patterns elementwise, and builds the sparse DAEFunction prototype from that pattern instead of two symbolic Jacobians. Related: #5093.

Evidence (Julia 1.12.6, aarch64; lib/ModelingToolkitBase/test/array_dae_jacobian.jl):

master:  Implicit array residual Jacobians include both sides | Error 1 / 1
         MethodError: no method matching executediff(::Differential, ::Vector{BasicSymbolic}; simplify::Bool)
branch:  the after-run did not complete before this was pushed (one attempt segfaulted while precompiling); treat as unvalidated

Not verified: anything beyond the failing-before run.


🤖 Posted by an AI agent — harness: Claude Code 2.1.270 · model: claude-fable-5-1
Conversation: local Claude Code session 9b5c3ae5-6a0f-41b8-bd69-03bf3b5e7083 (no shareable URL available)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Risk assessment (independent review, Codex gpt-6.1-sol, head b984e00)

  • Verdict: CHANGES

  • Rating: Codex gpt-6.1-sol rated it medium-low (ML1) at head b984e00

  • Risk: medium-low (ML1: corrects the sparsity returned for already-constructible implicit DAEs whose left-hand sides contain unknowns, changing sparse prototype patterns on a working path; the array-construction fix also matches L6, and added tests match L2).

  • Blast radius: Symbolic implicit DAE Jacobians and sparse DAEFunction/DAEProblem prototypes, including scalar algebraic left-hand sides and array residuals. This is a peripheral implicit-DAE path rather than System construction or mtkcompile itself.

  • Evidence: Read the full diff using git diff origin/HEAD...HEAD, the PR metadata, linked issue and comments, and all risk criteria. git diff --check origin/HEAD...HEAD passed. No new public names, dependency changes, skipped tests or loosened assertions occur in the diff; the helpers are internal and the new dependency calls are publicly exported. No breaking public signature or documented contract change requiring a major bump was identified.

    Local runs used Julia 1.12.4, JULIA_NUM_THREADS=4, JULIA_PKG_PRECOMPILE_AUTO=0, the requested JULIA_DEPOT_PATH, and TMPDIR under scratch. Let S denote <local path>. Environments and source snapshots were created there; the review checkout was unchanged.

    1. Head: timeout 3600 julia --compiled-modules=existing --project=$S/env -e 'include("lib/ModelingToolkitBase/test/array_dae_jacobian.jl")' — exit 0 with Symbolics 7.46.0 / SymbolicUtils 4.51.0. Testset counts: 8/8, 3/3, 2/2 passed.
    2. Default branch: archived origin/HEAD at 808a4f13e865cf457396ed72ed7d5e7a9ae2a4f8 into scratch and used the same dependency manifest with its ModelingToolkitBase source path changed. timeout 3600 julia --compiled-modules=existing --compile=min -O0 --project=$S/baseenv $S/base_runner.jl includes the exact PR test file — exit 1, first testset 3 passed / 1 error. Dense assertions passed; sparse construction threw Only semi-explicit constant mass matrices are currently supported. Faulty equation: (x(t))[3] ~ (x(t))[1] + 2(x(t))[2]. A separate scalar prototype probe in that runner also showed the omitted algebraic left-hand-side entry: indices ([1, 2, 1], [1, 1, 2]), missing (2,2).
    3. Supported older dependencies: used Pkg.add([PackageSpec(name="Symbolics", version="7.45.0"), PackageSpec(name="SymbolicUtils", version="4.46.4")]) in scratch/minenv. timeout 3600 julia --compiled-modules=existing --compile=min -O0 --project=$S/minenv $S/min_test.jl runs the unchanged final testset from the PR — exit 1, 0 passed / 1 error, BoundsError: attempt to access 0-element StepRange{Int64, Int64} at index [1]. The same command with --project=$S/minbaseenv against the default-branch snapshot also errored identically. Thus the empty-equation limitation predates this PR, but the PR adds a required test that fails on supported versions and does not supply the promised handling. Logs and reproduction environments are in scratch.

    CI comparison: downloaded failing job logs with read-only gh run view ... --log-failed / gh api .../logs. The PR downgrade InterfaceI failure is the same empty-array exception confirmed locally. PR SciMLBase indexing errors at comprehensive_indexing.jl:127 and :164 match the current default branch's two BoundsErrors; PR SciMLSensitivity Core8 mtk.jl:216 matches the default branch's time-gradient/3600-element-vector BoundsError. PR documentation and the merge-base documentation run both terminate on Documenter [:linkcheck]. The benchmark lts job failed cloning ModelingToolkit with GitError(Code:EEOF, Class:Net, early EOF) and subsequently lacked handle_caches.jl; the other benchmark job was cancelled. There is no current equivalent default-branch benchmark result establishing performance, and I do not classify those benchmark failures as proven pre-existing failures.

    Gates: G1 pass — hand-derived Jacobian and exponential analytic solution, exercised locally by all 13 head assertions. G2 not applicable — no GPU kernels, AD rules, Reactant tracing or MPI paths changed; symbolic differentiation is not a new AD rule. G3 not applicable — no shared-state, cache, threading or global-default changes. The supported-version test failure independently blocks merge.

  • Merge: needs changes (make the newly required empty-array regression pass throughout supported compatibility, including the downgrade configuration).


🤖 Posted by an AI agent — harness: Codex CLI 0.162.1 · model: gpt-6.1-sol
Conversation: local headless review run (no public session URL); transcript kept by the fleet master.

…residuals

Scalarize array residual equations before differentiating so that the DAE
Jacobian and its sparsity pattern cover every element, combine the two
patterns elementwise, and build the sparse prototype from the sparsity
pattern. Work in progress: the regression test errors before the change; the
after-run did not complete.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Agent-Harness: Claude Code 2.1.270
Agent-Model: claude-fable-5-1
Agent-Session: local Claude Code session 9b5c3ae5-6a0f-41b8-bd69-03bf3b5e7083
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master b1c432d... master / b1c432d...
ODEProblem 5.57 ± 0.83 ms 4.95 ± 0.42 ms 1.13 ± 0.19
init 0.0723 ± 0.023 ms 0.0648 ± 0.023 ms 1.12 ± 0.54
large_parameter_init/ODEProblem 17.5 ± 3.3 ms 13.8 ± 1.7 ms 1.27 ± 0.28
large_parameter_init/init 0.086 ± 0.033 ms 0.069 ± 0.021 ms 1.25 ± 0.6
mtkcompile 9.93 ± 1.6 ms 9.02 ± 1.3 ms 1.1 ± 0.24
sparse_analytical_jacobian/ODEProblem 22.6 ± 3.7 ms 19.2 ± 1.9 ms 1.17 ± 0.22
sparse_analytical_jacobian/f_iip 0.06 ± 0.01 μs 0.08 ± 0.01 μs 0.75 ± 0.16
sparse_analytical_jacobian/f_oop 0.107 ± 0.016 ms 0.105 ± 0.014 ms 1.03 ± 0.2
time_to_load 5.59 ± 0.35 s 5.07 ± 0.16 s 1.1 ± 0.077
Memory benchmarks
master b1c432d... master / b1c432d...
ODEProblem 0.0377 M allocs: 1.71 MB 0.0377 M allocs: 1.71 MB 1
init 0.455 k allocs: 0.0589 MB 0.455 k allocs: 0.0589 MB 1
large_parameter_init/ODEProblem 0.157 M allocs: 5.4 MB 0.157 M allocs: 5.4 MB 1
large_parameter_init/init 0.838 k allocs: 0.171 MB 0.838 k allocs: 0.171 MB 1
mtkcompile 0.0557 M allocs: 2.62 MB 0.0557 M allocs: 2.62 MB 1
sparse_analytical_jacobian/ODEProblem 0.117 M allocs: 4.76 MB 0.117 M allocs: 4.76 MB 1
sparse_analytical_jacobian/f_iip 0 allocs: 0 B 0 allocs: 0 B
sparse_analytical_jacobian/f_oop 0.848 k allocs: 27 kB 0.848 k allocs: 27 kB 1
time_to_load 0.202 k allocs: 12.2 kB 0.202 k allocs: 12.2 kB 1

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia vlts)

Time benchmarks
master b1c432d... master / b1c432d...
ODEProblem 7.45 ± 1.5 ms 6.45 ± 0.81 ms 1.16 ± 0.28
init 0.119 ± 0.034 ms 0.12 ± 0.031 ms 0.993 ± 0.38
large_parameter_init/ODEProblem 22.2 ± 2 ms 21.8 ± 2.6 ms 1.02 ± 0.15
large_parameter_init/init 0.121 ± 0.034 ms 0.122 ± 0.037 ms 0.992 ± 0.41
mtkcompile 13.4 ± 2.7 ms 11.9 ± 1.5 ms 1.13 ± 0.27
sparse_analytical_jacobian/ODEProblem 29.2 ± 2 ms 26.1 ± 2.6 ms 1.12 ± 0.14
sparse_analytical_jacobian/f_iip 0.07 ± 0.01 μs 0.07 ± 0 μs 1 ± 0.14
sparse_analytical_jacobian/f_oop 0.357 ± 0.0064 ms 0.353 ± 0.007 ms 1.01 ± 0.027
time_to_load 7.27 ± 0.23 s 7.13 ± 0.099 s 1.02 ± 0.036
Memory benchmarks
master b1c432d... master / b1c432d...
ODEProblem 0.0375 M allocs: 1.95 MB 0.0375 M allocs: 1.93 MB 1.01
init 0.5 k allocs: 0.0843 MB 0.5 k allocs: 0.0843 MB 1
large_parameter_init/ODEProblem 0.161 M allocs: 6.06 MB 0.161 M allocs: 6.06 MB 1
large_parameter_init/init 0.682 k allocs: 0.185 MB 0.682 k allocs: 0.185 MB 1
mtkcompile 0.0594 M allocs: 3.36 MB 0.0594 M allocs: 3.36 MB 1
sparse_analytical_jacobian/ODEProblem 0.118 M allocs: 5.73 MB 0.118 M allocs: 5.73 MB 1
sparse_analytical_jacobian/f_iip 0 allocs: 0 B 0 allocs: 0 B
sparse_analytical_jacobian/f_oop 0.634 k allocs: 19.6 kB 0.634 k allocs: 19.6 kB 1
time_to_load 0.153 k allocs: 14.6 kB 0.153 k allocs: 14.6 kB 1

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/ModelingToolkit.jl that referenced this pull request Sep 13, 2026
Stacked on SciML#5049: array *equations* are accepted by the implicit-DAE and
nonlinear paths, but the opt-in is a hardcoded
`!implicit_dae && !(constructor <: NonlinearFunction)` test in
`__process_SciMLProblem` — a codegen flag and a constructor-type check
doing capability duty. This treats accepting array equations as a named,
per-constructor capability.

- `accepts_array_equations(constructor)` gates `__process_SciMLProblem`.
  `DAEFunction` and `NonlinearFunction` opt in, matching SciML#5049's behavior
  exactly (`HomotopyProblem` inherits nonlinear support through the same
  constructor). Every other problem type still needs `mtkcompile`, and
  opting a new constructor in is a one-line method.
- `has_array_equations(eqs)` gets a docstring; it is the shared,
  shape-based detection predicate behind `check_array_equations` and the
  Jacobian guards.
- `DAEFunction` throws the same `ArgumentError` for `jac = true` /
  `sparse = true` on array residuals that `NonlinearFunction` gets: today
  `jac = true` dies inside `executediff` and `sparse = true` silently
  builds a wrong-shaped `jac_prototype` (one row per equation instead of
  one per residual row).

Related: SciML#4983, SciML#5049, SciML#5131, SciML#5136.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: local Devin CLI session, no shareable URL (workspace /home/crackauc/sandbox/tmp_20260913_101544_55869)
ChrisRackauckas added a commit that referenced this pull request Sep 14, 2026
…ODE support and MultiObjectiveOptimizationFunction (#5148)

* feat: accept array equations on the NonlinearProblem path

* fix: keep array-equation downgrade CI on DiffEqBase 7.18.1

Import unwrap explicitly in the new NL tests and raise the DiffEqBase floor so nested AutoDespecialize accepts already-unwrapped parameters.

* ci: retrigger checks

* Apply suggestion from @ChrisRackauckas

* Zero the derivatives of array unknowns before expanding slices

* Test that array unknowns carry an array equation

* Gate array equations on a per-constructor capability trait

Stacked on #5049: array *equations* are accepted by the implicit-DAE and
nonlinear paths, but the opt-in is a hardcoded
`!implicit_dae && !(constructor <: NonlinearFunction)` test in
`__process_SciMLProblem` — a codegen flag and a constructor-type check
doing capability duty. This treats accepting array equations as a named,
per-constructor capability.

- `accepts_array_equations(constructor)` gates `__process_SciMLProblem`.
  `DAEFunction` and `NonlinearFunction` opt in, matching #5049's behavior
  exactly (`HomotopyProblem` inherits nonlinear support through the same
  constructor). Every other problem type still needs `mtkcompile`, and
  opting a new constructor in is a one-line method.
- `has_array_equations(eqs)` gets a docstring; it is the shared,
  shape-based detection predicate behind `check_array_equations` and the
  Jacobian guards.
- `DAEFunction` throws the same `ArgumentError` for `jac = true` /
  `sparse = true` on array residuals that `NonlinearFunction` gets: today
  `jac = true` dies inside `executediff` and `sparse = true` silently
  builds a wrong-shaped `jac_prototype` (one row per equation instead of
  one per residual row).

Related: #4983, #5049, #5131, #5136.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: local Devin CLI session, no shareable URL (workspace /home/crackauc/sandbox/tmp_20260913_101544_55869)

* Build `ODEProblem` from array differential equations without `mtkcompile`

`complete(sys)` followed by `ODEProblem` rejected array equations such as
`D(u[2:n-1]) ~ lap(u)`, forcing the finite-difference use case through the
scalarizing `mtkcompile`, whose output and compile time grow with the grid.
`DAEProblem` already accepts them, so give the explicit ODE path the same
treatment: the right-hand side of an array equation is written to a
contiguous block of `du` through `array_residual_maker`, the mass matrix
gets one row per element, and the residual form `D(x) .- f ~ 0` emitted by
MethodOfLines is rewritten to `D(x) ~ f` first. The generated code is
independent of the array length.

`full_equations` expands array equations into scalar rows so that the
symbolic jacobian, sparsity and initialization paths keep one equation per
row, and `ODEFunction` only computes the W sparsity pattern when `sparse`
or `sparsity` asks for it.

Co-authored-by: Cursor <[email protected]>

* Update lib/ModelingToolkitBase/src/utils.jl

Co-authored-by: Aayush Sabharwal <[email protected]>

* Expect ODEProblem to accept array equations over scalar unknowns in the #2597 test

Co-authored-by: Cursor <[email protected]>

* Assert the operator type when re-applying a slice derivative to its elements

Co-authored-by: Cursor <[email protected]>

* Solve the array-equation DAE tests from a consistent du0 instead of BrownFullBasicInit

The downgrade CI environment (DiffEqBase 7.15) trips a despecialization
wrapper assertion inside BrownFullBasicInit for DAEFunctions, which aborted
the InterfaceII group before the new ODEProblem tests could run. The tests
only need a solve to compare against the analytic solution, so hand the
solver a consistent du0 and skip DAE initialization.

Co-authored-by: Cursor <[email protected]>

* Share the array-equation predicate and accept them on the ODE path

`is_array_equation` (from the ODE array-equation support) and
`has_array_equations` were two spellings of the same shape check; keep the
per-equation predicate in `utils.jl` and make `has_array_equations` delegate
to it. `ODEFunction` opts into `accepts_array_equations`, matching what its
`generate_rhs` branch already assembles through `array_residual_maker`.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: local Devin CLI session, no shareable URL (workspace /home/crackauc/sandbox/tmp_20260913_101544_55869)

* Expect array unknowns to flatten in the ODE array-equation tests

Post-#5131 `flat_unknowns` handles the array unknown unconditionally, so an
array equation over `u(t)[1:4]` declared as `[u]` constructs and evaluates
rather than throwing "array unknowns".

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: local Devin CLI session, no shareable URL (workspace /home/crackauc/sandbox/tmp_20260913_101544_55869)

* Update rejection tests for the ODE array-equation capability

`ODEProblem` accepts array equations now, so it no longer belongs in the
"still require scalarized equations" testset (`SDEProblem` rejection remains
covered in the same file), and a `D(u) ~ -u` system over the array unknown
`u` constructs because `flat_unknowns` handles it.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: local Devin CLI session, no shareable URL (workspace /home/crackauc/sandbox/tmp_20260913_101544_55869)

* Reject residual-form array differential equations on the ODE path

The scalar path only accepts `D(x) ~ f` from `complete`; `D(x) - f ~ 0` is a DAE
and needs `mtkcompile` or `DAEProblem`. Treat `D(u[2:4]) .- f ~ 0` the same way
instead of pattern-matching it back into explicit form in every consumer.

Also drop the duplicate InterfaceII include of `array_equation_dae.jl` (InterfaceI
already runs it) and scope the docs note about `jac`/`sparse` to array equations.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Agent-Harness: Claude Code
Agent-Model: claude-fable-5-1
Agent-Session: https://claude.ai/code/session_01VorhgJYhDasyVLpGNrviga
Claude-Session: https://claude.ai/code/session_01VorhgJYhDasyVLpGNrviga

* Construct MultiObjectiveOptimizationFunction from a system's cost vector

`OptimizationProblem` accepts `f::MultiObjectiveOptimizationFunction` in
SciMLBase, but MTK could never produce one: `generate_cost` always folds
`get_costs(sys)` through `consolidate` into a scalar.

- `costs(sys)` returns the unconsolidated objective vector: the system's own
  costs plus the consolidated cost of each subsystem, namespaced.
- `MultiObjectiveOptimizationFunction(sys)` generates a vector-valued objective
  over `costs(sys)`. `jac` builds the objective jacobian; `hess` is a vector
  with one generated hessian function per objective, the shape
  `OptimizationBase.instantiate_function` iterates.
- The constraint fields are assembled by `generate_constraint_fields`, shared
  with `OptimizationFunction` instead of duplicated.
- `OptimizationProblem(sys, op; multiobjective = true)` routes through it.
  `weights` cannot combine with it.

Also drop the `jac`/`sparse` guards on `NonlinearFunction` and `DAEFunction`
for array equations: since `full_equations` scalarizes array equations, the
symbolic jacobian and sparsity pattern already come out with one row per
residual, so both now work and are tested against ForwardDiff and the analytic
stencil. The array-residual DAE tests go back to `BrownFullBasicInit`, which
runs on the DiffEqBase 7.18.1 floor.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Agent-Harness: Claude Code
Agent-Model: claude-fable-5-1
Agent-Session: https://claude.ai/code/session_01VorhgJYhDasyVLpGNrviga
Claude-Session: https://claude.ai/code/session_01VorhgJYhDasyVLpGNrviga

* Approve the multi-objective names as ModelingToolkit reexports

`costs` and the `generate_multiobjective_*` / `calculate_multiobjective_*`
functions are exported from ModelingToolkitBase and therefore reexported by the
ModelingToolkit facade; list them in the root QA allow-list.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Agent-Harness: Claude Code
Agent-Model: claude-fable-5-1
Agent-Session: https://claude.ai/code/session_01VorhgJYhDasyVLpGNrviga
Claude-Session: https://claude.ai/code/session_01VorhgJYhDasyVLpGNrviga

---------

Co-authored-by: utkuyilmaz1903 <[email protected]>
Co-authored-by: Christopher Rackauckas <[email protected]>
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Aayush Sabharwal <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Devin and others added 2 commits October 17, 2026 13:45
…residuals

Resolve conflicts by keeping the residual-based DAE Jacobian approach,
adopting master's flat_unknowns rename, and keeping both array-equation
DAE test files.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.92
Agent-Model: swe-2-max
Agent-Session: local Devin CLI session
Check the scalarized residual for emptiness directly instead of matching
on the symbolic shape type, which is a Union the QA JET pass can flag.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.92
Agent-Model: swe-2-max
Agent-Session: local Devin CLI session
@ChrisRackauckas

Copy link
Copy Markdown
Member Author

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

Revived this stale PR: resolved the merge conflict with master and re-validated. Pushed b984e003fe (merge commit 5ee425f83c + cleanup commit b984e003fe).

What was wrong

  • The branch conflicted with master in three files. Since the branch was cut, master renamed unknowns → flat_unknowns in the problem/codegen paths, taught full_equations to scalarize array equations, moved calculate_jacobian to eq.rhs - eq.lhs residuals, and added its own array_equation_dae.jl test — which textually collided with this PR's new array_dae_jacobian.jl include in runtests.jl.
  • The red CI was stale (ran 2026-09-13) and none of it was caused by this diff: build/documenter failed inside deploydocs pushing to gh-pages (same Documentation job fails on current master); the MTKBase QA job's 234 JET findings were all in src/variables.jl (default_toterm/shift2term) — dependency drift, and JET compat has since been bumped on master; the downgrade jobs failed on a Poissonians Monte Carlo tolerance miss and an initialization-solve divergence; SciMLSensitivity/Core8 errored in Enzyme type analysis of despecialized parameters; NeuralPDE/NNPDE1 missed a stochastic NN convergence bound; Optimization hit the 6h runner limit.

What I changed

  • daeproblem.jl: kept the PR's resolution — jac_prototype is always built from jacobian_dae_sparsity (dropped master's if jac branch that assembled it from two symbolic Jacobians).
  • codegen.jl: generate_dae_jacobian uses calculate_dae_jacobian with derivatives = Differential(t).(flat_unknowns(sys)); calculate_dae_jacobian defaults dvs = flat_unknowns(sys); jacobian_dae_sparsity keeps the residual-based pattern with J1 .| J2; runtests.jl keeps both array-DAE test files.
  • Simplified scalarized_dae_residuals' empty-shape guard to check isempty on the scalarized residual rather than matching on the Union{Unknown, ShapeVecT} shape type.

The fix is still needed on master: master's jacobian_dae_sparsity differentiates eq.rhs only, so for D(x[1:2]) ~ -x[1:2], x[3] ~ x[1] + 2x[2] it returns a 4-entry pattern missing the algebraic equation's own (3,3) entry — the residual-based version returns the correct 5-entry pattern (verified live).

Validation (Julia 1.12.7, x86_64, JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4)

  • include("lib/ModelingToolkitBase/test/array_dae_jacobian.jl") on the merged tree → 13/13 pass.
  • cd lib/ModelingToolkitBase && GROUP=InterfaceI julia --project=. -e 'using Pkg; Pkg.test()' (group containing the new test and all DAE-jacobian tests) → 1816 pass, 5 broken, 0 failed, "ModelingToolkitBase tests passed".
  • GROUP=QA same way → JET 54/54, Aqua 21/21, passed.
  • julia -m Runic --inplace on all four changed .jl files → no changes needed.
  • typos over the diff → clean.

Not run locally: the docs build and the downgrade/downstream matrices — none of the stale failures in those jobs touched code this PR modifies; the docs job fails identically on master CI.

Pre-existing failures left alone

  • Documentation build/deploy: deploydocs git push upstream HEAD:gh-pages permission failure — also failing on master today.
  • Downstream NeuralPDE.jl/NNPDE1 (stochastic training tolerance), SciMLSensitivity.jl/Core8 (Enzyme EnzymeNoTypeError on _invoke_with_despecialized_parameters), SciMLBase.jl/SymbolicIndexingInterface (fails on master CI).
  • Downgrade flakes: Poissonians Monte Carlo tolerance; initialization use_scc = true divergence; Optimization group timeout.

🤖 Posted by an AI agent — harness: Devin CLI 3000.11.92 · model: swe-2-max
Conversation: local Devin CLI session gainful-pheasant

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Contractor review (ai-requests#58) of this PR, copied by the posting agent without change to its findings: reviewer Codex CLI 0.164.0 / gpt-6.1-sol, session 01a18da8-3a3a-7620-b234-342bf3d4309e, reviewed head b984e00, round 2, verdict CHANGES, risk medium.

Risk assessment (independent review, Codex CLI 0.164.0 gpt-6.1-sol, slot 1, head b984e00)

  • Risk: medium (M2: Changes implicit DAE Jacobian values and sparsity on scalar/array residual paths; the missing reviewer base/head run also imposes the medium floor.)
  • Verdict: CHANGES
  • Session: 01a18da8-3a3a-7620-b234-342bf3d4309e
  • Blocking priorities: P2

Review round 2, written by the reviewer named above (Codex CLI 0.164.0 / gpt-6.1-sol) in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands.

Summary: Builds implicit DAE Jacobians and sparsity from scalarized array residuals. All 13 current-dependency assertions pass locally, but the supported older stack reproduces the empty-array BoundsError, so the compatibility blocker remains.

Blast radius: generate_dae_jacobian, jacobian_dae_sparsity and sparse DAEFunction prototypes.

Evidence: Julia 1.13.2: the complete new array_dae_jacobian.jl passes 13/13 on the head with current registered dependencies; its first testset errors on origin/master. With Symbolics 7.45.0, SymbolicUtils 4.46.4, SciMLBase 3.55.0 and DFBDF 2.0.0, the head passes the first 8+3 assertions but the empty-array test errors before its two assertions with a zero-element StepRange BoundsError. The cited downgrade CI is confirmed to be on this exact b984e00 head and uses the same key older versions. G1 analytic Jacobian/exponential references pass where executed; G2 is now directly exercised on both stacks. The supported-floor failure requires a source or compat repair; G3 introduces no shared cache/default mutation.

Blocking findings

  1. [P2] lib/ModelingToolkitBase/src/systems/codegen.jl:735 and lib/ModelingToolkitBase/test/array_dae_jacobian.jl:37 — confirmed by running: on the supported Symbolics 7.45.0 / SymbolicUtils 4.46.4 / SciMLBase 3.55.0 stack, the new empty-array test throws BoundsError: attempt to access 0-element StepRange{Int64, Int64} at index [1]. The first 11 Jacobian assertions pass, but scalarized_dae_residuals reaches Symbolics.scalarize before its isempty guard. Guard the zero-sized residual before scalarization or require the first dependency release that fixes this path, then rerun this exact floor test. Do not skip or weaken it. The same failure also appears in exact-head downgrade CI 39040830178.

Non-blocking findings

None.

What I ran

First-round read-only inspection, retained for this unchanged head. Repository commands below ran in the isolated checkout and exited 0; rev-parse HEAD matched the live head metadata. Base is the fetched target-branch tip at review time, while the three-dot diff uses the merge base. Newest non-merge commit trailers, rather than body attribution, supply AUTHOR_GRADE provenance.

git fetch origin +refs/pull/5136/head:refs/remotes/pr/5136 +refs/heads/master:refs/remotes/origin/master
git checkout --detach pr/5136
git rev-parse HEAD
git rev-parse origin/master
git diff --check origin/master...HEAD
git log -1 --no-merges --format=%B
git diff origin/master...HEAD

Read-only GitHub inspection (PR views exit 0; pr checks exits 1 because failures exist):

gh pr view 5136 --repo SciML/ModelingToolkit.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid,title,files,commits,statusCheckRollup
gh pr view 5136 --repo SciML/ModelingToolkit.jl --json body,closingIssuesReferences
gh pr checks 5136 --repo SciML/ModelingToolkit.jl
gh issue view 5093 --repo SciML/ModelingToolkit.jl --json number,title,body,state,url
gh run view 39040829882 --repo SciML/ModelingToolkit.jl --log-failed
gh run view 39040829899 --repo SciML/ModelingToolkit.jl --log-failed
gh run view 39040829977 --repo SciML/ModelingToolkit.jl --log-failed
gh run view 39040830178 --repo SciML/ModelingToolkit.jl --log-failed
gh run list --repo SciML/ModelingToolkit.jl --branch master --event push --limit 5 --json databaseId,headSha,conclusion,url,name
gh run view 38950292112 --repo SciML/ModelingToolkit.jl --log-failed
gh run view 38950292025 --repo SciML/ModelingToolkit.jl --log-failed
gh run view --repo SciML/ModelingToolkit.jl --job 117430895860 --log

CI check rollup at the captured head: {"CANCELLED": 2, "FAILURE": 5, "SKIPPED": 3, "SUCCESS": 101}. Log-retrieval exit codes are retrieval status, not test exit codes: successful retrieved jobs report tests passed; failed jobs remain failed. Failed-run logs were retrieved with a writable scratch XDG_CACHE_HOME. Unavailable logs are disclosed above. The recent default-branch five-run listing was also read; exact historical comparisons are identified in the evidence paragraph.

Current-dependency InterfaceI CI passed 1816 assertions with 5 existing broken markers, while the downgrade lane fails the new test. Failed docs/linkcheck, SII and MTK Forward Mode were compared with historical master 38950292112/38950292025; the new empty-array test is absent from that base and is not covered by those baseline failures.

Inspected CI URLs: https://github.com/SciML/ModelingToolkit.jl/actions/runs/39040829882, https://github.com/SciML/ModelingToolkit.jl/actions/runs/39040829899, https://github.com/SciML/ModelingToolkit.jl/actions/runs/39040829977, https://github.com/SciML/ModelingToolkit.jl/actions/runs/39040830178, https://github.com/SciML/ModelingToolkit.jl/actions/runs/39040830181/job/117430895860, https://github.com/SciML/ModelingToolkit.jl/actions/runs/38950292112, https://github.com/SciML/ModelingToolkit.jl/actions/runs/38950292025.

Round 2 local execution:

All 20 live PRs were checked OPEN with unchanged reviewed heads before Julia execution. Each run checked out the exact detached SHA shown below. Julia 1.13.2 ran directly inside the inherited resource scope, with one Julia invocation at a time, four Julia threads and one BLAS thread. The isolated environment was created with Pkg.activate(temp=true) and Pkg.develop(path=...) for the checkout and its MTKBase subpackage, then persisted outside the checkout for dependency reuse. No test project or source was edited in the checkout.

The driver activates that environment, resolves compatible registered dependencies without updating registries, and includes each selected script in a fresh module. It catches only at the test-file boundary to record every selected result, then exits nonzero if any selected case failed. Assertions and tolerances are unchanged. --compiled-modules=existing reuses available dependency caches and loads uncached PR source; it does not disable tests.

base-master-basecontext-retry: detached 550a27cca63cbe6d7b64bcb2920440aaff9eaa55 (origin/master), process exit 1, 311.21 s.

git -C ModelingToolkit.jl checkout --detach origin/master
REVIEW_CASES='4902,4907,5121,5133,5136,5195,5196,5205,5215' \
JULIA_DEPOT_PATH="$PWD/depot:" JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 \
TMPDIR="$PWD/tmp" JULIA_NUM_PRECOMPILE_TASKS=1 JULIA_PKG_PRECOMPILE_AUTO=0 \
timeout 3600 julia --startup-file=no --compiled-modules=existing --depwarn=yes tmp/rerun/driver.jl

Resolved versions: SymbolicUtils 4.54.0, Symbolics 7.47.0, SciMLBase 3.58.0, JumpProcesses 10.0.1, NonlinearSolve 4.32.0, ModelingToolkit 11.47.0, ModelingToolkitTearing 1.20.7, ModelingToolkitBase 1.79.0, OptimizationBase 5.10.0.

head-5136: detached b984e003fe3202b424625b05437df3bdadc49d62 (pr/5136), process exit 0, 144.9 s.

git -C ModelingToolkit.jl checkout --detach pr/5136
REVIEW_CASES='5136' \
JULIA_DEPOT_PATH="$PWD/depot:" JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 \
TMPDIR="$PWD/tmp" JULIA_NUM_PRECOMPILE_TASKS=1 JULIA_PKG_PRECOMPILE_AUTO=0 \
timeout 3600 julia --startup-file=no --compiled-modules=existing --depwarn=yes tmp/rerun/driver.jl

Resolved versions: SymbolicUtils 4.54.0, Symbolics 7.47.0, SciMLBase 3.58.0, JumpProcesses 9.33.1, NonlinearSolve 4.32.0, ModelingToolkit 11.45.4, ModelingToolkitTearing 1.20.7, ModelingToolkitBase 1.77.4, OptimizationBase 5.10.0.

Included the exact new lib/ModelingToolkitBase/test/array_dae_jacobian.jl. Origin/master first testset: 3 passes / 1 error; head with current dependencies: 8+3+2 = 13 passes, process exit 0. The base batch exits 1 for expected regressions. Read-only gh run view 39040830178 --repo SciML/ModelingToolkit.jl --json headSha,event,createdAt,conclusion,url confirms the failing downgrade run uses the exact reviewed b984e00 head.

Supported older dependency run head-5136-min: detached b984e003fe3202b424625b05437df3bdadc49d62, process exit 1, 261.82 s. The setup creates a fresh temporary environment, develops only the local MTKBase package, and requests Symbolics 7.45.0, SymbolicUtils 4.46.4, SciMLBase 3.55.0 and OrdinaryDiffEqBDF 2.0.0, plus the test imports. No package source is patched.

git -C ModelingToolkit.jl checkout --detach pr/5136
MIN_SCIMLBASE=3.55.0 REVIEW_CASES='5136' \
JULIA_DEPOT_PATH="$PWD/depot:" JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 \
TMPDIR="$PWD/tmp" JULIA_NUM_PRECOMPILE_TASKS=1 JULIA_PKG_PRECOMPILE_AUTO=0 \
timeout 3600 julia --startup-file=no --compiled-modules=existing tmp/rerun/setup-min.jl
MIN_SCIMLBASE=3.55.0 REVIEW_CASES='5136' \
JULIA_DEPOT_PATH="$PWD/depot:" JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 \
TMPDIR="$PWD/tmp" JULIA_NUM_PRECOMPILE_TASKS=1 JULIA_PKG_PRECOMPILE_AUTO=0 \
timeout 3600 julia --startup-file=no --compiled-modules=existing tmp/rerun/driver-min.jl

The same unchanged file passes its first 8+3 assertions, then the empty-array testset errors before either assertion. Output: BoundsError: attempt to access 0-element StepRange{Int64, Int64} at index [1]; CASE_FAIL 5136; FAILED_CASES=5136. The process exits 1. These key dependency versions match those printed in the same-head downgrade CI log.

What I did not verify

No whole suite, GPU, Reactant, MPI or exhaustive dependency-version matrix was run. Both the latest registered stack and the specifically supported older stack were executed. The first dependency release fixing empty-array scalarization was not identified; an implementation guard or independently verified lower-bound update is still needed. A clean native-precompile cycle was not verified: the initial batch dependency workload errored during NonlinearSolveFirstOrder AD-backend selection. The recorded test commands use existing caches and JIT-load uncached PR source; no assertion was disabled.

🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local session ID 01a099aa-308a-7fd3-91bd-9fb2dc357b91

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Grok <[email protected]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a19809-c5f9-7de3-9462-7ff4037e2554, reviewed head edca42b

  • Verdict: CHANGES
  • Risk: medium (M2: DAE residual derivatives and sparse prototypes change numerical behavior; the blind assessment was sealed before author context, and a fresh base-checkout run was not completed).
  • Round / slot: 3 / 1
  • Blocking priorities: P1, P2

Review written by the reviewer named above in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands.

Summary: The PR builds implicit DAE Jacobians and sparse prototypes from scalarized residuals. The targeted fixes pass their nonempty regressions, but an independent probe finds a wrong sparse in-place Jacobian and the added empty-array regression fails on supported dependencies.

Blast radius: Implicit DAEFunction/DAEProblem analytic Jacobians and sparse prototypes, including algebraic left-hand sides and array equations. These are peripheral to the rubric's mtkcompile/structural_simplify/System-construction main lanes.

Evidence: Julia 1.13.2 with Symbolics 7.45.0 and SymbolicUtils 4.46.4: head regressions 91 passed/1 error; independent probes 106 passed/6 failed. An in-process replay of the exact merge-base versions of all three changed existing methods gives 63 passed/5 failed/4 errors on the same regressions. The nonempty array, prototype-cancellation, and scalar additions fail in that replay and pass at head; the empty-array addition errors in both. This is method-replay evidence, not a fresh process loading the base checkout. GitHub reports no checks or workflow runs on the reviewed head. G1 has independent analytic references, but the sparse probe violates its accuracy expectation; G2's specialized GPU/AD-rule/Reactant/MPI paths and G3's shared-state changes are not introduced here.

Blocking findings

  1. [P1] Sparse in-place Jacobians misplace entries when a structural dependency differentiates to zero — confirmed by running. At lib/ModelingToolkitBase/src/problems/daeproblem.jl:97 the prototype now uses structural sparsity, while lib/ModelingToolkitBase/src/systems/codegen.jl:752 builds the analytic sparse matrix separately. For D(x) ~ -x and y ~ sin(x)^2 + cos(x)^2, the second residual is mathematically 1-y, so its x derivative is zero. With jac=true, sparse=true, u=[0.8,1.0], du=[0.4,0.0], and gamma=0.7, the in-place call returns [-1.7 0; -1 0] instead of [-1.7 0; 0 -1]. The structural prototype retains (2,1), but generated nonzero values omit that cancelled derivative: -1 is written into (2,1), and (2,2) is left unwritten. Both simplify settings fail for all three tested gamma values; dense and out-of-place calls pass. This silently supplies an incorrect, potentially singular Jacobian to the solver. Construct the generated sparse expression and prototype with exactly the same ordered coordinates, explicitly writing structural zeros, and add this analytic in-place/out-of-place comparison as a regression.
  2. [P2] The new empty-array regression errors within supported compatibility — confirmed by running. lib/ModelingToolkitBase/test/array_dae_jacobian.jl:46 throws BoundsError: attempt to access 0-element StepRange{Int64, Int64} at index [1] with Symbolics 7.45.0 / SymbolicUtils 4.46.4, both permitted by Project.toml. The call at lib/ModelingToolkitBase/src/systems/codegen.jl:735 enters full_equations, which calls scalarize_array_equations at lib/ModelingToolkitBase/src/utils.jl:216 before the new empty-residual guard can run. Expected behavior is a 3-by-3 Jacobian equal to -3I, with no row contributed by the empty equation. The same exception occurs with the restored base methods, so the underlying dependency limitation predates this patch, but this PR newly requires a regression that still fails. Skip zero-row equations before invoking equation scalarization, and preserve the new test on the supported dependency boundary.

Non-blocking findings

None.

What I ran

All work was read-only with respect to upstream and tracked source. Read RULES.md, TARGET.md, repository AGENTS.md and CONTRIBUTING.md, the complete diff and relevant callers. Wrote INITIAL.md and ran sha256sum INITIAL.md > INITIAL.sha256 before reading the PR body, linked issue, or commit body. No earlier same-head review was supplied or opened; the fetched PR body contained an older-head review section, which was not used as execution evidence.

Git and GitHub inspection commands (exit 0 unless noted):

gh pr view 5136 --repo SciML/ModelingToolkit.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid
git fetch origin +refs/pull/5136/head:refs/remotes/pr/5136 master
git checkout --detach pr/5136
git fetch origin +refs/heads/master:refs/remotes/origin/master
git rev-parse HEAD origin/master
git merge-base origin/master HEAD
git diff origin/master...HEAD
git diff --check origin/master...HEAD
gh pr view 5136 --repo SciML/ModelingToolkit.jl --json title,body,statusCheckRollup
gh issue view 5093 --repo SciML/ModelingToolkit.jl --json title,body
git log -1 --format=%B edca42bac4c0241498866c9996a5aeb3e581d38f
gh pr checks 5136 --repo SciML/ModelingToolkit.jl
gh run list --repo SciML/ModelingToolkit.jl --commit edca42bac4c0241498866c9996a5aeb3e581d38f --limit 20 --json databaseId,status,conclusion,url,name
gh run list --repo SciML/ModelingToolkit.jl --branch master --event push --limit 5 --json databaseId,status,conclusion,url,name,headSha

gh pr checks exited 1 with “no checks reported”; the head's run list was empty. The five recent master workflows were successful at 6613036, not the reviewed head. Inspected job metadata for Sublibrary CI and Downgrade; there were no failed head-job logs to compare. This does not establish head CI success.

Exactly three Julia processes, serially, using plain Julia 1.13.2 on aarch64. In the commands below SHARED_DEPOT denotes the supplied shared depot; path-valued settings are expressed symbolically:

JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:" JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia --startup-file=no --compiled-modules=existing --project=env probes/head_run.jl
JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:" JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia --startup-file=no --compiled-modules=existing --project=min-env probes/min_run.jl
JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:" JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia --startup-file=no --compiled-modules=existing --project=min-env probes/min_run.jl

The first process instantiated a temporary environment with Pkg.develop(path=...) and Pkg.instantiate(;allow_autoprecomp=false), but exited 1 before assertions: the reviewer wrapper tried to import a transitive dependency directly. The second process exited 1 before assertions because the reviewer's metadata repair placed that dependency under sources instead of deps. These are reviewer setup errors, not PR failures. The metadata was then repaired and checked with a TOML parser; no source tests had been executed or answered by either failed attempt.

The third process used Pkg.add([PackageSpec(name="Symbolics", version=v"7.45.0"), PackageSpec(name="SymbolicUtils", version=v"4.46.4")]) in the temporary environment and ran the entire added array test file plus the exact added scalar testset from lib/ModelingToolkitBase/test/dae_jacobian.jl:66. Dependency versions also included SciMLBase 3.58.0 and OrdinaryDiffEqBDF 2.4.14. It exited 1 with this output summary:

Head and baseline-method validation                    260 pass / 11 fail / 5 error
  head                                                 197 pass /  6 fail / 1 error
    PR regressions                                      91 pass /           1 error
      nonempty implicit array residuals                  8 pass
      cancelling state/derivative prototype              3 pass
      empty-array regression                                              1 error
      scalar addition                                   80 pass
    independent nonlinear matrix residual               88 pass
    independent cancellation/storage                    18 pass /  6 fail
  merge-base production methods replay                  63 pass /  5 fail / 4 error

The matrix probe uses the independent numeric residual vec(X.^2 .+ t .- X.*dX) with permuted unknown order, two states, dense/sparse and both simplify settings, and three gamma values. It compares generated residuals and Jacobians with the closed-form derivative and central differences of that numeric formula. The cancellation probe uses the analytic identity sin(x)^2+cos(x)^2=1.

For the baseline replay, archived commit 9082f85 using git archive, extracted the exact definitions of generate_dae_jacobian, jacobian_dae_sparsity and the changed DAEFunction method, then evaluated them inside the loaded package before including the same PR regressions. These are all existing production methods changed by the diff; the new head helpers remain defined but unused by the restored methods. The baseline nonempty-array test errors on the algebraic left-hand side in calculate_massmatrix; the prototype test finds zero stored entries instead of one; scalar sparsity checks omit a left-hand-side dependency. Their head counterparts pass. The newly added empty-array test fails before and after. The independent cancellation probe ran only at head.

What I did not verify

No fresh Julia process loaded the complete merge-base package; failing-before evidence is the explicitly described method replay. The full array test file does not pass at head because its empty-array test errors. No assertions ran with latest resolved Symbolics 7.48.0 / SymbolicUtils 4.54.0, and I did not test other supported dependency combinations or Julia versions. I did not run the pre-existing Sundials/IDA portion of dae_jacobian.jl, whole package suites, downstream suites, benchmarks, GPU execution, AD integrations, Reactant, MPI, or another platform. No new GPU kernel, framework AD rule, Reactant or MPI implementation is present in this diff. The three-process limit is exhausted; nothing was rerun after the final result.

🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-generated Filed by an AI agent needs-chris-review Bot-filed finding awaiting review by ChrisRackauckas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants