QA: scan PureKLUForwardDiffExt (load ForwardDiff in the QA env) - #74
Merged
ChrisRackauckas merged 1 commit intoAug 1, 2026
Merged
Conversation
ExplicitImports only adds an extension module to the set it checks when `Base.get_extension` returns non-`nothing`, which requires the trigger package to be loaded. The QA environment never loaded ForwardDiff, so `PureKLUForwardDiffExt` was not scanned at all. Add ForwardDiff to `test/qa/Project.toml` and load it in `qa.jl`. The newly-surfaced findings: * `AbstractKLUFactorization` was an unused import in the extension -- removed. * `KLUFactorization` is documented API (`klu`'s return type) but was never declared `public`; declare it. It stays unexported because KLU.jl exports the same name. * ForwardDiff declares nothing `public` and exports none of its dual-number interface, so `Dual`, `Partials`, `value` and `partials` have no public spelling -- ignored in `ei_kwargs`. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
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 reviewed by @ChrisRackauckas.
Problem
SciMLTesting.run_qaruns ExplicitImports over the package's submodules. ExplicitImports does know about extensions — it reads the[extensions]table out ofProject.toml— but it skips any extension whose module does not exist:An extension module only exists once its trigger weakdep is loaded, and the QA environment never loaded ForwardDiff. So
PureKLUForwardDiffExtwas getting zero ExplicitImports coverage, while QA reported a clean pass.Fix
ForwardDifftotest/qa/Project.toml([deps]+[compat] = "1", mirroring the root compat).using ForwardDiffintest/qa/qa.jlbeforerun_qa, with a comment explaining why.Proof the extension is now actually scanned
A passing QA summary is not proof — each ExplicitImports check folds every submodule into one
@test, so a clean extension yields an identical summary either way. Direct check fromtest/qa:Findings surfaced, and what was done with each
Turning the scan on produced 3 errored checks. All were addressed:
Fixed in source (not ignored):
no_stale_explicit_imports—AbstractKLUFactorizationwas imported byext/PureKLUForwardDiffExt.jland never used. Removed from the import list.all_explicit_imports_are_public—KLUFactorizationis not public inPureKLU. It is documented API (it is whatklureturns, and it has a@docsentry indocs/src/api.md), it just was never declaredpublic. Declared it insrc/PureKLU.jl, guarded for the 1.10 LTS where thepublickeyword does not exist. It deliberately stays unexported, since KLU.jl exports the same name and PureKLU is a drop-in for it. This adds public API, hence the1.2.0→1.3.0minor bump.Ignored, with justification:
all_explicit_imports_are_public/all_qualified_accesses_are_public—ForwardDiff.Dual,ForwardDiff.Partials,ForwardDiff.value,ForwardDiff.partials. ForwardDiff v1 declares no namepublicand exports none of its dual-number interface (names(ForwardDiff) == [:DiffResults, :ForwardDiff]), so there is no public spelling for the types and accessors any AD extension must dispatch on and unpack. Added as a single commentedFORWARDDIFF_NONPUBLICtuple applied to both public-API checks. No check was disabled and nothing was marked@test_broken.Coverage
PureKLUForwardDiffExt(the package's only extension).Local results
GROUP=Corealso run, to confirm the extension edit and thepublicdeclaration break nothing:(Julia 1.12, ForwardDiff v1.4.3.)
Also gitignored
test/qa/Manifest.toml, which the QA run generates.🤖 Generated with Claude Code
https://claude.ai/code/session_01Yb5kCpT5SRzTrhppKSh1n7