QA: run_qa v1.6 form + ExplicitImports#319
Merged
ChrisRackauckas merged 4 commits intoJul 2, 2026
Merged
Conversation
Convert test/qa/qa.jl from a hand-rolled Aqua testset to SciMLTesting's run_qa (v1.6) with ExplicitImports enabled. The bespoke JET `@test_opt` constructor type-stability checks stay in test/qa/jet_tests.jl (run_qa's `JET.test_package` error analysis does not subsume them); run_qa keeps its JET off via `jet = false` so loading JET in jet_tests.jl does not auto-enable it. ExplicitImports findings resolved: - no_implicit_imports: add SciMLBase.DiscreteProblem to the explicit imports (was used implicitly). - no_stale_explicit_imports: drop genuinely-unused imports NonlinearLeastSquaresProblem, init, reinit!, solve! (SciMLBase) and ldiv! (LinearAlgebra) — each was only ever accessed in qualified/extended form (SciMLBase.reinit! etc.) or not at all. derivative_discontinuity! is kept and ignored: it is imported inside the @static-if SciMLBase v2/v3 rename shim and used bare on v3, which the static scan cannot see through. - all_qualified_accesses_via_owners: change SciMLBase.copyto! to bare copyto! in the manifold projection (copyto! is Base's, already imported from LinearAlgebra). - Remaining other-package non-public qualified accesses / explicit imports ignored via ei_kwargs (SciMLBase / LinearAlgebra / Base / DiffEqBase internals; several are `public` on 1.11+ but flagged on the LTS). test/qa/Project.toml: add SciMLTesting (compat "1.6"); ExplicitImports comes transitively via SciMLTesting; Aqua and JET stay direct deps (Aqua's ambiguities child-proc and the bespoke JET check need them). Verified locally against released SciMLTesting 1.6.0: QA group green on both lanes (Julia 1.12: jet_tests 15/15, qa.jl 17/17; Julia 1.10 LTS: jet_tests 1 broken [JET-skip-on-LTS, preserved], qa.jl 17/17). Full Core lane green on 1.12 (manifold 25/25, domain 19/19, terminatesteadystate 11/11). Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… base libs)
SciMLTesting 1.7.0 runs the two public-API ExplicitImports checks
(check_all_qualified_accesses_are_public / check_all_explicit_imports_are_public)
only on Julia >= 1.11 and skips them on the LTS, and SciMLBase 3.24.0 made
several formerly-internal names public. With those released, the per-name
public-API ignore-lists in test/qa/qa.jl are largely redundant.
Drop the entries that are now public on the registered releases (verified on
Julia 1.12 against SciMLBase 3.24.0):
- all_qualified_accesses_are_public: remove numargs, successful_retcode,
Success, ConvergenceFailure, InitialFailure (SciMLBase), depwarn (Base),
reverse (Base.Iterators).
Keep only what the public checks still flag against the registered releases:
- all_qualified_accesses_are_public: AbstractDEProblem, AbstractODEIntegrator,
INITIALIZE_DEFAULT, _unwrap_val, alg_order, isadaptive (SciMLBase 3.24.0,
still non-public), QRCompactWY (LinearAlgebra), RefValue (Base).
- all_explicit_imports_are_public: get_tstops, get_tstops_array,
get_tstops_max (DiffEqBase 7.5.7, still non-public).
The no_stale_explicit_imports ignore (derivative_discontinuity!) is unchanged.
qa/Project.toml needs no compat change: SciMLTesting="1.6" already admits 1.7,
and the base-lib floors transitively admit the released versions.
Verified locally against registered releases (SciMLTesting 1.7.0, SciMLBase
3.24.0, DiffEqBase 7.5.7, ExplicitImports 1.15.0):
- Julia 1.12 (public checks run): QA group 32/32 pass.
- Julia 1.10 LTS (public checks skipped): QA group 15 pass + 1 broken
(pre-existing JET-skip-on-LTS marker), 0 fail.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ignores DiffEqBase 7.6.0 / SciMLBase 3.27.0 make the previously-internal names public, so the public-API ExplicitImports ignores can be trimmed and the qualified-access callers pointed at the owning module (SciMLBase): - src: rewrite `DiffEqBase.isinplace/addsteps!/get_du!/DiscreteProblem` (all SciMLBase-owned, now public, identity-equal re-exports) to `SciMLBase.X`; drop the now-unused `DiffEqBase` module self-binding from the import (only the DiffEqBase-own `get_tstops*` are still used bare); fix the PresetTimeCallback docstring to `SciMLBase.INITIALIZE_DEFAULT`. - qa.jl: empty `all_explicit_imports_are_public` (get_tstops* now public in DiffEqBase 7.6.0) and drop `AbstractDEProblem/alg_order/isadaptive` from `all_qualified_accesses_are_public` (now public in SciMLBase 3.27.0). Survivors kept (verified still non-public on Julia 1.12 / SciMLBase 3.27.0, DiffEqBase 7.6.0, stdlib): AbstractODEIntegrator, INITIALIZE_DEFAULT, _unwrap_val (SciMLBase), QRCompactWY (LinearAlgebra), RefValue (Base). Verified: QA group 17/17 on Julia 1.12 (public-API checks run), 15/15 on Julia 1.10 (public-API checks gated off by SciMLTesting 1.7); 0 fail/error. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5912a28 to
c0d327d
Compare
… stdlib internals ExplicitImports exceptions in test/qa/qa.jl reduced from 6 to 2 by fixing the root cause instead of ignoring: - derivative_discontinuity! (no_stale_explicit_imports ignore): the v2/v3 rename shim used `using SciMLBase: derivative_discontinuity!` on one branch and a `const ... = SciMLBase.u_modified!` on the other, which EI flagged as a stale import. Replaced with a single `const` bound to whichever public name the loaded SciMLBase provides; behavior is identical on both v2 (u_modified!) and v3 (derivative_discontinuity!), both of which are public. Drops the ignore. - AbstractODEIntegrator (all_qualified_accesses_are_public ignore): now public in SciMLBase 3.30.0 and already accessed via the public owner SciMLBase; ignore is redundant and dropped. - INITIALIZE_DEFAULT: defined a local no-op `INITIALIZE_DEFAULT(cb,u,t,integrator) = derivative_discontinuity!(integrator, false)` matching SciMLBase's non-public const (no identity comparison exists for it anywhere in SciMLBase/DiffEqBase/ OrdinaryDiffEqCore, so a local binding is behavior-preserving) and use it as the PresetTimeCallback default. Drops the ignore. - _unwrap_val: defined a local `_unwrap_val` (the leading-underscore SciMLBase internal that will not be made public) reproducing its exact behavior, used in manifold.jl. Drops the ignore. Remaining 2 ignores are genuinely-irreducible concrete stdlib internal types with no public spelling: LinearAlgebra.QRCompactWY (dispatch target of fact_successful) and Base.RefValue (concrete Ref type in a parametric NamedTuple alias). No new direct deps: all migrations went to local definitions or to already-imported public SciMLBase API. Verified on Julia 1.12 / SciMLBase 3.30.0 / SciMLTesting 1.7.0: QA group 17/17 pass; print_explicit_imports reports only the 2 stdlib internals. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.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.
Please ignore until reviewed by @ChrisRackauckas.
Converts
test/qa/qa.jlfrom a hand-rolled Aqua testset to SciMLTesting'srun_qa(v1.6 form) with ExplicitImports enabled. Verified locally against the released SciMLTesting 1.6.0 (Pkg resolves it; no dev-from-branch).What changed
test/qa/qa.jl:run_qa(DiffEqCallbacks; explicit_imports = true, jet = false, ei_kwargs = ...).test/qa/Project.toml: addSciMLTesting(compat"1.6").ExplicitImportsis transitive via SciMLTesting.AquaandJETstay direct deps (Aqua's ambiguities child-proc and the bespoke JET check below need them).src/: two small fixes that resolve EI findings at the source (preference FIX > IGNORE > BROKEN).JET
The pre-existing
test/qa/jet_tests.jlruns curated@test_optconstructor type-stability checks (passing: 15/15 on Julia 1.12;@test_brokenJET-skip on the LTS, preserved).run_qa's JET isJET.test_package(package-wide error analysis), a different and broader check that@test_optdoes not subsume. Sorun_qakeeps JET off (jet = false) and the bespoke@test_optchecks stay injet_tests.jl. This avoids re-redding the lane while preserving the existing curated coverage.Note:
JET.report_package(DiffEqCallbacks; target_modules=(DiffEqCallbacks,))surfaces pre-existing reports, the most notable being a genuine latent bug —src/domain.jl:179callssetindex(u, ...)for aStaticArraysCore.SArraybutsetindexis not defined/imported (StaticArraysCore doesn't provide the immutable setter; StaticArrays isn't a dep). This path (PositiveDomainwith a static-array state containing a negative entry) is not covered by the Core suite. It is out of scope for this QA-form PR and is left untouched here; flagging for a follow-up.ExplicitImports findings
All 6 checks run green (or are ignored with documented reasons). GOAL: 0 hard FAILs — met.
Fixed in source:
no_implicit_imports: addedSciMLBase.DiscreteProblemto the explicit imports (was implicit).no_stale_explicit_imports: dropped genuinely-unused importsNonlinearLeastSquaresProblem,init,reinit!,solve!(SciMLBase) andldiv!(LinearAlgebra) — each was only ever accessed in qualified/extended form (SciMLBase.reinit!etc.) or not at all. None are exported by DiffEqCallbacks.all_qualified_accesses_via_owners: changedSciMLBase.copyto!→ barecopyto!inmanifold.jl(copyto!is Base's, already imported from LinearAlgebra). Verified the manifold-projection path end-to-end (Coremanifold_tests25/25).Ignored via
ei_kwargs(documented, with source pkg):no_stale_explicit_importsignoresderivative_discontinuity!: imported inside the@static if isdefined(SciMLBase, :derivative_discontinuity!)v2/v3 rename shim and used bare on v3; the static scan can't see through the dual binding.all_qualified_accesses_are_publicignores other-package non-public names accessed qualified: SciMLBase internals (AbstractDEProblem,AbstractODEIntegrator,INITIALIZE_DEFAULT,_unwrap_val,alg_order,isadaptive,numargs,successful_retcode),SciMLBase.ReturnCodevalues (Success,ConvergenceFailure,InitialFailure), LinearAlgebra (QRCompactWY), Base (RefValue,depwarn), Base.Iterators (reverse). Thesuccessful_retcode/ReturnCode.*/Iterators.reversegroup ispublicon Julia 1.11+ but flagged on the LTS (1.10, nopublickeyword), so the ignores cover the union of both QA lanes.all_explicit_imports_are_publicignores DiffEqBase internalsget_tstops,get_tstops_array,get_tstops_max.Local verification (released SciMLTesting 1.6.0)
QA group (
GROUP=QA,Pkg.test):QA/jet_tests.jl15/15 pass;QA/qa.jl17/17 pass (Aqua 11 + ExplicitImports 6).QA/jet_tests.jl1 broken (JET-skip-on-LTS, preserved);QA/qa.jl17/17 pass.Core lane (
GROUP=Core, Julia 1.12): green (manifold 25/25, domain 19/19, terminatesteadystate 11/11, all others pass).Runic applied to changed
.jl.🤖 Generated with Claude Code