Skip to content

Fix Moshi bare-singleton deprecation warning on v2-backport - #1481

Merged
ChrisRackauckas merged 1 commit into
SciML:v2-backportfrom
ChrisRackauckas-Claude:cc/v2-moshi-singleton-depwarn
Jul 31, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:v2-backportfrom
ChrisRackauckas-Claude:cc/v2-moshi-singleton-depwarn

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

Fixes the precompilation warning reported at https://discourse.julialang.org/t/warning-in-scimlbase-about-continousclock/138534:

┌ SciMLBase
│  ┌ Warning: the bare singleton variant syntax `ContinuousClock` is deprecated, write `ContinuousClock()` instead (near .../SciMLBase/hLfdZ/src/clock.jl:4)
│  │   caller = eval at boot.jl:430 [inlined]
│  └ @ Core ./boot.jl:430
└

Root cause

Moshi v0.3.11 (Roger-luo/Moshi.jl#80, 2026-07-12) deprecated the bare singleton variant syntax inside @data and requires Name(). src/clock.jl on v2-backport declares ContinuousClock and SolverStepClock in the bare form, and the v2 compat entry Moshi = "0.3.6" resolves to v0.3.12, so every user on SciMLBase v2 now gets this warning on precompile. Only one warning shows because Base.depwarn dedupes on (caller frame, funcsym) — SolverStepClock has the same problem.

master (v3) is unaffected: Moshi was dropped entirely in 2837095 ("Replace Moshi with plain Julia structs for Clocks", v3.0.0). Verified — a fresh env with SciMLBase v3.40.0 precompiles clean.

Other Moshi users in the ecosystem (ModelingToolkitBase's MissingGuessValue / StructuralHint, SymbolicUtils' BasicSymbolicImpl) already use the explicit form, so this is the only offender.

Fix

ContinuousClock → ContinuousClock(), SolverStepClock → SolverStepClock(). The explicit form throws ArgumentError: missing fields in variant expression on Moshi < 0.3.11, so the compat floor moves to 0.3.11 alongside the syntax. All @match patterns in clock.jl already used Name() and are unchanged.

Test

Added a regression test that force-recompiles SciMLBase in a subprocess and asserts no deprecation output — the warning is emitted during macroexpansion, so it is invisible unless the package is actually recompiled.

Verified locally on Julia 1.11.9 with Moshi v0.3.12:

  • Reproduced the warning on released v2.155.1.
  • With the fix, Base.compilecache output is empty and clock behavior is identical (iscontinuous, issolverstepclock, isclock, iseventclock, is_discrete_time_domain, first_clock_tick_time, ==, hash, clock() all as before).
  • GROUP=Core Pkg.test() passes: Clocks | 38 pass, 1 broken (pre-existing), Remake | 4414 pass, full group green.
  • Confirmed the new test fails on the unpatched source: Expression: !(occursin("deprecated", output)) → Clocks | 37 pass, 1 fail, 1 broken.
  • Runic v1 --check clean on both changed files.

Note

Version bumped to 2.155.2. This needs a release off v2-backport to actually reach the users hitting it; if v2 is no longer being registered, the alternative answer for them is to upgrade to SciMLBase v3.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SwhhJmoj8GGx2i2vJ6Rnba

Moshi v0.3.11 deprecated the bare singleton variant syntax inside `@data`, so
precompiling SciMLBase v2 emitted

    Warning: the bare singleton variant syntax `ContinuousClock` is deprecated,
    write `ContinuousClock()` instead (near .../src/clock.jl:4)

Explicit `Name()` variants only parse on Moshi v0.3.11 or newer, so the compat
floor moves with the syntax.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI triage

Downstream CI finished with 3 failures. All three are pre-existing on v2-backport and unrelated to this change — none of them touch clocks or Moshi.

Job Verdict Evidence
StochasticDiffEq.jl/Interface3/1.10 pre-existing reproduced locally against released, unmodified SciMLBase v2.155.1
Catalyst/All/1 pre-existing same failure on #1452 (a comment-spelling-only PR)
StochasticDelayDiffEq.jl/All/1.10 pre-existing same failure on #1452

StochasticDiffEq — the only one not already red on #1452

test/utility_tests.jl:66,68, asserting a lazy W has not been materialized:

calc_W!: Test Failed at .../test/utility_tests.jl:66
  Expression: convert(AbstractMatrix, integrator.cache.nlsolver.cache.W) != concrete_W
   Evaluated: [-401.0 0.0; 0.0 -200.5] != [-401.0 0.0; 0.0 -200.5]

Reproduced locally on Julia 1.10.11 with StochasticDiffEq master + Pkg.add(name="SciMLBase", version="2.155.1") (the released version, no patch applied):

GROUP=Interface3 Pkg.test()
  Utility Tests | 10 pass, 2 fail
    calc_W!     |  4 pass, 2 fail
  calc_W!: Test Failed at .../utility_tests.jl:66
     Evaluated: [-401.0 0.0; 0.0 -200.5] != [-401.0 0.0; 0.0 -200.5]
  calc_W!: Test Failed at .../utility_tests.jl:68
     Evaluated: [-0.0024937655860349127, -0.004987531172069825] != [-0.0024937655860349127, -0.004987531172069825]

Byte-identical to CI. This is an OrdinaryDiffEqDifferentiation behavior change (calc_W! now materializes the concrete form for an array operator) and is independent of SciMLBase; StochasticDiffEq's own master CI has been red since 2026-05-12.

Catalyst / StochasticDelayDiffEq

Latest downstream releases expect v3-era APIs that v2 does not have:

  • UndefVarError: derivative_discontinuity! not defined in SciMLBase (ModelingToolkitBase, Catalyst extensions)
  • UndefVarError: stripunits not defined in DiffEqBase
  • UndefVarError: handle_callback_modifiers! not defined (StochasticDelayDiffEq precompile)

This is the expected consequence of running a legacy branch's downstream matrix against current releases. ModelingToolkitStandardLibrary.jl/Core/1.10 failed on #1452 but passes here, so there is some run-to-run noise in this matrix as well.

The Core group — which contains the clock tests, including the new regression test — passes.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 31, 2026 05:25
@ChrisRackauckas
ChrisRackauckas merged commit be12972 into SciML:v2-backport Jul 31, 2026
43 of 46 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