Skip to content

Fix Runic format check: add return in test/runtests.jl core_body()#218

Merged
ChrisRackauckas merged 3 commits into
SciML:mainfrom
ChrisRackauckas-Claude:fix-runtests-runic-format
Jun 17, 2026
Merged

Fix Runic format check: add return in test/runtests.jl core_body()#218
ChrisRackauckas merged 3 commits into
SciML:mainfrom
ChrisRackauckas-Claude:fix-runtests-runic-format

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Red checks on this branch / on main:

  1. Runic Format Checktest/runtests.jl: the final expression of core_body() was missing the explicit return Runic requires.
  2. GPU TestsArgumentError: Package LuxCUDA not found: LuxCUDA was dropped from [extras]/test [targets] of Project.toml during the v1.2 CI conversion (Canonical CI: grouped-tests.yml + root test/test_groups.toml #217).
  3. Documentation — two genuine @example failures in the basic MNIST DEQ tutorial (reproduce on main, independent of the test/Project.toml changes here).

Fixes in this PR

Runic — ran Runic in-place on test/runtests.jl to add the return.

LuxCUDA test dep — restored LuxCUDA (compat 0.3) to [compat], [extras], and the test target (correct registry UUID d0bbae9a-e099-4d5b-a835-1c6931763bda).

Documentation — fixed the two real tutorial bugs:

  • Steady-state adjoint DimensionMismatch. For a conv DEQ the rootfind state is a 4D array ((13, 13, 64, 2)). When the state has > 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 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 suite never hit this (its conv states are ≤ 50 elements → dense-Jacobian path). Fix in src/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 calls VCAB3() but only imported OrdinaryDiffEq, which (v7) no longer re-exports VCAB3. Added OrdinaryDiffEqAdamsBashforthMoulton to docs/Project.toml and using OrdinaryDiffEqAdamsBashforthMoulton: VCAB3 to the tutorial.

Bumped version to 2.7.1 (source behavior change).

Local verification (Julia 1.12, the failing 1 channel)

  • Full docs/make.jl builds end-to-end: ExpandTemplates (both MNIST @example blocks, incl. train_model(NewtonRaphson(...)) and train_model(VCAB3(), :deq)) → RenderDocument → generated tutorials/basic_mnist_deq/index.html. No DimensionMismatch, no UndefVarError. (Only difference from CI: a transient ColPrac linkcheck 429 rate-limit from the sandbox; re-running with linkcheck=false builds cleanly, exit 0.)
  • GROUP=Core Pkg.test() passes: Utils 11/11, Layers 1538/1538.
  • Runic --check src test docs: exit 0.

Please ignore until reviewed by @ChrisRackauckas.

ChrisRackauckas and others added 3 commits June 15, 2026 10:09
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>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 17, 2026 10:49
@ChrisRackauckas ChrisRackauckas merged commit c2e8431 into SciML:main Jun 17, 2026
10 of 11 checks passed
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