Skip to content

Commit fe630c8

Browse files
QA: eliminate ExplicitImports exceptions (make-public Core API, explicit imports)
Replaces the blanket `ei_broken` suppressions added in the run_qa v1.6 conversion with real fixes, so QA enforces ExplicitImports instead of masking entire check categories. Core (BoundaryValueDiffEqCore): - Mark the internal API consumed by the solver sublibraries `@public` via SciMLPublic (no-op on Julia <1.11). This lets the sublibraries import those names without `all_explicit_imports_are_public` / `all_qualified_accesses` flags, eliminating the bulk of the suppressions fleet-wide. - Make implicit imports explicit, drop stale imports, define a local `_unwrap_val` (SciMLBase internal that won't be made public). - Remaining qa.jl ignores are genuine external internals only (ForwardDiff, SciMLStructures, SparseConnectivityTracer, ArrayInterface.parameterless_type, and SciMLBase BVP problem/algorithm types + solution_new_original_retcode). Sublibraries (Ascher, Shooting, MIRK, MIRKN, FIRK): - Make all implicit imports explicit; remove stale imports; import `get_tmp` from its owner PreallocationTools and `@SciMLMessage` from SciMLLogging. - Drop now-unused deps (MIRKN: ArrayInterface/BandedMatrices/ FastAlmostBandedMatrices/PrecompileTools/SparseArrays; Ascher: PreallocationTools/RecursiveArrayTools; Shooting: RecursiveArrayTools). - Now-public SciMLBase names (`__solve`/`__init`/`build_solution`/... in 3.30) no longer need ignores; bump SciMLBase compat floor to 3.30. - All ei_broken removed; remaining ignores are external non-public names only (StandardBVProblem/StandardSecondOrderBVProblem, ForwardDiff Dual/jacobian!/ pickchunksize, SciMLStructures Tunable/canonicalize/isscimlstructure). Umbrella (BoundaryValueDiffEq): explicitly import the re-exported solver algorithms from each sublibrary; ei_broken/ignores removed entirely. Verified locally on Julia 1.12 (released SciMLBase 3.30.0, SciMLTesting 1.7.0): GROUP=QA run_qa green for root (17/17) and all six sublibraries, 0 broken. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent b88dbf1 commit fe630c8

21 files changed

Lines changed: 233 additions & 171 deletions

File tree

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1717
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
1818
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1919
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
20+
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"
2021

2122
[weakdeps]
2223
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
@@ -58,7 +59,8 @@ Random = "1.10"
5859
RecursiveArrayTools = "3.31.2, 4"
5960
Reexport = "1.2"
6061
SafeTestsets = "0.1.0"
61-
SciMLBase = "3"
62+
SciMLBase = "3.30"
63+
SciMLLogging = "1.10.1, 2"
6264
SciMLTesting = "1"
6365
Sparspak = "0.3.11"
6466
StaticArrays = "1.9.8"

ext/BoundaryValueDiffEqODEInterfaceExt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ module BoundaryValueDiffEqODEInterfaceExt
33
using BoundaryValueDiffEq: BVPM2, BVPSOL, COLNEW
44
using BoundaryValueDiffEqCore: __extract_u0, __initial_guess_length, __extract_mesh,
55
__flatten_initial_guess, __get_bcresid_prototype,
6-
__has_initial_guess, __initial_guess, _process_verbose_param, BVPVerbosity, @SciMLMessage
6+
__has_initial_guess, __initial_guess, _process_verbose_param, BVPVerbosity
77
using SciMLBase: SciMLBase, BVProblem, TwoPointBVProblem, ReturnCode
8+
using SciMLLogging: @SciMLMessage
89
using ODEInterface: OptionsODE, OPT_ATOL, OPT_RTOL, OPT_METHODCHOICE, OPT_DIAGNOSTICOUTPUT,
910
OPT_ERRORCONTROL, OPT_SINGULARTERM, OPT_MAXSTEPS, OPT_BVPCLASS,
1011
OPT_SOLMETHOD, OPT_RHS_CALLMODE, OPT_COLLOCATIONPTS, OPT_ADDGRIDPOINTS,

lib/BoundaryValueDiffEqAscher/Project.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
1212
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
1313
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15-
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
16-
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
1715
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1816
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1917
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
@@ -29,11 +27,10 @@ DifferentiationInterface = "0.7.15"
2927
FastClosures = "0.3.2"
3028
ForwardDiff = "0.10.38, 1"
3129
LinearAlgebra = "1.10"
32-
PreallocationTools = "1.2"
3330
Random = "1.10"
3431
RecursiveArrayTools = "3.27.0, 4"
3532
Reexport = "1.2"
36-
SciMLBase = "3"
33+
SciMLBase = "3.30"
3734
SciMLTesting = "1"
3835
Setfield = "1.1.1"
3936
StaticArrays = "1.9.8"

lib/BoundaryValueDiffEqAscher/src/BoundaryValueDiffEqAscher.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ module BoundaryValueDiffEqAscher
33
using ADTypes: ADTypes, AutoSparse, AutoForwardDiff
44
using AlmostBlockDiagonals: AlmostBlockDiagonals, IntermediateAlmostBlockDiagonal
55

6-
using BoundaryValueDiffEqCore: AbstractBoundaryValueDiffEqAlgorithm,
6+
using BoundaryValueDiffEqCore: BoundaryValueDiffEqCore,
7+
AbstractBoundaryValueDiffEqAlgorithm,
78
AbstractBoundaryValueDiffEqCache, BVPJacobianAlgorithm,
9+
DEFAULT_VERBOSE, GlobalErrorControl, _process_verbose_param,
810
__extract_problem_details, concrete_jacobian_algorithm,
9-
__Fix3, __concrete_solve_algorithm,
10-
__internal_nlsolve_problem, __vec, __vec_f, __vec_f!,
11+
__concrete_solve_algorithm,
12+
__vec, __vec_f, __vec_f!,
1113
__vec_bc, __vec_bc!, __extract_mesh, get_dense_ad,
1214
__get_bcresid_prototype, __split_kwargs, __concrete_kwargs,
1315
__default_nonsparse_ad, __construct_internal_problem,
1416
__internal_solve, __build_cost
1517

1618
using ConcreteStructs: @concrete
17-
using DifferentiationInterface: DifferentiationInterface, Constant, prepare_jacobian
19+
using DifferentiationInterface: DifferentiationInterface, Constant
1820
using FastClosures: @closure
19-
using ForwardDiff: ForwardDiff, Dual
20-
using LinearAlgebra
21-
using PreallocationTools: PreallocationTools, DiffCache
22-
using RecursiveArrayTools: VectorOfArray, recursivecopy
21+
using ForwardDiff: ForwardDiff
22+
using LinearAlgebra: LinearAlgebra, I, norm, rank
2323
using Reexport: @reexport
24-
using SciMLBase: SciMLBase, AbstractDiffEqInterpolation, StandardBVProblem, __solve,
25-
_unwrap_val
24+
using SciMLBase: SciMLBase, BVProblem, ReturnCode, StandardBVProblem,
25+
TwoPointBVProblem, isinplace, solve
2626
using Setfield: @set!
2727

2828
const DI = DifferentiationInterface

lib/BoundaryValueDiffEqAscher/test/qa/qa.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ using Test
55
run_qa(
66
BoundaryValueDiffEqAscher;
77
explicit_imports = true,
8-
# Pre-existing ExplicitImports findings, tracked in SciML/BoundaryValueDiffEq.jl#519.
9-
ei_broken = (
10-
:no_implicit_imports, :no_stale_explicit_imports,
11-
:all_qualified_accesses_are_public, :all_explicit_imports_are_public,
8+
ei_kwargs = (;
9+
# StandardBVProblem is a SciMLBase-owned BVP problem type that this solver
10+
# legitimately dispatches on but which SciMLBase does not mark public.
11+
all_explicit_imports_are_public = (; ignore = (:StandardBVProblem,)),
12+
# ForwardDiff.Dual / ForwardDiff.jacobian! are ForwardDiff internals with
13+
# no public replacement.
14+
all_qualified_accesses_are_public = (; ignore = (:Dual, :jacobian!)),
1215
),
1316
)

lib/BoundaryValueDiffEqCore/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
2121
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2222
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2323
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"
24+
SciMLPublic = "431bcebd-1456-4ced-9d72-93c2757fff0b"
2425
SciMLStructures = "53ae85a6-f571-4167-b2af-e1d143709226"
2526
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2627
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
@@ -44,8 +45,9 @@ OptimizationBase = "5.1"
4445
PreallocationTools = "1.2"
4546
RecursiveArrayTools = "3.27.0, 4"
4647
Reexport = "1.2"
47-
SciMLBase = "3"
48+
SciMLBase = "3.30"
4849
SciMLLogging = "1.10.1, 2"
50+
SciMLPublic = "1"
4951
SciMLTesting = "1"
5052
SciMLStructures = "1.7.0"
5153
Setfield = "1"

lib/BoundaryValueDiffEqCore/src/BoundaryValueDiffEqCore.jl

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@ module BoundaryValueDiffEqCore
22

33
using Adapt: adapt
44
using ADTypes: ADTypes, AbstractADType, AutoSparse, AutoForwardDiff, AutoFiniteDiff,
5-
NoSparsityDetector, KnownJacobianSparsityDetector, AutoPolyesterForwardDiff
6-
using ArrayInterface: parameterless_type, fast_scalar_indexing
5+
AutoPolyesterForwardDiff
6+
using ArrayInterface: parameterless_type
77
using ConcreteStructs: @concrete
88
using DiffEqBase: DiffEqBase, solve
99
using ForwardDiff: ForwardDiff, pickchunksize
1010
using Integrals: Integrals, IntegralProblem
11-
using LinearAlgebra
11+
using LinearAlgebra: LinearAlgebra, mul!
1212
using LineSearch: BackTracking
13-
using NonlinearSolveFirstOrder: NonlinearSolvePolyAlgorithm
13+
using NonlinearSolveFirstOrder: NonlinearSolveFirstOrder, NonlinearSolvePolyAlgorithm,
14+
GaussNewton, LevenbergMarquardt, NewtonRaphson, NonlinearSolveBase, TrustRegion
1415
using NonlinearSolveBase: NonlinearVerbosity
1516
using OptimizationBase: OptimizationBase, OptimizationVerbosity
1617
using PreallocationTools: PreallocationTools, DiffCache, get_tmp
1718
using RecursiveArrayTools: AbstractVectorOfArray, VectorOfArray, DiffEqArray
1819
using Reexport: @reexport
19-
using SciMLBase: SciMLBase, AbstractBVProblem, AbstractDiffEqInterpolation,
20-
StandardBVProblem, StandardSecondOrderBVProblem, __solve, _unwrap_val
21-
using SciMLLogging: SciMLLogging, @SciMLMessage, Silent, DebugLevel,
22-
InfoLevel, WarnLevel, ErrorLevel, @verbosity_specifier, AbstractVerbositySpecifier,
20+
using SciMLBase: SciMLBase, AbstractBVProblem, BVProblem, NonlinearFunction,
21+
NonlinearLeastSquaresProblem, NonlinearProblem, OptimizationFunction,
22+
OptimizationProblem, SecondOrderBVProblem, StandardBVProblem,
23+
StandardSecondOrderBVProblem, TwoPointBVProblem, TwoPointSecondOrderBVProblem,
24+
__solve
25+
using SciMLLogging: SciMLLogging, Silent,
26+
InfoLevel, WarnLevel, @verbosity_specifier,
2327
None, Minimal, Standard, Detailed, All
24-
using Setfield: @set!, @set
28+
using SciMLPublic: @public
29+
using Setfield: @set!
2530
using SparseArrays: sparse
2631
using SparseConnectivityTracer: SparseConnectivityTracer, TracerLocalSparsityDetector
2732
using SparseMatrixColorings: GreedyColoringAlgorithm
@@ -55,4 +60,28 @@ export HOErrorControl, REErrorControl
5560
export integral
5661
export BVPVerbosity, _process_verbose_param, DEFAULT_VERBOSE
5762

63+
# Internal API consumed by the solver sublibraries (BoundaryValueDiffEqMIRK,
64+
# BoundaryValueDiffEqFIRK, BoundaryValueDiffEqShooting, BoundaryValueDiffEqAscher,
65+
# BoundaryValueDiffEqMIRKN). Marked public so the sublibraries can import these
66+
# without ExplicitImports flagging them; not exported because they are not part
67+
# of the user-facing API.
68+
@public AbstractBoundaryValueDiffEqCache, AbstractErrorControl, DiffCacheNeeded,
69+
EvalSol, NoDiffCacheNeeded, __FastShortcutNonlinearPolyalg, __Fix3,
70+
__add_singular_term!, __any_sparse_ad, __build_cost, __build_solution,
71+
__cache_trait, __concrete_kwargs, __concrete_solve_algorithm,
72+
__construct_internal_problem, __default_coloring_algorithm,
73+
__default_nonsparse_ad, __default_sparse_ad, __default_sparsity_detector,
74+
__extract_mesh, __extract_problem_details, __extract_u0,
75+
__flatten_initial_guess, __get_bcresid_prototype, __get_non_sparse_ad,
76+
__has_initial_guess, __initial_guess, __initial_guess_length,
77+
__initial_guess_on_mesh, __internal_nlsolve_problem,
78+
__internal_optimization_problem, __internal_solve,
79+
__materialize_jacobian_algorithm, __maybe_allocate_diffcache, __maybe_matmul!,
80+
__needs_diffcache, __resize!, __restructure_sol, __split_kwargs,
81+
__tunable_part, __use_both_error_control, __vec, __vec_bc, __vec_bc!,
82+
__vec_f, __vec_f!, __vec_so_bc, __vec_so_bc!, _sparse_like,
83+
concrete_jacobian_algorithm, diff!, eval_bc_residual, eval_bc_residual!,
84+
get_dense_ad, interval, nodual_value, recursive_flatten, recursive_flatten!,
85+
recursive_flatten_twopoint!, recursive_unflatten!, safe_similar, _unwrap_val
86+
5887
end

lib/BoundaryValueDiffEqCore/src/utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
_unwrap_val(::Val{B}) where {B} = B
2+
_unwrap_val(B) = B
3+
14
recursive_length(x::Vector{<:AbstractArray}) = sum(length, x)
25
recursive_length(x::Vector{<:DiffCache}) = sum(xᵢ -> length(xᵢ.u), x)
36

lib/BoundaryValueDiffEqCore/test/qa/qa.jl

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,29 @@ run_qa(
99
ambiguities = (; recursive = false),
1010
stale_deps = (; ignore = [:TimerOutputs]),
1111
),
12-
# Pre-existing ExplicitImports findings, tracked in SciML/BoundaryValueDiffEq.jl#519.
13-
ei_broken = (
14-
:no_implicit_imports, :no_stale_explicit_imports,
15-
:all_qualified_accesses_are_public, :all_explicit_imports_are_public,
12+
ei_kwargs = (;
13+
# All remaining entries are external internals with no public replacement:
14+
# - SciMLBase: BVP problem/algorithm abstract types that BVP solvers
15+
# legitimately subtype/extend, and solution_new_original_retcode (no
16+
# public counterpart; solution_new_retcode does not preserve the
17+
# original retcode).
18+
# - ForwardDiff Dual/value/can_dual/pickchunksize: not marked public.
19+
# - ArrayInterface.parameterless_type: not marked public.
20+
# - SciMLStructures Tunable/canonicalize/isscimlstructure/replace: the
21+
# SciMLStructures interface is not marked public.
22+
# - SparseConnectivityTracer Dual/primal: internal tracer types.
23+
all_explicit_imports_are_public = (;
24+
ignore = (
25+
:AbstractBVProblem, :StandardBVProblem, :StandardSecondOrderBVProblem,
26+
:parameterless_type, :pickchunksize,
27+
),
28+
),
29+
all_qualified_accesses_are_public = (;
30+
ignore = (
31+
:AbstractBVPAlgorithm, :AbstractBVProblem, :solution_new_original_retcode,
32+
:Dual, :value, :can_dual, :primal,
33+
:Tunable, :canonicalize, :isscimlstructure, :replace,
34+
),
35+
),
1636
),
1737
)

lib/BoundaryValueDiffEqFIRK/src/BoundaryValueDiffEqFIRK.jl

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ module BoundaryValueDiffEqFIRK
33
using ADTypes: ADTypes, AutoSparse, AutoForwardDiff
44
using ArrayInterface: fast_scalar_indexing
55
using BandedMatrices: BandedMatrix, Ones
6-
using BoundaryValueDiffEqCore: AbstractBoundaryValueDiffEqAlgorithm,
6+
using BoundaryValueDiffEqCore: BoundaryValueDiffEqCore,
7+
AbstractBoundaryValueDiffEqAlgorithm,
78
AbstractBoundaryValueDiffEqCache, BVPJacobianAlgorithm,
8-
recursive_flatten, recursive_flatten!, recursive_unflatten!,
9+
DEFAULT_VERBOSE, DefectControl, GaussNewton, LevenbergMarquardt,
10+
_process_verbose_param,
11+
recursive_flatten!, recursive_unflatten!,
912
__concrete_solve_algorithm, diff!, EvalSol,
1013
concrete_jacobian_algorithm, eval_bc_residual, interval,
11-
eval_bc_residual!, get_tmp, __maybe_matmul!, __resize!,
12-
__extract_problem_details, __initial_guess, nodual_value,
14+
eval_bc_residual!, __maybe_matmul!, __resize!,
15+
__extract_problem_details, nodual_value,
1316
__maybe_allocate_diffcache, __restructure_sol,
1417
__get_bcresid_prototype, __vec, __vec_f, __vec_f!, __vec_bc,
1518
__vec_bc!, recursive_flatten_twopoint!, __concrete_kwargs,
16-
__internal_nlsolve_problem, __extract_mesh, __extract_u0,
17-
__default_coloring_algorithm, __maybe_allocate_diffcache,
18-
__restructure_sol, __get_bcresid_prototype, safe_similar,
19-
__vec, __vec_f, __vec_f!, __vec_bc, __vec_bc!, __cache_trait,
20-
recursive_flatten_twopoint!, __internal_nlsolve_problem,
21-
__extract_mesh, __extract_u0, DiffCacheNeeded,
22-
NoDiffCacheNeeded, __has_initial_guess,
23-
__construct_internal_problem, __initial_guess_length,
24-
__initial_guess_on_mesh, __flatten_initial_guess,
25-
__build_solution, __Fix3, __split_kwargs, _sparse_like,
26-
get_dense_ad, __internal_optimization_problem,
19+
__extract_mesh,
20+
__default_coloring_algorithm, safe_similar, __cache_trait,
21+
DiffCacheNeeded,
22+
NoDiffCacheNeeded,
23+
__construct_internal_problem,
24+
__initial_guess_on_mesh,
25+
__build_solution, __split_kwargs, _sparse_like,
26+
get_dense_ad,
2727
__internal_solve, __default_sparsity_detector, __build_cost,
2828
__tunable_part, __add_singular_term!
2929

@@ -32,17 +32,18 @@ using DifferentiationInterface: DifferentiationInterface, Constant
3232
using FastAlmostBandedMatrices: AlmostBandedMatrix, fillpart, exclusive_bandpart,
3333
finish_part_setindex!
3434
using FastClosures: @closure
35-
using ForwardDiff: ForwardDiff, pickchunksize, Dual
36-
using LinearAlgebra
37-
using RecursiveArrayTools: AbstractVectorOfArray, AbstractVectorOfArray, DiffEqArray,
35+
using ForwardDiff: ForwardDiff, pickchunksize
36+
using LinearAlgebra: LinearAlgebra
37+
using RecursiveArrayTools: AbstractVectorOfArray, DiffEqArray,
3838
VectorOfArray, recursivecopy, recursivefill!
3939
using Reexport: @reexport
40-
using PreallocationTools: PreallocationTools, DiffCache
40+
using PreallocationTools: PreallocationTools, DiffCache, get_tmp
4141
using PrecompileTools: @compile_workload, @setup_workload
4242
using Preferences: Preferences
43-
using SciMLBase: SciMLBase, AbstractDiffEqInterpolation, StandardBVProblem, __solve,
44-
_unwrap_val
45-
using Setfield: @set!, @set
43+
using SciMLBase: SciMLBase, AbstractDiffEqInterpolation, BVPFunction, BVProblem,
44+
NonlinearProblem, ReturnCode, StandardBVProblem, TwoPointBVProblem,
45+
__solve, isinplace, remake, solve
46+
using Setfield: @set!
4647
using SparseArrays: sparse
4748
using SciMLStructures: SciMLStructures
4849
using StaticArrays: SMatrix, SVector

0 commit comments

Comments
 (0)