Repository navigation
QA: scan the package extensions with ExplicitImports - #51
Merged
ChrisRackauckas merged 1 commit intoAug 1, 2026
Merged
Conversation
`run_qa` -> ExplicitImports skips any extension whose module does not exist, and an extension module only exists once its trigger weakdep is loaded. The QA environment loaded none of them, so all five extensions were unscanned. Add the weakdeps to `test/qa/Project.toml` (with compat mirroring the root Project.toml) and `using` them in `test/qa/qa.jl`. The newly-scanned extensions produced two real findings: * `no_implicit_imports` -- every extension did `using SomePackage` and then used names from it implicitly. Fixed at the source with explicit imports. * `all_qualified_accesses_are_public` -- 18 accesses, all of them an extension reaching into its own parent package (the `try_*` stubs it adds methods to, the `_*_loaded` flags its `__init__` sets, and the `is_*`/`detect_*` predicates it dispatches on). None have a public spelling, so they are ignored as one commented group. `SemiseparableMatrices` is a weakdep with no `[extensions]` entry, so it has no extension module to scan and is not added to the QA environment. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
ChrisRackauckas
marked this pull request as ready for review
August 1, 2026 08:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ignore this PR until it has been reviewed by @ChrisRackauckas.
Why
SciMLTesting.run_qaruns ExplicitImports' checks on the package module.ExplicitImports does know about package extensions — it reads the
[extensions]table out of
Project.toml— but it skips any extension whose module does notexist, and an extension module only comes into existence once its trigger
(weak)dependency is loaded:
test/qa/Project.tomldid not depend on any of this package's weakdeps, so noneof the five extensions were being scanned by QA at all. Verified on the base
branch (
main), from the unmodified QA environment:This was a real gap, not an incidental one — no test dependency was pulling any of
the weakdeps in transitively.
What changed
test/qa/Project.toml: addedBandedMatrices,BlockBandedMatrices,FastAlmostBandedMatrices,SpecialMatrices,ToeplitzMatricesunder[deps](same UUIDs as the root
[weakdeps]) with[compat]entries mirroring the rootProject.tomlbounds.test/qa/qa.jl:usingall five so the extension modules exist by the timerun_qaruns.Same probe on this branch:
Coverage
All 5 declared extensions are now scanned. Nothing was left out for
hardware/system-library reasons — every weakdep here is pure Julia.
SemiseparableMatricesis declared under[weakdeps]and[compat]in the rootProject.tomlbut has no[extensions]entry and noext/file, so there isno extension module for ExplicitImports to scan. It is a dangling weakdep; adding
it to the QA environment would achieve nothing, so it was left out. Worth removing
from
[weakdeps]/[compat](or growing the extension it was presumably meant totrigger) in a separate PR.
Findings the new coverage produced, and how each was handled
Fixed in the extension sources (
no_implicit_imports)Every extension did
using SomePackageand then used names from it implicitly.Replaced with explicit imports:
ext/BandedMatricesExt.jlusing SparseMatrixIdentification,using BandedMatricesusing SparseMatrixIdentification: SparseMatrixIdentification,using BandedMatrices: BandedMatrixext/BlockBandedMatricesExt.jlusing BlockBandedMatrices,using BandedMatricesusing BlockBandedMatrices: BlockBandedMatrix(theBandedMatricesusingwas dropped — nothing from it was used; it remains a declared trigger in[extensions])ext/FastAlmostBandedMatricesExt.jlusing FastAlmostBandedMatrices,using BandedMatricesusing FastAlmostBandedMatrices: AlmostBandedMatrix,using BandedMatrices: BandedMatrixext/SpecialMatricesExt.jlusing SpecialMatricesusing SpecialMatrices: Cauchy, Hilbert, Strang, Vandermondeext/ToeplitzMatricesExt.jlusing ToeplitzMatricesusing ToeplitzMatrices: ToeplitzNo behavior change;
GROUP=Corestill passes (see below).Ignored, with justification (
all_qualified_accesses_are_public)18 findings, and all 18 have
SparseMatrixIdentificationitself as the owner —they are the extensions reaching into their own parent package, which is the only
way an extension can hook into it. One ignore group was added in
test/qa/qa.jlwith a comment naming the owner and the reason:
try_almostbanded,try_banded,try_blockbanded,try_special_matrices,try_toeplitz— the stub functions each extension adds methods to._bandedmatrices_loaded,_blockbandedmatrices_loaded,_fastalmostbandedmatrices_loaded,_specialmatrices_loaded,_toeplitzmatrices_loaded— theRef{Bool}flags each extension's__init__flips.
detect_block_size,is_almost_banded,is_banded,is_cauchy,is_hilbert,is_strang,is_toeplitz,is_vandermonde— the structure-detection predicatesthe extensions dispatch on.
None of these are declared
public/exported, and there is no public spelling touse instead, so there is nothing to "fix" in the extension source. No check was
disabled and no
@test_brokenwas added.Follow-up worth considering (deliberately not done here to keep this PR
reviewable): the five
try_*functions are already documented indocs/src/api.mdunder "Extension Point Functions", i.e. they are de-facto publicAPI that has never been declared
public. Declaring thempublic(a minorversion bump) would let five of the eighteen ignores be dropped.
Local results
GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()'on Julia 1.12:Before this PR, the same command on this branch's
test/qacontent but withoutthe source fixes errored with
no_implicit_importsandall_qualified_accesses_are_public— i.e. the newly-scanned extensions didproduce real findings, which is the point.
GROUP=Core julia --project=. -e 'using Pkg; Pkg.test()'also passes with theextension source changes (
Testing SparseMatrixIdentification tests passed, all12 test files green).
test/qa/Manifest.tomlis a local build artifact and is not committed.