Repository navigation
CHECKPOINT: preserve array DEs through mtkcompile (ArrayEquationGroup / not skip-tearing) - #5102
Draft
ChrisRackauckas-Claude wants to merge 5 commits into
Draft
ChrisRackauckas-Claude wants to merge 5 commits into
ChrisRackauckas-Claude wants to merge 5 commits into
Conversation
Propagate ModelingToolkitTearing's array equation groups through alias elimination and brownian handling, and make map_variables_to_equations understand preserved array equations. Co-authored-by: Cursor <cursoragent@cursor.com>
…and docs - `mtkcompile(sys; preserve_array_equations = true)` emits intact array differential equations as single equations over scalar unknowns. - `build_function_wrapper` rewrites `array_literal`s of consecutive buffer elements into `vcat`s of `view`s so generated code for preserved array equations does not grow with the array size. - Alias elimination keeps array-equation rows out of the integer-linear elimination instead of restoring them afterwards. - Document the design in the mtkcompile internals page; bump MTKTearing compat to 1.21. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Sep 9, 2026
The status notes belong in the PR description, not in the built docs. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
Fable tearing agent hit the usage limit mid-flight. Branches are pushed; treat this draft + JuliaComputing/StateSelection.jl#158 as the hard-path checkpoint. Latest local note: checkpoint markdown was moved out of the docs tree ( |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checkpoint (usage running out)
Draft / partial. Full status writeup also in-tree:
docs/src/internals/ARRAY_EQUATIONS_CHECKPOINT.md.Opened to save progress before agent usage hits the limit. Do not merge until StateSelection/MTKTearing companion lands and CI is green.
Related
preserve_array_equations, docs, structural tests, codegen helpersmtkt-array-equation-groups(draft, same session)ArrayEquationGroupin ModelingToolkitTearingcomplete→ODEProblemfor array DEs (codegen; no mtkcompile) — first useful slicescalarize_arrays=false/ skip tearing rejected as non-useful intermediateGoal (from Chris)
ODEProblemshould build (prefercompletepath first) — BuildODEProblemfrom array differential equations withcompleteonly #5101.What is done
Design (not skip-tearing)
ArrayEquationGroup; dirty when a pass breaks representability.mtkcompile(...; preserve_array_equations=true).mtkcompilebehavior unchanged.Code in this branch
preserve_array_equationskeyword / reassemble wiringdocs/src/internals/mtkcompile.md+ARRAY_EQUATIONS_CHECKPOINT.mdtest/structural_transformation/array_equations.jlis_intact_array_group_rowLocal: MTKTearing tests Pass; sample MTK structural/codegen/init tests Pass after env deps fixed.
What is required next
mtkcompile? (Structural simplify is still O(N) in graph size today even when codegen can be O(1).)mtkcompile(sys; preserve_array_equations=true)→ODEProblem/DAEProblem, Expr node count independent ofn(compose with BuildODEProblemfrom array differential equations withcompleteonly #5101).expand_array_derivatives!unrolling).scalarize_arrays=falsedocs.Explicitly rejected
mtkcompile(; scalarize_arrays=false)/ tearing-free compiler as the solution (#5100).How to verify (once MTKTearing companion is developed)
Also see #5101 for
complete(sys)→ODEProblemwithout mtkcompile.Made with Cursor