From 4a2ba6070166afd2c2170316a4eb8da149d5e472 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Thu, 25 Jun 2026 07:03:30 -0400 Subject: [PATCH] QA: run_qa v1.6 form + ExplicitImports Convert the hand-rolled Aqua/JET QA group onto SciMLTesting 1.6's `run_qa`, enabling the six ExplicitImports checks. - Replace the manual `Aqua.test_*` sub-check block and the `JET.report_package` testset with a single `run_qa(SurrogatesBase; explicit_imports = true)`. This runs `Aqua.test_all`, `JET.test_package` (with `target_modules = (pkg,)`, which removes the need for the old `ignored_modules` workaround on the package-level analysis) and all six ExplicitImports checks. All pass: the module has zero imports, so the EI checks are clean (no ei_kwargs / ei_broken needed), and Aqua/JET have no broken sub-checks. - Preserve the bespoke `JET.report_call` type-stability testsets that analyse concrete user-defined surrogate subtypes; this is value-add beyond `run_qa`'s package-level JET. These genuinely still need the `ignored_modules = (LinearAlgebra, Base)` config to filter the `norm_recursive_check` stdlib false positives on Julia 1.12+ (verified locally: removing it produces 2 spurious reports on 1.12). - Bump SciMLTesting compat floor to "1.6" (root + test/qa). Aqua stays a direct QA dep because `test_all`'s ambiguities child process needs it. Verified locally vs released SciMLTesting 1.6.0: lts (1.10, JET 0.9.18): Quality Assurance 18/18, report_call 4/4 1 (1.12, JET 0.11.5): Quality Assurance 18/18, report_call 4/4 0 FAIL / 0 ERROR / 0 BROKEN. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 2 +- test/qa/Project.toml | 2 +- test/qa/qa.jl | 34 ++++++++++------------------------ 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/Project.toml b/Project.toml index 50e6a22..5f30c1e 100644 --- a/Project.toml +++ b/Project.toml @@ -9,7 +9,7 @@ Aqua = "0.8" JET = "0.9, 0.10, 0.11" LinearAlgebra = "1.10" SafeTestsets = "0.1" -SciMLTesting = "1" +SciMLTesting = "1.6" Statistics = "1.10" Test = "1.10" julia = "1.10" diff --git a/test/qa/Project.toml b/test/qa/Project.toml index 5137764..11dcdf2 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -16,7 +16,7 @@ Aqua = "0.8" JET = "0.9, 0.10, 0.11" LinearAlgebra = "1.10" SafeTestsets = "0.1" -SciMLTesting = "1" +SciMLTesting = "1.6" Statistics = "1.10" Test = "1.10" julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 81692d9..6301136 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,24 +1,20 @@ +using SciMLTesting using SurrogatesBase -using Aqua using JET using LinearAlgebra using Test import Statistics -@testset "Aqua" begin - Aqua.find_persistent_tasks_deps(SurrogatesBase) - Aqua.test_ambiguities(SurrogatesBase, recursive = false) - Aqua.test_deps_compat(SurrogatesBase) - Aqua.test_piracies(SurrogatesBase) - Aqua.test_project_extras(SurrogatesBase) - Aqua.test_stale_deps(SurrogatesBase) - Aqua.test_unbound_args(SurrogatesBase) - Aqua.test_undefined_exports(SurrogatesBase) -end +run_qa(SurrogatesBase; explicit_imports = true) +# JET.report_call type-stability analysis of concrete user-defined surrogates. +# This goes beyond run_qa's package-level JET.test_package: it checks that the +# interface contract (update!/finite_posterior/parameters and the call method) +# stays inferable for downstream subtypes. +# # On Julia 1.12+, LinearAlgebra.norm_recursive_check has a type inference issue -# that causes JET false positives. We ignore LinearAlgebra and Base modules -# to filter these stdlib issues while still checking our own code. +# that surfaces as JET false positives through `norm`. We ignore LinearAlgebra +# and Base frames to filter those stdlib issues while still checking our own code. const JET_CONFIG = ( ignored_modules = ( JET.AnyFrameModule(LinearAlgebra), @@ -26,14 +22,8 @@ const JET_CONFIG = ( ), ) -@testset "JET static analysis" begin - @testset "Package analysis" begin - result = JET.report_package(SurrogatesBase; JET_CONFIG...) - @test length(JET.get_reports(result)) == 0 - end - +@testset "JET report_call type stability" begin @testset "DummySurrogate type stability" begin - # Test implementation from runtests.jl struct JETDummySurrogate{X, Y} <: AbstractDeterministicSurrogate xs::Vector{X} ys::Vector{Y} @@ -47,11 +37,9 @@ const JET_CONFIG = ( d = JETDummySurrogate(Vector{Vector{Float64}}(), Vector{Int}()) SurrogatesBase.update!(d, [[10.3, 0.1], [1.9, 2.1]], [5, 6]) - # Test call method result = JET.report_call(d, Tuple{Vector{Float64}}; JET_CONFIG...) @test length(JET.get_reports(result)) == 0 - # Test update! method result = JET.report_call( SurrogatesBase.update!, Tuple{ @@ -87,7 +75,6 @@ const JET_CONFIG = ( JETFiniteDummyStochasticSurrogate(s, xs) end - # Test update! method result = JET.report_call( SurrogatesBase.update!, Tuple{ @@ -97,7 +84,6 @@ const JET_CONFIG = ( ) @test length(JET.get_reports(result)) == 0 - # Test finite_posterior result = JET.report_call( SurrogatesBase.finite_posterior, Tuple{