QA: run_qa v1.6 form + ExplicitImports#232
Conversation
Convert the hand-rolled test/qa/qa.jl (raw Aqua.test_* + per-function
JET.report_call) to the SciMLTesting 1.6 `run_qa` form and enable the
ExplicitImports checks.
ExplicitImports findings (run vs released SciMLTesting 1.6.0):
* no_stale_explicit_imports: removed the genuinely stale
`ArrayInterface.allowed_getindex` import (never referenced; only
`ismutable`/`allowed_setindex!` are used).
* Made the `for i in 1:13 include("exp_generated/exp_$i.jl")` dynamic
include in exp_noalloc.jl static (13 literal includes) so the module is
analyzable — this unblocked no_implicit_imports and
no_stale_explicit_imports (previously UnanalyzableModuleException).
Verified Higham2005 matrix-exp still matches Base `exp` to ~6.7e-16.
* all_qualified_accesses_via_owners / all_qualified_accesses_are_public /
all_explicit_imports_are_public: ignore-listed other packages' non-public
names (Base / LinearAlgebra(.BLAS/.LAPACK, incl. Stegr submodule) /
ArrayInterface / libblastrampoline_jll); they go public as the base libs
declare them.
* no_implicit_imports: ~31 implicit names from `using LinearAlgebra,
SparseArrays, Printf, PrecompileTools`. Making them explicit is a large
refactor; marked ei_broken and tracked in SciML#231 (auto-flags when fixed).
Deps: test/qa/Project.toml SciMLTesting compat -> "1.6" (Aqua + ExplicitImports
are transitive via SciMLTesting; Aqua kept a direct dep so the ambiguities
sub-check's child process can resolve it; JET kept for the JET check). Root
Project.toml SciMLTesting compat -> "1.6".
QA group on Julia 1.10 (lts), released SciMLTesting 1.6.0:
Quality Assurance | 17 Pass, 1 Broken, 0 Fail, 0 Error (no_implicit_imports
broken per SciML#231). On Julia 1.12 the JET typo check reports pre-existing
"may be undefined" findings (kiops order/kest, Higham2005 ilo/ihi/scale/bal);
master is already red there and the source fixes live in draft PR SciML#229.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Higham2005)
The run_qa v1.6 conversion runs JET in report_package typo mode, which analyzes
each method signature in isolation. The hand-rolled qa.jl this replaced used
JET.report_call(exponential!, (Matrix{Float64},)), where ExpMethodHigham2005(A)
sets do_balancing = (A isa StridedMatrix) as a constant that JET could
constant-propagate, so both `if method.do_balancing` blocks folded to true and
ilo/ihi/scale/bal were seen as always defined. In report_package the method is
analyzed with an abstract ExpMethodHigham2005, so do_balancing is a runtime
Bool, the two balancing blocks are not provably correlated, and the undo block
reads ilo/ihi/scale/bal as possibly-undefined locals (20 JET typo reports on
Julia 1.12; 1.10 abstract-interp did not reach them).
Seed ilo=1/ihi=n/scale=_scale as no-op defaults and lift the GenericSchur
row/col permutations into prow/pcol locals (nothing on the BLAS path, which
never reads them), so every local read in the symmetric undo block is
unconditionally defined. Behavior is unchanged: the seeds are only live when
do_balancing is false (where the undo block does not run), and the BLAS vs
GenericSchur branches use exactly the values they used before.
Verified Julia 1.12.6 (released SciMLTesting 1.7.0, JET 0.11.5): report_package
typo mode goes from 20 reports to 0. Verified Julia 1.10.11 numerics unchanged:
strided-BLAS balancing relerr 3.3e-16, GenericSchur (BigFloat) balancing relerr
1.1e-16, no-balancing relerr 1.6e-16 vs reference exp.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
881530d to
f3eac2b
Compare
QA(julia 1) red diagnosis + fixFailing lane: Classification: conversion bug (run_qa's broader JET check surfaces genuine latent type-instabilities the old hand-rolled qa.jl never reached). Two root causes:
Verified locally (released SciMLTesting 1.7.0):
Note — Julia 1.10 EI (not a CI lane): with Ignore until reviewed by @ChrisRackauckas. |
Please ignore until reviewed by @ChrisRackauckas.
Converts the hand-rolled
test/qa/qa.jl(rawAqua.test_*+ per-functionJET.report_call) to the SciMLTesting 1.6run_qaform and enables the ExplicitImports checks.ExplicitImports findings (run locally vs released SciMLTesting 1.6.0)
no_stale_explicit_importsArrayInterface.allowed_getindex(imported, never used)no_implicit_importsusing LinearAlgebra, SparseArrays, Printf, PrecompileTools; explicit refactor deferredall_explicit_imports_via_ownersall_qualified_accesses_via_ownersBlasFloat/chkstride1/libblastrampolinereached viaLinearAlgebra.BLAS(owners: LinearAlgebra / libblastrampoline_jll)all_qualified_accesses_are_public@aliasscope,@assume_effects,@blasfunc,@propagate_inbounds,chkfinite,chklapackerror,gebal!,gesv!,rcswap!,stegr!, ...)all_explicit_imports_are_publicBlasInt,checksquare,ismutable,allowed_setindex!,typename) + Stegr submodule's@blasfunc/stegr!All ignored names are other packages' internals that will become public as the base libs declare them; only own-package surface is otherwise touched.
Analyzability fix
ExplicitImports could not analyze the module because of the dynamic
for i in 1:13; include("exp_generated/exp_$i.jl"); endinsrc/exp_noalloc.jl(UnanalyzableModuleException). Replaced it with 13 literalincludes. Verified the Higham2005 matrix exponential still matches Baseexpto ~6.7e-16 andexpvis unchanged. This unblockedno_implicit_importsandno_stale_explicit_imports.Deps
test/qa/Project.toml: SciMLTesting compat →"1.6". Aqua + ExplicitImports are transitive via SciMLTesting; Aqua is kept a direct dep so thetest_ambiguitieschild process can resolve it. JET kept for the JET check.Project.toml: SciMLTesting compat →"1.6".Verification
QA group on Julia 1.10 (lts), released SciMLTesting 1.6.0 (
Pkg.test,GROUP=QA, folder model):(the one Broken is
no_implicit_imports, tracked in #231).Pre-existing JET-on-1.12 caveat
On Julia 1.12 the JET typo check reports pre-existing "local variable may be undefined" findings (
kiopsorder/kest, Higham2005ilo/ihi/scale/bal). master is already red on the QA(1)/1.12 lane today, and the source-level fixes live in the still-open draft #229. This PR does not bundle that numerical-source fix (out of scope, belongs in #229) and does not usejet_broken(it would turn the clean lts JET lane into an Unexpected-Pass error). The lts QA lane is fully green; the 1.12 JET red is pre-existing and tracked by #229.🤖 Generated with Claude Code