Skip to content

test: drop LuxTestUtils dependency from test suite - #163

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-drop-luxtestutils
Aug 27, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-drop-luxtestutils

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the failing Core test CI on prerelease Julia lanes (e.g. julia pre / 1.13.0-rc, see failing run).

Root cause: LuxTestUtils (all 1.x/2.x releases compatible with our current compat bounds) unconditionally skips using Enzyme on prerelease Julia versions via @static if isempty(VERSION.prerelease) in LuxTestUtils.jl, but its autodiff.jl still references Enzyme.ReverseMode in a method signature unconditionally. On a prerelease Julia (e.g. 1.13.0-rc3), this raises UndefVarError: Enzyme not defined in LuxTestUtils and fails precompilation of the whole LuxTestUtils package, which breaks test/shared_testsetup.jl (and therefore every Core testset) since it's just used there.

Pinning to an older LuxTestUtils release doesn't help either: the versions old enough to predate this bug (<=1.7.2) can't resolve alongside our current ForwardDiff/Optimisers compat bounds without hitting an unrelated Tracker/Optimisers conflict.

We only used LuxTestUtils.check_approx (a small recursive approximate-equality helper for NamedTuple/Tuple/AbstractArray gradient structures), so this PR drops the dependency entirely and inlines an equivalent local implementation in test/shared_testsetup.jl.

Changes

  • test/shared_testsetup.jl: replace using LuxTestUtils: check_approx with a small local check_approx implementation.
  • test/Project.toml, test/gpu/Project.toml: remove the now-unused LuxTestUtils dep/compat entries.

Test plan

Ran the affected Core testsets locally (Julia 1.12.4, since a Julia 1.13 prerelease toolchain wasn't available in this environment to directly reproduce the CI failure) after applying this fix — all pass, including the check_approx gradient comparisons:

  • test/models/fno_tests.jl: Fourier Neural Operator — 14/14 passed
  • test/models/deeponet_tests.jl: DeepONet — 10/10 passed
  • test/models/nomad_tests.jl: NOMAD — 10/10 passed
  • test/layers/spectral_conv_tests.jl: SpectralConv — 12/12 passed
  • test/layers/spectral_kernel_tests.jl: SpectralKernel — 14/14 passed

Also confirmed Pkg.resolve()/Pkg.instantiate() succeed for test/ and test/gpu/ environments with LuxTestUtils removed (previously, forcing an older LuxTestUtils compat bound produced an unsatisfiable Tracker/Optimisers resolution error).

LuxTestUtils >=1.0 unconditionally skips `using Enzyme` on prerelease
Julia versions (`@static if isempty(VERSION.prerelease)`), but still
references `Enzyme.ReverseMode` in a method signature, which raises
`UndefVarError: Enzyme not defined` and breaks precompilation of
LuxTestUtils itself on Julia prereleases such as 1.13.0-rc, failing
the whole Core test group. Pinning to an older 1.x release does not
help either: resolving LuxTestUtils to any version compatible with our
ForwardDiff/Optimisers compat bounds still lands on a release with the
same bug, or hits an unrelated Tracker/Optimisers resolution conflict.

We only used `LuxTestUtils.check_approx`, so replace it with a small
local implementation in `shared_testsetup.jl` and drop the dependency
entirely.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title test: drop LuxTestUtils prerelease from test extras test: drop LuxTestUtils dependency from test suite Aug 26, 2026
@ChrisRackauckas
ChrisRackauckas merged commit 6e88553 into SciML:main Aug 27, 2026
15 of 16 checks passed
Wodlfvllf pushed a commit to Wodlfvllf/NeuralOperators.jl that referenced this pull request Sep 1, 2026
LuxTestUtils >=1.0 unconditionally skips `using Enzyme` on prerelease
Julia versions (`@static if isempty(VERSION.prerelease)`), but still
references `Enzyme.ReverseMode` in a method signature, which raises
`UndefVarError: Enzyme not defined` and breaks precompilation of
LuxTestUtils itself on Julia prereleases such as 1.13.0-rc, failing
the whole Core test group. Pinning to an older 1.x release does not
help either: resolving LuxTestUtils to any version compatible with our
ForwardDiff/Optimisers compat bounds still lands on a release with the
same bug, or hits an unrelated Tracker/Optimisers resolution conflict.

We only used `LuxTestUtils.check_approx`, so replace it with a small
local implementation in `shared_testsetup.jl` and drop the dependency
entirely.

Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants