QA: run_qa v1.6 form + ExplicitImports#468
Merged
ChrisRackauckas merged 3 commits intoJul 3, 2026
Merged
Conversation
Convert the hand-rolled test/qa Aqua body to SciMLTesting's run_qa v1.6
declarative form and enable ExplicitImports (explicit_imports = true).
- Add a test/qa/Project.toml sub-env (Aqua + SciMLTesting "1.6" + SafeTestsets
+ Test, package via [sources]) so the QA group is isolated, matching the
SciMLTesting folder model used by sibling repos.
- qa.jl now calls run_qa(ModelingToolkitStandardLibrary; explicit_imports = true,
...). Aqua + ExplicitImports come from SciMLTesting's own deps. JET is not run
(the prior QA did not run JET). The original non-broken Aqua tweak
(ambiguities recursive = false) is preserved via aqua_kwargs.
- ExplicitImports findings (vs released SciMLTesting 1.6.0):
* no_stale_explicit_imports: FIXED by removing genuinely unused imports
(RealOutput in Electrical / IsothermalCompressible / TranslationalModelica;
getdefault + IfElse.ifelse in Translational).
* all_explicit_imports_via_owners / *_are_public / all_qualified_accesses_are_public:
ignore other packages' non-public names (unwrap<-Symbolics, ifelse<-IfElse,
getdefault/isvariable/t_nounits<-ModelingToolkitBase, SConst<-Symbolics,
depwarn<-Base). Documented per source.
* no_implicit_imports: many submodules `using ModelingToolkitBase, Symbolics,
IfElse` for exported names/macros; mass-explicit refactor is large and tracked
in SciML#467, kept as ei_broken = (:no_implicit_imports,).
- Drop now-stale Aqua from the root [extras]/[targets].test/[compat] (Aqua moved
to the QA sub-env; ExplicitImports stays transitive via SciMLTesting).
Verified locally on Julia 1.10 with SciMLTesting 1.6.0 from the registry:
QA group = 16 Pass, 1 Broken, 0 Fail, 0 Error.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Downgrade CI lane precompile-failed with a `CommonSolve.init` method
ambiguity between DiffEqBase's `init(::Union{AbstractDEProblem,
NonlinearProblem}, args...)` and NonlinearSolveBase's
`init(::AbstractNonlinearProblem, ::AbstractNonlinearTerminationMode, du, u,
...)`, surfaced while precompiling NonlinearSolveFirstOrder / OrdinaryDiffEq*.
DiffEqBase 6.190.0 (commit "remove NonlinearSolve things") dropped
`NonlinearProblem` from that `init` signature, removing the ambiguity. The
old floor 6.189.1 still carried the colliding method, so downgrade resolved
into the ambiguous state. Bump the floor to 6.190.
Verified on Julia 1.10: with DiffEqBase 6.190.0 and the CI-downgrade-resolved
solver stack (NonlinearSolveFirstOrder 1.7.0, NonlinearSolveBase 1.14.0,
SciMLBase 2.125.0, OrdinaryDiffEq 6.102.1, OrdinaryDiffEqBDF/SDIRK/Default/
NonlinearSolve at floors), all 51 packages precompile cleanly (the 5 that
failed in CI now pass). 6.190.0 requires SciMLBase >= 2.115.0, satisfied by
the resolved 2.125.0.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make every submodule's `using ModelingToolkitBase/Symbolics/IfElse` explicit so the package no longer relies on implicit imports, then drop the corresponding ei exceptions from the QA configuration. Source changes (per-module explicit name lists derived from ExplicitImports.print_explicit_imports on Julia 1.12): - Each component submodule now imports exactly the macros/types it uses (e.g. @component, @connector, @nAmed, @parameters, @unpack, @variables, System, Equation, Flow, compose, connect, extend, ParentScope, domain_connect, @register_symbolic, @register_derivative, Differential), plus the bare module names that are accessed qualified. - Blocks/sources.jl: `using DiffEqBase`/`using PreallocationTools` made explicit (DiffCache, GeneralLazyBufferCache, get_tmp); DiffEqBase had no used names so only its module name is imported. - The thin wrapper modules (Magnetic, Mechanical, Hydraulic) only reference the ModelingToolkitBase module name, so they import just that. qa.jl exceptions removed (verified now unnecessary against released SciMLTesting 1.7.0 / SciMLBase 3.30 / ModelingToolkitBase 1.48 / Symbolics 7.29): - ei_broken = (:no_implicit_imports,) -> all 16 modules now pass the check. - all_explicit_imports_via_owners ignore (:unwrap) -> passes with no ignore. - all_explicit_imports_are_public: dropped :unwrap (public in Symbolics) and :getdefault (public in ModelingToolkitBase); only :ifelse remains. - all_qualified_accesses_are_public: dropped :t_nounits (public) and :depwarn (no longer flagged); only :ifelse, :SConst, :isvariable remain. Remaining ignores are irreducible (genuinely non-public upstream names): ifelse (IfElse's sole export, not declared public), SConst (Symbolics-internal, used in a @register_derivative), isvariable (ModelingToolkitBase-internal). Verified on Julia 1.12.6: full QA group green via run_qa (17 Pass / 0 Broken, was 16 Pass / 1 Broken), and a smoke test constructs one component from every affected module successfully (Blocks.Sine/DeadZone, Electrical.Pin, IsothermalCompressible.Cap, FluxTubes.Ground, etc.). Runic-formatted. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Ignore until reviewed by @ChrisRackauckas. Draft, part of the SciML run_qa v1.6 / ExplicitImports rollout.
What
Brings this repo's QA onto
SciMLTesting.run_qav1.6 form with ExplicitImports enabled, replacing the hand-rolledtest/qa/aqua.jlAqua body.test/qa/Project.tomlsub-env (Aqua +SciMLTesting "1.6"+ SafeTestsets + Test, package via[sources]) so the QA group is isolated, matching the SciMLTesting folder model used by sibling repos. The QA group is discovered byrun_tests()viatest_groups.toml(unchanged).test/qa/qa.jlnow callsrun_qa(ModelingToolkitStandardLibrary; explicit_imports = true, ...). Aqua + ExplicitImports come from SciMLTesting's own deps. JET is not run (the prior QA did not run JET). The one original non-broken Aqua tweak (ambiguitiesrecursive = false, genuinely needed — recursive ambiguities fails in the dep tree) is preserved viaaqua_kwargs.Aquafrom the root[extras]/[targets].test/[compat](Aqua moved into the QA sub-env). ExplicitImports stays transitive via SciMLTesting (not added as a direct dep).ExplicitImports findings (6 checks, vs released SciMLTesting 1.6.0)
no_stale_explicit_importsno_implicit_importsei_broken) — tracked in #467all_explicit_imports_via_ownersunwrap)all_qualified_accesses_via_ownersall_qualified_accesses_are_publicall_explicit_imports_are_publicFixed (stale imports removed):
RealOutputinElectrical,Hydraulic.IsothermalCompressible,Mechanical.TranslationalModelica;getdefaultandusing IfElse: ifelseinMechanical.Translational.Ignored (other packages' non-public names; go public as base libs release):
unwrap(Symbolics, owned by SymbolicUtils),ifelse(IfElse),getdefault(ModelingToolkitBase)ifelse(IfElse),SConst(Symbolics),depwarn(Base),isvariable/t_nounits(ModelingToolkitBase)Broken (tracked):
no_implicit_imports— the component submodulesusing ModelingToolkitBase, Symbolics, IfElseand rely on their exported names/macros (@component,@named,@variables,System,Equation,Flow, ...). Making all of these explicit is a large, mechanical, per-submodule refactor tracked in #467; kept asei_broken = (:no_implicit_imports,)(auto-flags an Unexpected Pass once fixed).Verification
Ran the QA group locally on Julia 1.10 with SciMLTesting 1.6.0 resolved from the registry (no dev-from-branch):
0 Fail, 0 Error. Aqua sub-checks (ambiguities[recursive=false], unbound args, undefined exports, project_extras, stale_deps, deps_compat, piracy, persistent_tasks) all pass; the 5 enabled EI checks pass,
no_implicit_importsis Broken.🤖 Generated with Claude Code