Fix Runic format check: add return in test/runtests.jl core_body()#218
Merged
ChrisRackauckas merged 3 commits intoJun 17, 2026
Merged
Conversation
The Runic Format Check on main fails because core_body()'s final expression (the Layers Tests @safetestset) is missing the explicit return that Runic requires. Add it to make the format check pass. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The grouped-tests v1.2 conversion (SciML#217) dropped LuxCUDA from the test [extras]/[targets]. The self-hosted GPU lane sets BACKEND_GROUP=CUDA, which makes test/shared_testsetup.jl do `using LuxCUDA`; without the dependency the GPU job errors with `ArgumentError: Package LuxCUDA not found in current path`. Re-add LuxCUDA (compat 0.3) to [compat], [extras], and the test target, using the correct registry UUID d0bbae9a-e099-4d5b-a835-1c6931763bda (the pre-conversion Project.toml had carried a typo'd UUID ...1c6931f17571). Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…import The Documentation build failed on two genuine bugs in the basic MNIST DEQ tutorial (both reproduce on `main`, independent of the test/Project.toml changes in this PR): 1. `DimensionMismatch` in the steady-state adjoint VJP. For a conv DEQ the rootfind state is a 4D array (e.g. `(13, 13, 64, 2)`). When the state has more than 50 elements, SciMLSensitivity's `SteadyStateAdjoint` takes the matrix-free `VecJacOperator` path and builds the operator from `vec(y)`, so it seeds the residual's pullback with a *flat* cotangent. Zygote's `ProjectTo` then rejects that flat cotangent when it is broadcast against the multi-dimensional `u` in the residual `y .- u`, raising `variable with size(x) == (13,13,64,2) cannot have a gradient with size(dx) == (21632,)`. The Core test suite never hit this because its conv states are <= 50 elements (dense-Jacobian path). Fix: compute the residual in flattened space, `reshape(vec(y) .- vec(u), size(u))` — a value-preserving no-op that keeps the broadcast operands consistent with the flat cotangent. 2. `UndefVarError: VCAB3`. The tutorial calls `VCAB3()` but only imports `OrdinaryDiffEq`, which (v7) no longer re-exports `VCAB3`. Added `OrdinaryDiffEqAdamsBashforthMoulton` to the docs project and an explicit `using OrdinaryDiffEqAdamsBashforthMoulton: VCAB3` in the tutorial. Verified locally on Julia 1.12: - Full `docs/make.jl` builds end-to-end (both MNIST `@example` blocks run; only a transient ColPrac linkcheck 429 from the sandbox differs from CI). - `GROUP=Core Pkg.test()` passes: Utils 11/11, Layers 1538/1538. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
Red checks on this branch / on
main:test/runtests.jl: the final expression ofcore_body()was missing the explicitreturnRunic requires.ArgumentError: Package LuxCUDA not found:LuxCUDAwas dropped from[extras]/test[targets]ofProject.tomlduring the v1.2 CI conversion (Canonical CI: grouped-tests.yml + root test/test_groups.toml #217).@examplefailures in the basic MNIST DEQ tutorial (reproduce onmain, independent of the test/Project.toml changes here).Fixes in this PR
Runic — ran Runic in-place on
test/runtests.jlto add thereturn.LuxCUDA test dep — restored
LuxCUDA(compat0.3) to[compat],[extras], and thetesttarget (correct registry UUIDd0bbae9a-e099-4d5b-a835-1c6931763bda).Documentation — fixed the two real tutorial bugs:
DimensionMismatch. For a conv DEQ the rootfind state is a 4D array ((13, 13, 64, 2)). When the state has > 50 elements, SciMLSensitivity'sSteadyStateAdjointtakes the matrix-freeVecJacOperatorpath and builds the operator fromvec(y), so it seeds the residual's pullback with a flat cotangent. Zygote'sProjectTothen rejects that flat cotangent when broadcast against the multi-dimensionaluin the residualy .- u, raisingvariable with size(x) == (13,13,64,2) cannot have a gradient with size(dx) == (21632,). The Core suite never hit this (its conv states are ≤ 50 elements → dense-Jacobian path). Fix insrc/layers.jl: compute the residual in flattened space,reshape(vec(y) .- vec(u), size(u))— a value-preserving no-op that keeps the broadcast operands consistent with the flat cotangent.UndefVarError: VCAB3. The tutorial callsVCAB3()but only importedOrdinaryDiffEq, which (v7) no longer re-exportsVCAB3. AddedOrdinaryDiffEqAdamsBashforthMoultontodocs/Project.tomlandusing OrdinaryDiffEqAdamsBashforthMoulton: VCAB3to the tutorial.Bumped version to
2.7.1(source behavior change).Local verification (Julia 1.12, the failing
1channel)docs/make.jlbuilds end-to-end:ExpandTemplates(both MNIST@exampleblocks, incl.train_model(NewtonRaphson(...))andtrain_model(VCAB3(), :deq)) →RenderDocument→ generatedtutorials/basic_mnist_deq/index.html. NoDimensionMismatch, noUndefVarError. (Only difference from CI: a transient ColPraclinkcheck429 rate-limit from the sandbox; re-running withlinkcheck=falsebuilds cleanly, exit 0.)GROUP=Core Pkg.test()passes: Utils 11/11, Layers 1538/1538.--check src test docs: exit 0.Please ignore until reviewed by @ChrisRackauckas.