Skip to content

Commit cfc5f6e

Browse files
QA: run_qa v1.6 form + ExplicitImports (root + sublibs)
Convert the root test/qa and every lib/<Sub>/test/qa to SciMLTesting 1.6's `run_qa(<Module>; explicit_imports = true, ...)` form and enable the six ExplicitImports checks across the whole monorepo. Per QA env: * qa.jl -> `using SciMLTesting, <Module>, JET; using Test` + a single run_qa call. * test/qa/Project.toml -> SciMLTesting compat "1.6" (+ dep); Aqua and JET kept (both run); ExplicitImports comes transitively from SciMLTesting. [sources] wiring preserved. ExplicitImports: 0 hard FAIL everywhere. no_implicit_imports is the facade `@reexport`/`using` module-name reliance and is marked ei_broken fleet-wide; the public-API and via-owners findings are per-env `ignore`-lists of names owned by SciMLBase/OptimizationBase/the backend/Base that are not (yet) declared public; stale explicit imports are kept+ignored (re-surfaced API / reached as Mod.name). PyCMA and SciPy load CodaPkg-backed Python at precompile, so their EI checks are conservatively ei_broken (verified statically from their source). Also clears the pre-existing Aqua reds that left the new sublibrary QA lanes red since #1223 (these fail identically under the old `Aqua.test_all` form): * deps_compat: add the missing [compat] entries for [extras]/[deps]/[weakdeps] across the sublibraries (stdlibs -> "1"; others to a permissive floor). * stale_deps: drop the unused `PDMats` dep from OptimizationBase; move the test-only `Manifolds` from [deps] to [extras]+test target in OptimizationManopt. * piracies: each solver-wrapper intentionally extends SciMLBase's trait/__init/__solve interface onto its backend optimizer types -> declare those foreign types via `aqua_kwargs = (; piracies = (; treat_as_own = [...]))`. * undefined_exports: MadNLP/Manopt (`solve!`), Metaheuristics (`summary`) and NOMAD (`solve`) `@reexport` two packages exporting the same name, leaving it an unresolved conflict binding -> tracked as `aqua_broken = (:undefined_exports,)`. Verified against released SciMLTesting 1.6.0 on Julia 1.10 (QA lanes run lts+1, never pre): root, OptimizationBase, OptimizationBBO, OptimizationMOI, OptimizationEvolutionary, OptimizationOptimisers, OptimizationOptimJL, OptimizationManopt, OptimizationMadNLP, OptimizationMetaheuristics and OptimizationNOMAD all green-or-broken with 0 FAIL; the remaining Aqua sub-checks (ambiguities/unbound_args/project_extras/persistent_tasks) verified clean across all 24 loadable sublibraries. CI covers the rest. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2d4c3bf commit cfc5f6e

79 files changed

Lines changed: 786 additions & 281 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/OptimizationAuglag/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Reexport = "1.2"
3434
SciMLBase = "2.122.1, 3"
3535
Test = "1.10.0"
3636
julia = "1.10"
37+
Random = "1"
3738

3839
[targets]
3940
test = ["Test", "ForwardDiff", "MLUtils", "OptimizationOptimisers", "Random", "SafeTestsets", "Pkg"]

lib/OptimizationAuglag/test/qa/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
44
OptimizationAuglag = "2ea93f80-9333-43a1-a68d-1f53b957a421"
5+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
56
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
67

78
[sources]
@@ -10,6 +11,7 @@ OptimizationAuglag = {path = "../.."}
1011
[compat]
1112
Aqua = "0.8"
1213
JET = "0.9, 0.10, 0.11"
14+
julia = "1.10"
1315
OptimizationAuglag = "2"
16+
SciMLTesting = "1.6"
1417
Test = "1"
15-
julia = "1.10"
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
using OptimizationAuglag, Aqua, JET
1+
using SciMLTesting, OptimizationAuglag, JET
22
using Test
33

4-
@testset "Aqua" begin
5-
Aqua.test_all(OptimizationAuglag)
6-
end
7-
8-
@testset "JET static analysis" begin
9-
JET.test_package(OptimizationAuglag; target_defined_modules = true)
10-
end
4+
# ExplicitImports findings, all tracked against SciML/Optimization.jl:
5+
# * no_implicit_imports broken: the module relies on `@reexport`/`using`
6+
# module names (SciMLBase/OptimizationBase/Reexport/...) that cannot be made
7+
# explicit without restructuring.
8+
# * the ignored *_are_public / *_via_owners names are owned by SciMLBase,
9+
# OptimizationBase, the backend, or Base and are not (yet) declared public;
10+
# the proper fix is upstream `public` declarations, not a local change.
11+
# * the ignored stale imports are part of the intentionally re-surfaced API.
12+
run_qa(
13+
OptimizationAuglag;
14+
explicit_imports = true,
15+
ei_kwargs = (;
16+
no_stale_explicit_imports = (; ignore = (:norm,)),
17+
all_qualified_accesses_are_public = (; ignore = (:ConvergenceFailure, :MaxIters, :MaxTime, :OptimizationState, :Success, :Terminated, :Unstable, :__solve, :_check_and_convert_maxiters, :allowsbounds, :allowscallback, :allowsconstraints, :allowsfg, :build_solution, :has_init, :isa_dataiterator, :requiresconsjac, :requiresgradient)),
18+
all_explicit_imports_are_public = (; ignore = (:OptimizationStats,)),
19+
),
20+
ei_broken = (:no_implicit_imports,),
21+
)

lib/OptimizationBBO/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ BlackBoxOptim = "0.6.3"
2525
OptimizationBase = "5"
2626
SciMLBase = "2.122.1, 3"
2727
Reexport = "1.2"
28+
Random = "1"
29+
Test = "1"
2830

2931
[targets]
3032
test = ["Random", "Test", "SafeTestsets", "Pkg"]

lib/OptimizationBBO/test/qa/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
44
OptimizationBBO = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b"
5+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
56
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
67

78
[sources]
@@ -10,6 +11,7 @@ OptimizationBBO = {path = "../.."}
1011
[compat]
1112
Aqua = "0.8"
1213
JET = "0.9, 0.10, 0.11"
14+
julia = "1.10"
1315
OptimizationBBO = "0.4"
16+
SciMLTesting = "1.6"
1417
Test = "1"
15-
julia = "1.10"

lib/OptimizationBBO/test/qa/qa.jl

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
using OptimizationBBO, Aqua, JET
1+
using SciMLTesting, OptimizationBBO, JET
22
using Test
33

4-
@testset "Aqua" begin
5-
Aqua.test_all(OptimizationBBO)
6-
end
7-
8-
@testset "JET static analysis" begin
9-
JET.test_package(OptimizationBBO; target_defined_modules = true)
10-
end
4+
# ExplicitImports findings, all tracked against SciML/Optimization.jl:
5+
# * no_implicit_imports broken: the module relies on `@reexport`/`using`
6+
# module names (SciMLBase/OptimizationBase/Reexport/...) that cannot be made
7+
# explicit without restructuring.
8+
# * the ignored *_are_public / *_via_owners names are owned by SciMLBase,
9+
# OptimizationBase, the backend, or Base and are not (yet) declared public;
10+
# the proper fix is upstream `public` declarations, not a local change.
11+
run_qa(
12+
OptimizationBBO;
13+
explicit_imports = true,
14+
ei_kwargs = (;
15+
all_qualified_accesses_via_owners = (; ignore = (:OptimizationStats,)),
16+
all_qualified_accesses_are_public = (; ignore = (Symbol("@logmsg"), :LogLevel, :OptRunController, :OptimizationState, :OptimizationStats, :SingleObjectiveMethodNames, :__solve, :_check_and_convert_maxiters, :_check_and_convert_maxtime, :allowsbounds, :allowscallback, :build_solution, :deduce_retcode, :elapsed_time, :has_init, :num_steps, :parse, :requiresbounds, :shutdown_optimizer!)),
17+
),
18+
ei_broken = (:no_implicit_imports,),
19+
)

lib/OptimizationBase/Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
1010
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1111
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
1212
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13-
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
1413
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1514
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1615
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
@@ -68,11 +67,11 @@ MLDataDevices = "1"
6867
MLUtils = "0.4"
6968
Manifolds = "0.10"
7069
ModelingToolkit = "11"
70+
Mooncake = "0.4.138, 0.5"
7171
Optim = ">= 1.4.1"
7272
Optimisers = ">= 0.2.5"
7373
OptimizationLBFGSB = "1.1"
7474
OptimizationManopt = "1.1"
75-
PDMats = "0.11"
7675
Pkg = "1"
7776
PrecompileTools = "1"
7877
Random = "1.10"

lib/OptimizationBase/test/qa/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
44
OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
5+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
56
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
67

78
[sources]
@@ -10,6 +11,7 @@ OptimizationBase = {path = "../.."}
1011
[compat]
1112
Aqua = "0.8"
1213
JET = "0.9, 0.10, 0.11"
14+
julia = "1.10"
1315
OptimizationBase = "5"
16+
SciMLTesting = "1.6"
1417
Test = "1"
15-
julia = "1.10"

lib/OptimizationBase/test/qa/qa.jl

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1-
using OptimizationBase, Aqua, JET
1+
using SciMLTesting, OptimizationBase, JET
22
using Test
33

4-
@testset "Aqua" begin
5-
Aqua.test_all(OptimizationBase)
6-
end
7-
8-
@testset "JET static analysis" begin
9-
JET.test_package(OptimizationBase; target_defined_modules = true)
10-
end
4+
# ExplicitImports findings, all tracked against SciML/Optimization.jl:
5+
# * no_implicit_imports broken: the module relies on `@reexport`/`using`
6+
# module names (SciMLBase/OptimizationBase/Reexport/...) that cannot be made
7+
# explicit without restructuring.
8+
# * the ignored *_are_public / *_via_owners names are owned by SciMLBase,
9+
# OptimizationBase, the backend, or Base and are not (yet) declared public;
10+
# the proper fix is upstream `public` declarations, not a local change.
11+
# * the ignored stale imports are part of the intentionally re-surfaced API.
12+
run_qa(
13+
OptimizationBase;
14+
explicit_imports = true,
15+
aqua_kwargs = (;
16+
# The sublibrary extends SciMLBase's solver-trait/__init/__solve interface
17+
# onto its backend's optimizer types, so those methods are intentional.
18+
piracies = (;
19+
treat_as_own = [
20+
OptimizationBase.SciMLBase.OptimizationProblem,
21+
OptimizationBase.SciMLBase.AbstractOptimizationCache,
22+
],
23+
),
24+
),
25+
ei_kwargs = (;
26+
no_stale_explicit_imports = (; ignore = (:I, :OptimizationStats, :extract_alg)),
27+
all_qualified_accesses_via_owners = (; ignore = (:IsInfinite, :IteratorSize, :SizeUnknown)),
28+
all_qualified_accesses_are_public = (; ignore = (:AbstractOptimizationCache, :AbstractOptimizationFunction, :AbstractOptimizationSolution, :AbstractTracer, :ChainRulesOriginator, :ConvergenceFailure, :Default, :DtLessThanMin, :Failure, :Fix2, :Infeasible, :InitialFailure, :IsInfinite, :IteratorSize, :MaxIters, :MaxSense, :MaxTime, :MinSense, :NoAD, :NoColoringAlgorithm, :NoSparsityDetector, :NonConcreteEltypeError, :NullParameters, :SizeUnknown, :Success, :Terminated, :Unstable, :__init, :allowsconsjvp, :allowsconsvjp, :allowsfg, :allowsfgh, :build_solution, :has_init, :requiresconshess, :requiresconsjac, :requiresgradient, :requireshessian, :requireslagh, :tail)),
29+
all_explicit_imports_are_public = (; ignore = (:KeywordArgError, :MaxSense, :MinSense, :ObjSense, :OptimizationStats, :__init, :__solve, :_concrete_solve_adjoint, :_concrete_solve_forward, :allowsbounds, :allowscallback, :allowsconstraints, :extract_alg, :get_concrete_p, :get_concrete_u0, :get_root_indp, :get_updated_symbolic_problem, :has_kwargs, :promote_u0, :requiresbounds, :requiresconshess, :requiresconsjac, :requiresconstraints, :requiresgradient, :requireshessian, :wrap_sol)),
30+
),
31+
ei_broken = (:no_implicit_imports,),
32+
)

lib/OptimizationCMAEvolutionStrategy/test/qa/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
44
OptimizationCMAEvolutionStrategy = "bd407f91-200f-4536-9381-e4ba712f53f8"
5+
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
56
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
67

78
[sources]
@@ -10,6 +11,7 @@ OptimizationCMAEvolutionStrategy = {path = "../.."}
1011
[compat]
1112
Aqua = "0.8"
1213
JET = "0.9, 0.10, 0.11"
14+
julia = "1.10"
1315
OptimizationCMAEvolutionStrategy = "0.3"
16+
SciMLTesting = "1.6"
1417
Test = "1"
15-
julia = "1.10"

0 commit comments

Comments
 (0)