Skip to content

QA: run_qa v1.6 form + ExplicitImports#319

Merged
ChrisRackauckas merged 4 commits into
SciML:masterfrom
ChrisRackauckas-Claude:qa-run_qa-v1.6-explicit-imports
Jul 2, 2026
Merged

QA: run_qa v1.6 form + ExplicitImports#319
ChrisRackauckas merged 4 commits into
SciML:masterfrom
ChrisRackauckas-Claude:qa-run_qa-v1.6-explicit-imports

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Please ignore until reviewed by @ChrisRackauckas.

Converts test/qa/qa.jl from a hand-rolled Aqua testset to SciMLTesting's run_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: add SciMLTesting (compat "1.6"). ExplicitImports is transitive via SciMLTesting. Aqua and JET stay 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.jl runs curated @test_opt constructor type-stability checks (passing: 15/15 on Julia 1.12; @test_broken JET-skip on the LTS, preserved). run_qa's JET is JET.test_package (package-wide error analysis), a different and broader check that @test_opt does not subsume. So run_qa keeps JET off (jet = false) and the bespoke @test_opt checks stay in jet_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:179 calls setindex(u, ...) for a StaticArraysCore.SArray but setindex is not defined/imported (StaticArraysCore doesn't provide the immutable setter; StaticArrays isn't a dep). This path (PositiveDomain with 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: added SciMLBase.DiscreteProblem to the explicit imports (was implicit).
  • no_stale_explicit_imports: dropped 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. None are exported by DiffEqCallbacks.
  • all_qualified_accesses_via_owners: changed SciMLBase.copyto! → bare copyto! in manifold.jl (copyto! is Base's, already imported from LinearAlgebra). Verified the manifold-projection path end-to-end (Core manifold_tests 25/25).

Ignored via ei_kwargs (documented, with source pkg):

  • no_stale_explicit_imports ignores derivative_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_public ignores other-package non-public names accessed qualified: SciMLBase internals (AbstractDEProblem, AbstractODEIntegrator, INITIALIZE_DEFAULT, _unwrap_val, alg_order, isadaptive, numargs, successful_retcode), SciMLBase.ReturnCode values (Success, ConvergenceFailure, InitialFailure), LinearAlgebra (QRCompactWY), Base (RefValue, depwarn), Base.Iterators (reverse). The successful_retcode / ReturnCode.* / Iterators.reverse group is public on Julia 1.11+ but flagged on the LTS (1.10, no public keyword), so the ignores cover the union of both QA lanes.
  • all_explicit_imports_are_public ignores DiffEqBase internals get_tstops, get_tstops_array, get_tstops_max.

Local verification (released SciMLTesting 1.6.0)

QA group (GROUP=QA, Pkg.test):

  • Julia 1.12 ("1" lane): QA/jet_tests.jl 15/15 pass; QA/qa.jl 17/17 pass (Aqua 11 + ExplicitImports 6).
  • Julia 1.10 (lts lane): QA/jet_tests.jl 1 broken (JET-skip-on-LTS, preserved); QA/qa.jl 17/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

ChrisRackauckas and others added 3 commits June 26, 2026 23:56
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>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the qa-run_qa-v1.6-explicit-imports branch from 5912a28 to c0d327d Compare June 27, 2026 04:00
@ChrisRackauckas-Claude ChrisRackauckas-Claude marked this pull request as ready for review June 29, 2026 09:51
… 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>
@ChrisRackauckas ChrisRackauckas merged commit 043aaa6 into SciML:master Jul 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants