Mark ModelingToolkit's ModelingToolkitBase piracies as allowed - #4861
Merged
ChrisRackauckas merged 1 commit intoAug 2, 2026
Merged
Conversation
ModelingToolkit is the upper half of ModelingToolkitBase: the two are one library split across a monorepo boundary, so the methods ModelingToolkit adds to `System`, `Sample`, `SampleTime`, `Hold` and `ShiftIndex` are extensions of the pair's own API rather than piracy. Pass those types to Aqua via `treat_as_own`, along with `TearingState` and `DiffGraph` for the forwarding shims that wire the structural-transformation stack to ModelingToolkitBase's hooks. This takes Aqua's piracy check from 35 reported methods to zero. No other QA check changes. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ywCW8vbGoc9X3dUbmXyme
ChrisRackauckas
marked this pull request as ready for review
August 2, 2026 11:44
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.
Summary
Marks the methods ModelingToolkit defines on ModelingToolkitBase's types as allowed in Aqua's piracy check, taking
Aqua.test_piracies(ModelingToolkit)from 35 reported methods to zero.ModelingToolkit is the upper half of ModelingToolkitBase: the two are one library split across a monorepo boundary, with the compilation and problem-construction layer here dispatching on the system and operator types defined below it. Those methods are extensions of the pair's own API, not piracy.
Passed to Aqua via
treat_as_own:System,Sample,SampleTime,Hold,ShiftIndex(all exported by ModelingToolkitBase). These account for 33 of the 35.ModelingToolkitTearing.TearingStateandStateSelection.DiffGraph, covering the two one-line forwarding shims that wire the structural-transformation stack to ModelingToolkitBase's hooks (MTKBase.complete(::DiffGraph)insrc/ModelingToolkit.jlandMTKBase.singular_check(::TearingState)insrc/initialization.jl).The change is purely additive: 34 lines across
test/qa/qa.jlandtest/qa/Project.toml, no deletions, no existing check weakened or skipped.Verification
Run locally on Julia 1.11 in an isolated depot, comparing this branch against its merge base (
b3ff68bf3):Exactly one check changes, in the right direction. Confirmed both by running
test/qa/qa.jldirectly and through the real harness (GROUP=QA julia --project -e 'using Pkg; Pkg.test()'), which also exercises the newtest/qa/Project.tomldeps and theModelingToolkitBase[sources]entry viaactivate_group_env:Runic reports both changed files already formatted.
Notes
master— the 6 ExplicitImports errors, the JET failure and the public-reexports failure all reproduce on an unmodifiedmastercheckout. This PR does not address those; it only removes the piracy failure from the pile.ModelingToolkitTearing.TearingStateis neither exported nor declaredpublicin ModelingToolkitTearing, so it has to be reached by qualified access here.src/ModelingToolkit.jlalready imports it that way, so this is not a new dependency on a non-public name, but promoting it to public API in ModelingToolkitTearing would be the cleaner fix.Please ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code
https://claude.ai/code/session_019ywCW8vbGoc9X3dUbmXyme