From 27621678d3111af9a31ec509e4114b17b84817f0 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Thu, 25 Jun 2026 06:34:31 -0400 Subject: [PATCH 1/2] QA: run_qa v1.6 form + ExplicitImports Convert the hand-rolled QA (test/qa.jl raw Aqua sub-checks + test/explicit_imports.jl raw ExplicitImports) onto SciMLTesting 1.6.0 `run_qa`, moved into a dedicated `qa` group sub-env (test/qa/) per the folder model, with ExplicitImports enabled. - test/qa/qa.jl: run_qa(PreallocationTools; explicit_imports = true, aqua_kwargs = (; ambiguities = (; recursive = false))) preserving the non-default `test_ambiguities(recursive = false)` tweak. Aqua now runs the full test_all (was a manual 7-check subset) and all checks pass. - ExplicitImports: 5/6 checks pass clean. all_qualified_accesses_are_public flags qualified accesses to non-public names of other packages (Base.depwarn, ArrayInterface.parameterless_type, ArrayInterface.restructure); ignored via ei_kwargs (documented per source pkg). No stale/implicit-import findings, no broken markers, no JET. - test/qa/Project.toml: QA sub-env (PreallocationTools via [sources], Aqua kept for the ambiguities child-proc, SciMLTesting "1.6", Test, SafeTestsets). ExplicitImports dropped (transitive via SciMLTesting). - runtests.jl: move QA out of `core` into the `qa` group; test_groups.toml adds [QA] (lts, 1). - root Project.toml: drop Aqua + ExplicitImports from [compat]/[extras]/ [targets].test (now QA-sub-env-only). Verified locally vs released SciMLTesting 1.6.0 (no dev-from-branch): QA group 17/17 pass, 0 fail/error/broken on Julia 1.10/1.11/1.12, and the full GROUP=QA harness path (Pkg.test) passes. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 6 +----- test/explicit_imports.jl | 8 -------- test/qa.jl | 11 ----------- test/qa/Project.toml | 16 ++++++++++++++++ test/qa/qa.jl | 18 ++++++++++++++++++ test/runtests.jl | 6 ++++-- test/test_groups.toml | 3 +++ 7 files changed, 42 insertions(+), 26 deletions(-) delete mode 100644 test/explicit_imports.jl delete mode 100644 test/qa.jl create mode 100644 test/qa/Project.toml create mode 100644 test/qa/qa.jl diff --git a/Project.toml b/Project.toml index 205b9a7..92d6497 100644 --- a/Project.toml +++ b/Project.toml @@ -21,9 +21,7 @@ PreallocationToolsSparseConnectivityTracerExt = "SparseConnectivityTracer" [compat] ADTypes = "1.16" Adapt = "4.3.0" -Aqua = "0.8.11" ArrayInterface = "7.19.0" -ExplicitImports = "1.14.0" ForwardDiff = "0.10.38, 1.0.1" LabelledArrays = "1.16.0" LinearAlgebra = "1.10" @@ -46,8 +44,6 @@ julia = "1.10" [extras] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -67,4 +63,4 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "ADTypes", "ExplicitImports", "ForwardDiff", "Random", "LabelledArrays", "LinearAlgebra", "OrdinaryDiffEq", "OrdinaryDiffEqSDIRK", "SciMLBase", "SciMLTesting", "Test", "RecursiveArrayTools", "SafeTestsets", "Optimization", "OptimizationOptimJL", "SparseArrays", "Symbolics", "SparseConnectivityTracer"] +test = ["ADTypes", "ForwardDiff", "Random", "LabelledArrays", "LinearAlgebra", "OrdinaryDiffEq", "OrdinaryDiffEqSDIRK", "SciMLBase", "SciMLTesting", "Test", "RecursiveArrayTools", "SafeTestsets", "Optimization", "OptimizationOptimJL", "SparseArrays", "Symbolics", "SparseConnectivityTracer"] diff --git a/test/explicit_imports.jl b/test/explicit_imports.jl deleted file mode 100644 index 74b6e04..0000000 --- a/test/explicit_imports.jl +++ /dev/null @@ -1,8 +0,0 @@ -using ExplicitImports -using PreallocationTools -using Test - -@testset "Explicit Imports" begin - @test check_no_implicit_imports(PreallocationTools) === nothing - @test check_no_stale_explicit_imports(PreallocationTools) === nothing -end diff --git a/test/qa.jl b/test/qa.jl deleted file mode 100644 index 1988fbf..0000000 --- a/test/qa.jl +++ /dev/null @@ -1,11 +0,0 @@ -using PreallocationTools, Aqua -@testset "Aqua" begin - Aqua.find_persistent_tasks_deps(PreallocationTools) - Aqua.test_ambiguities(PreallocationTools, recursive = false) - Aqua.test_deps_compat(PreallocationTools) - Aqua.test_piracies(PreallocationTools) - Aqua.test_project_extras(PreallocationTools) - Aqua.test_stale_deps(PreallocationTools) - Aqua.test_unbound_args(PreallocationTools) - Aqua.test_undefined_exports(PreallocationTools) -end diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..1dcbb93 --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,16 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +PreallocationTools = {path = "../.."} + +[compat] +Aqua = "0.8.11" +SafeTestsets = "0.1, 1" +SciMLTesting = "1.6" +Test = "1.10" +julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..8cf9a0d --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,18 @@ +using SciMLTesting, PreallocationTools, Test + +run_qa( + PreallocationTools; + explicit_imports = true, + aqua_kwargs = (; ambiguities = (; recursive = false)), + ei_kwargs = (; + # Qualified accesses to non-public names of other packages. These go public + # as the base libraries declare them so; ignore until then. + all_qualified_accesses_are_public = (; + ignore = ( + :depwarn, # Base.depwarn + :parameterless_type, # ArrayInterface.parameterless_type + :restructure, # ArrayInterface.restructure + ), + ), + ), +) diff --git a/test/runtests.jl b/test/runtests.jl index 783c149..a2dffd2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,8 +3,6 @@ using SciMLTesting run_tests(; core = () -> begin - @safetestset "Quality Assurance" include("qa.jl") - @safetestset "Explicit Imports" include("explicit_imports.jl") @safetestset "DiffCache Dispatch" include("core_dispatch.jl") @safetestset "DiffCache ODE tests" include("core_odes.jl") @safetestset "DiffCache Resizing" include("core_resizing.jl") @@ -16,6 +14,10 @@ run_tests(; @safetestset "Zero, Copy, and Fill Dispatches" include("test_zero_copy.jl") @safetestset "Allocation Regression Tests" include("alloc_tests.jl") end, + qa = (; + env = joinpath(@__DIR__, "qa"), + body = joinpath(@__DIR__, "qa", "qa.jl") + ), groups = Dict( # GPU declares its own sub-env, so it runs ONLY for GROUP="GPU" and is # excluded from "All" (matches the original `if GROUP == "GPU"` dispatch). diff --git a/test/test_groups.toml b/test/test_groups.toml index 79352ec..c7ec044 100644 --- a/test/test_groups.toml +++ b/test/test_groups.toml @@ -1,3 +1,6 @@ [Core] versions = ["lts", "1", "pre"] os = ["ubuntu-latest", "macos-latest", "windows-latest"] + +[QA] +versions = ["lts", "1"] From 445845d6d49dbfaaa7542b303d637234baab96ea Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 25 Jun 2026 10:53:56 -0400 Subject: [PATCH 2/2] QA: ignore extension EI findings on lanes where weakdeps are loaded When QA runs alongside Core (e.g. the Windows lanes have no dedicated QA lane, so run_tests folds QA into the Core run), the core safetestsets have already loaded ForwardDiff and SparseConnectivityTracer into the session. ExplicitImports then analyzes the loaded extension modules, surfacing three findings that the dedicated ubuntu QA lane never saw (its qa env has no weakdeps, so the extensions stay unloaded): - no_implicit_imports: PreallocationToolsForwardDiffExt's `using` of its parent + weakdeps (used qualified). - all_qualified_accesses_are_public: the ext extends PreallocationTools' own non-exported internals across the package/extension boundary and uses non-public-but-stable ForwardDiff names. - all_explicit_imports_are_public: PreallocationToolsSparseConnectivity- TracerExt imports the non-public AbstractTracer/Dual. Extend the ei_kwargs ignore lists (each name documented with its source package) so these legitimate extension-module uses are accepted. Verified 17/17 QA on Julia 1.10/1.11/1.12 with the extensions loaded and on the dedicated QA env with them absent, against released SciMLTesting 1.6.0. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- test/qa/qa.jl | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 8cf9a0d..60ec209 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -5,13 +5,42 @@ run_qa( explicit_imports = true, aqua_kwargs = (; ambiguities = (; recursive = false)), ei_kwargs = (; - # Qualified accesses to non-public names of other packages. These go public - # as the base libraries declare them so; ignore until then. + # The package extensions load (and are analyzed by ExplicitImports) whenever + # their weakdeps are present in the session, e.g. on the OS lanes where QA runs + # alongside Core. The entries below cover the extension modules' legitimate uses. + no_implicit_imports = (; + ignore = ( + :PreallocationTools, # extension parent package (used qualified) + :ForwardDiff, # weakdep ForwardDiff (used qualified) + :Adapt, # Adapt (extension dependency) + :ArrayInterface, # ArrayInterface (extension dependency) + :PrecompileTools, # PrecompileTools (extension dependency) + Symbol("@compile_workload"), # PrecompileTools macro + Symbol("@setup_workload"), # PrecompileTools macro + ), + ), + # Qualified accesses to non-public names. The package's own internals are + # extended across the package/extension boundary, and the base libraries' + # names are de-facto stable; ignore until they are declared public. all_qualified_accesses_are_public = (; ignore = ( - :depwarn, # Base.depwarn - :parameterless_type, # ArrayInterface.parameterless_type - :restructure, # ArrayInterface.restructure + :depwarn, # Base.depwarn + :parameterless_type, # ArrayInterface.parameterless_type + :restructure, # ArrayInterface.restructure + :_restructure, # PreallocationTools internal (extended in ext) + :chunksize, # PreallocationTools internal (extended in ext) + :dualarraycreator, # PreallocationTools internal (extended in ext) + :enlargediffcache!, # PreallocationTools internal (extended in ext) + :forwarddiff_compat_chunk_size, # PreallocationTools internal (extended in ext) + :Dual, # ForwardDiff.Dual (non-public, stable) + :pickchunksize, # ForwardDiff.pickchunksize (non-public, stable) + ), + ), + # Explicit imports of non-public names from SparseConnectivityTracer. + all_explicit_imports_are_public = (; + ignore = ( + :AbstractTracer, # SparseConnectivityTracer.AbstractTracer (non-public) + :Dual, # SparseConnectivityTracer.Dual (non-public) ), ), ),