Skip to content

Keep the system tspan through SDE structural simplification - #5091

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:tspan-root-followup
Sep 7, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:tspan-root-followup

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Ignore this PR until reviewed by @ChrisRackauckas.

The follow-up promised in #5085. That PR was confined to lib/ModelingToolkitBase so the root compat floor would not point at an unregistered version; ModelingToolkitBase v1.69.0 merged into General at 10:01Z today, so the root half can land now.

The gap

src/systems/systems.jl rebuilds the System field by field on the SDE-with-brownians __mtkcompile path rather than going through @set!, so it dropped the tspan field. Measured with ModelingToolkit loaded:

plain ODE mtkcompile keeps tspan:      (0.0, 5.0)
SDE-with-brownians mtkcompile tspan:   nothing

It carries tstops already; this adds tspan alongside it.

Why the MTKBase suite could not catch it

The offending method is MTKBase.__mtkcompile, defined in the root package. It only exists once ModelingToolkit itself is loaded, so lib/ModelingToolkitBase/test/system_tspan.jl passes on its own. Rather than duplicate that file, this runs it from the root InterfaceII group through @mtktestset, which does using ModelingToolkit before including it. That is exactly the context where the path is reachable.

Failing before, passing after

The suite, run with ModelingToolkit loaded, on this branch without the systems.jl line:

SDEProblem: Error During Test at lib/ModelingToolkitBase/test/system_tspan.jl:107
  Expression: (T(sys, op)).tspan == (0.0, 5.0)
SDEProblem: Error During Test at .../system_tspan.jl:111
  Expression: (T{true}(sys, op)).tspan == (0.0, 5.0)
SDEProblem: Error During Test at .../system_tspan.jl:112
  Expression: (T{true, SciMLBase.FullSpecialize}(sys, op)).tspan == (0.0, 5.0)
SDDEProblem: Error During Test at .../system_tspan.jl:107
  Expression: (T(sys, op)).tspan == (0.0, 5.0)
SDDEProblem: Error During Test at .../system_tspan.jl:111
  Expression: (T{true}(sys, op)).tspan == (0.0, 5.0)
SDDEProblem: Error During Test at .../system_tspan.jl:112
  Expression: (T{true, SciMLBase.FullSpecialize}(sys, op)).tspan == (0.0, 5.0)

Six failures, SDEProblem and SDDEProblem across the three specialization forms. With the line restored:

`tspan` is stored on and retrieved from the system       |    8      8   3.9s
Problem constructors default to the system's `tspan`     |   32     32  36.0s
Omitting `tspan` for a system without one errors         |   16     16   0.5s
`MissingTspanError` message names the system and the fix |    2      2   0.0s
EXIT 0

Runic --check . and typos both exit 0.

Not verified

  • The full root InterfaceII group was not run end to end locally; I ran the file this PR adds to it, in the same using ModelingToolkit context the group uses. CI covers the rest.
  • Julia LTS and prerelease, and the downgrade configuration, were not run locally.

Versions

ModelingToolkit 11.41.0 → 11.42.0, and its ModelingToolkitBase floor 1.64 → 1.69. The floor bump is required, not cosmetic: src/systems/systems.jl now passes tspan = to the System constructor, which only accepts it from 1.69.0.

Downstream packages that want to rely on a system carrying its own timespan should depend on ModelingToolkit 11.42.0 rather than 11.41, since an 11.41 user can resolve ModelingToolkitBase 1.68 and not have the field at all.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu

The SDE-with-brownians __mtkcompile path rebuilds the System field by
field rather than through @set!, so it dropped the tspan field added in
SciML#5085. Carry it, raise the ModelingToolkitBase floor to the version that
has the field, and run the tspan suite from the root InterfaceII group,
where ModelingToolkit is loaded and this path is reachable.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Agent-Harness: Claude Code 2.1.263
Agent-Model: claude-opus-5
Agent-Session: https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu
Claude-Session: https://claude.ai/code/session_01H5RuLDtEazwTKPkNbPeZVu
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 7, 2026 11:06
@ChrisRackauckas
ChrisRackauckas merged commit 0d84380 into SciML:master Sep 7, 2026
81 of 84 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 10, 2026
- Keep the system tspan through SDE structural simplification (#5091)
- Fixes to better support 32-bit builds (#5060)
- Add 32-bit InterfaceI CI lane via test_groups.toml (#5092)
- Mark `InitializationMetadata` inactive for Enzyme (#5094)
- Require Symbolics 7.39.1 (32-bit hash fix) (#5096)
- Qualify unbound_inputs @ref in the interactive simulation tutorial (#5099)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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