Skip to content

Add QA tests with Aqua, ExplicitImports and JET - #299

Draft
devmotion wants to merge 2 commits into
masterfrom
dmw/qa-tests
Draft

devmotion wants to merge 2 commits into
masterfrom
dmw/qa-tests

Conversation

@devmotion

Copy link
Copy Markdown
Member

Adds a QATests test set that runs Aqua, ExplicitImports and JET. Checks that do not pass yet are marked with @test_broken, no source code is changed.

Notable findings: Aqua.test_ambiguities reports 4185 ambiguities between the methods generated with @eval in src/derivatives/ and methods in Base and LinearAlgebra, and JET reports every entry point that differentiates a function with a scalar output, since the analysis reaches pull_value!(::TrackedReal{V,D,Nothing}) in src/tracked.jl where t.origin is only known to be non-nothing due to the run-time check hasorigin(t).

JET >= 0.11.4 requires Julia >= 1.12, so there is no single version that resolves on all Julia versions in the CI matrix. The compat entry therefore allows JET 0.9.18 as well, and the checks are only run if JET_AVAILABLE is defined and true. Since the downgrade job would otherwise pin JET to 0.9.18 on Julia >= 1.12, where it does not precompile, JET is added to its skip list.

The full test suite passes on Julia 1.12.7 (11219 passed, 18 broken). The remaining CI configurations, in particular the downgrade job, are not verified locally.

🤖 Generated with Claude Code

Checks that do not pass yet are marked with `@test_broken`.

JET >= 0.11.4 requires Julia >= 1.12, so no single version resolves across the
whole CI matrix. The compat entry allows JET 0.9.18 as well, and the checks are
only run if `JET_AVAILABLE` is defined and true. Since the downgrade job would
otherwise pin JET to 0.9.18 on Julia >= 1.12, JET is added to its skip list.

`report_package` reports hundreds of problems in code generated with `@eval`,
hence the API entry points are analyzed individually instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.05%. Comparing base (3ddf171) to head (005f56d).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/derivatives/linalg/arithmetic.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #299      +/-   ##
==========================================
- Coverage   86.69%   86.05%   -0.64%     
==========================================
  Files          19       18       -1     
  Lines        1916     1915       -1     
==========================================
- Hits         1661     1648      -13     
- Misses        255      267      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The six `@test_broken` ExplicitImports checks become real tests. Four are
fixed at the source, two are narrowed to what the package can control.

Source fixes:

- `src/ReverseDiff.jl`: all imports are explicit now, which also drops the
  stale `ForwardDiff.Partials`. The bare module bindings `DiffRules`,
  `NaNMath` and `SpecialFunctions` are kept: the `@eval` loops in
  `derivatives/` splice `$M.$f` for `M in (:Base, :SpecialFunctions,
  :NaNMath)` and iterate `DiffRules.diffrules(; filter_modules=nothing)`.
- `src/derivatives/broadcast.jl`: drop the stale `ArrayStyle` import.
- `src/derivatives/linalg/special.jl`: `inv` is owned by `Base`, not by
  `LinearAlgebra`, so extend `Base.inv`. (`LinearAlgebra.det` above it is
  correct as-is -- `det` *is* owned by `LinearAlgebra`.)
- `src/derivatives/linalg/arithmetic.jl`: drop the self-qualification in
  `Base.zero(x::ReverseDiff.TrackedArray)`.
- `src/macros.jl`: interpolate the module into the code that
  `@grad_from_chainrules` generates, exactly as `@grad` already does. This
  removes the remaining 12 self-qualified accesses and, because
  `ChainRulesCore` is interpolated too, the generated code no longer
  requires the caller's module to have `ChainRulesCore` in scope.

Test changes:

The two publicness checks are scoped with `ignore`. ReverseDiff cannot mark
its own names `public` -- that needs Julia >= 1.11 and the LTS is 1.10 --
and several dependencies predate the keyword, so the listed names are all
either upstream internals or ReverseDiff internals used by `StatisticsExt`.

ExplicitImports 1.15 has no way to say "this extension belongs to this
package": an extension is a top-level module, so `Base.moduleroot` of
`StatisticsExt` is itself rather than `ReverseDiff` and
`allow_internal_imports`/`allow_internal_accesses` never apply, while
`ignore=(STATISTICS_EXT,)` is rejected as not a submodule. Listing the
names is the only way to express it, and it keeps the extension's
dependence on internals visible.

`check_all_explicit_imports_via_owners` gets `StaticArrays =>
StaticArraysCore` in `skip`, since `SVector` is exported by `StaticArrays`
but owned by `StaticArraysCore`; that adds `StaticArraysCore` to the test
dependencies.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant