Skip to content

Master CI red: increment!! MethodError in steady_state.jl with Mooncake on Julia 1.12 #1443

@ChrisRackauckas-Claude

Description

@ChrisRackauckas-Claude

Summary

master CI has been red since at least 2026-03-13 (last known green) on the Core6, 1 job (Julia 1.12.6, ubuntu-latest). The failing tests are steady_state.jl testsets iip (line 393) and NonlinearProblem (line 600).

Latest failing run: https://github.com/SciML/SciMLSensitivity.jl/actions/runs/25556534907

Failure mode

In test/steady_state.jl, compute_gradient is dispatched to Mooncake on Julia 1.12+ (lines 9-13). The Mooncake-based gradient call fails with:

MethodError: no method matching increment!!(
    ::Mooncake.RData{@NamedTuple{u::Mooncake.NoRData, resid::Mooncake.NoRData,
                                  prob::Mooncake.NoRData,
                                  alg::Mooncake.RData{@NamedTuple{
                                      alg::Mooncake.RData{@NamedTuple{
                                          linsolve::Mooncake.NoRData,
                                          step_limiter!::Mooncake.NoRData,
                                          stage_limiter!::Mooncake.NoRData,
                                          autodiff::Mooncake.NoRData,
                                          concrete_jac::Mooncake.NoRData,
                                          max_jac_age::Mooncake.NoRData,
                                          jac_reuse_gamma_tol::Float64}},
                                      tspan::Float64}},
                                  ...}},
    ::Mooncake.NoRData)

Closest candidates are:
  increment!!(::Mooncake.ZeroRData, ::R) where R
  increment!!(::R, ::Mooncake.ZeroRData) where R
  increment!!(::T, ::T) where T

The diagnostic detail: the RData carries genuine Float64 leaves (e.g. jac_reuse_gamma_tol::Float64, tspan::Float64) deep inside a deeply nested NamedTuple, while the other operand is NoRData. Mooncake's increment!! doesn't have a method for (::RData{<:NamedTuple{...,Float64,...}}, ::NoRData) — it only has the (ZeroRData, R), (R, ZeroRData), and (T, T) cases.

Versions in failing run

  • Julia 1.12.6
  • Mooncake v0.5.28
  • SciMLSensitivity master (052d896)

Why this isn't an obvious recent regression

Master has been red on this job since 2026-03-13. The compat Mooncake = "0.5.24" (in Project.toml) resolves to 0.5.x, currently 0.5.28. Earlier failures (e.g. 2026-04-22 run 24765542004) failed for unrelated DI install reasons that were since fixed; the current failure mode (increment!! MethodError on the nested RData) is the steady-state failure that's now exposed.

Mooncake 0.5.27 (release notes) included PR #1133 titled "Fix tangent_type for Union{NoRData, RData{...}}" — possibly related, but I have not bisected to confirm.

Possible fixes

  1. Upstream (Mooncake): add increment!!(::RData{NT}, ::NoRData) (and the reverse) when NT contains <:Number leaves, by recursing and treating the NoRData operand as a no-op zero. This is the right long-term fix.
  2. Workaround in SciMLSensitivity: define a Mooncake rrule!! for the entry points that produces a tangent type with consistent leaves (no mixed Float64/NoRData at deep struct fields), e.g. via a Mooncake @is_primitive annotation on the steady-state adjoint API surface.
  3. Pin Mooncake compat: unclear whether any Mooncake 0.5.x version actually passes; needs bisect first.

Recommended next step

Bisect: try Mooncake 0.5.24 → 0.5.28 against an unmodified master checkout to identify exactly which Mooncake version this failure first appeared in. Then file the upstream Mooncake issue with a minimized reproducer (probably 30 lines: SteadyStateProblem + DynamicSS(Rodas5()) + Mooncake.value_and_gradient!! over the solve).

I have not opened a Mooncake upstream issue yet — chalk-lab is not a SciML-org repo and per maintainer policy requires explicit permission. Once we have a minimized reproducer, that should be the next step.


cc @ChrisRackauckas

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions