Skip to content

Make Makie timeseries recipes Observable-aware - #1589

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:grok/makie-observable-sol-1588
Sep 7, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:grok/makie-observable-sol-1588

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Please ignore this PR until it is reviewed by @ChrisRackauckas.

Makie was skipping the SciML timeseries recipe for two independent reasons, both of which made plot(osol) look frozen when osol[] was updated.

  1. Scalar ODESolution <: AbstractVector{<:Real}, so Makie's expand_dimensions(::PointBased, ::RealVector) turned plot(sol) into Lines of indices vs values and rejected idxs.
  2. The first step! replaces integrator.sol with a new wrapper that shares the mutated t/u arrays. Makie 0.24 ComputePipeline.is_same then returns isequal, which is true, and skips reconversion. Wrapping the Observable after the first step already reconverted (same-object mutation); wrapping at init did not.

This PR opts those types out of PointBased index expansion and forces is_same to false so an Observable assignment always reconverts.

What this does not change. Axis autolimits still do not follow a PlotList data update. The MRE in #1588 wraps after the first step, so converted points already grew; record looks frozen because the first displayed frame called reset_limits! around [0,1] and later frames did not. empty!(ax); plot!(osol) works because plot! on an open Axis resets limits. After this PR, call autolimits!(ax) (or reset_limits!(ax)) if the window should grow with the series. That is a Makie PlotList issue, not missing reconversion.

Verification

Discriminating tests in test/downstream/plot_lines.jl. Fail-before on unfixed SciMLBaseMakieExt (SciMLBase 3.53.1, Makie 0.24.14, OrdinaryDiffEq 7.8.1):

Makie scalar ODESolution plots time, not indices:
  plt isa Makie.PlotList
  Evaluated: Lines{Tuple{Vector{Point{2, Float64}}}} isa PlotList
  plot(scalar_sol; idxs = 1) -> Invalid attribute idxs for plot type Lines

Makie Observable of integrator.sol tracks steps:
  plotted_xend(plt) ≈ integ.t   # wrap at init, after step 1
  Evaluated: 0.0 ≈ 1.0
  plotted_xend(plt) ≈ integ.t   # wrap at init, after step 2
  Evaluated: 0.0 ≈ 2.0
  # wrap-after-first-step already passed (same-object mutation)

Test Summary:                                      | Pass  Fail  Error  Total  Time
fail-before #1588                                  |    4     3      1      8  23.7s
  Makie scalar ODESolution plots time, not indices |           1      1      2  13.5s
  Makie Observable of integrator.sol tracks steps  |    4     2             6  10.2s

Pass-after with the extension restored (same tests, then the official test/downstream/plot_lines.jl):

fail-before #1588 | 10 passed / 10  20.2s

Plots recipe on multi-state ODESolution                  3 / 3
Makie convert_arguments on multi-state ODESolution       1 / 1
Makie scalar ODESolution plots time, not indices         4 / 4
Makie Observable of integrator.sol tracks steps          6 / 6
tspan crops the plotted series                           8 / 8
tspan crops solutions integrated backwards in time       2 / 2
Integrator recipe without symbolic metadata              9 / 9
Integrator recipe resolves observed equations           22 / 22
symbolic_interpolation on an integrator                  7 / 7

Runic 1.10.0 formatted the changed files. typos was clean. ExplicitImports on SciMLBaseMakieExt (all 6 checks) passed after allow-listing expand_dimensions, ComputePipeline, and is_same as Makie recipe plumbing.

What was not verified

  • Full GROUP=Downstream (only plot_lines.jl).
  • GROUP=QA as Pkg.test(): Aqua passed; the run then died at using PythonCall in test/qa/qa.jl:71 (pixi/CondaPkg ProcessExited(1) during PythonCall.C init). That is before ExplicitImports. Targeted ExplicitImports on the Makie extension passed.
  • Docs build: no public API or docstring change.
  • GLMakie record / interactive display. Converted-data assertions used Makie/CairoMakie without a GL backend.
  • Makie 0.21–0.23. expand_dimensions is used there; the is_same override is gated on isdefined(Makie, :ComputePipeline) (0.24).
  • GPU / allowed-to-fail jobs.

Review notes

  • ComputePipeline.is_same is not public Makie API. It is the 0.24 hook for "this value may have mutated / an isequal wrapper is not the same plot." Older Makie is skipped via isdefined.
  • Judgment call: leave Axis autolimits to Makie rather than empty!/plot! from the recipe.

Please ignore this PR until it is reviewed by @ChrisRackauckas.

🤖 Generated with Grok Build TUI (model: grok-4.6)
Session: local /home/crackauc/.grok/sessions/%2Fhome%2Fcrackauc%2Fsandbox%2Ftmp_20260907_062232_52914/01a07b3f-05bc-77d1-9346-1f1581b8129f

Scalar `ODESolution` is an `AbstractVector{<:Real}`, so Makie's
`expand_dimensions(::PointBased, ::RealVector)` plotted indices instead of
time and rejected `idxs`. `step!` also replaces the solution wrapper with an
`isequal` copy that ComputePipeline treated as unchanged, so an `Observable`
assigned at `init` never reconverted.

Addresses SciML#1588

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Grok <[email protected]>
Agent-Harness: Grok Build TUI
Agent-Model: grok-4.6
Agent-Session: local /home/crackauc/.grok/sessions/%2Fhome%2Fcrackauc%2Fsandbox%2Ftmp_20260907_062232_52914/01a07b3f-05bc-77d1-9346-1f1581b8129f
Comment thread ext/SciMLBaseMakieExt.jl
Comment on lines +18 to +28
if isdefined(Makie, :ComputePipeline)
function Makie.ComputePipeline.is_same(
::SciMLBase.AbstractTimeseriesSolution,
::SciMLBase.AbstractTimeseriesSolution
)
return false
end
function Makie.ComputePipeline.is_same(
::SciMLBase.DEIntegrator,
::SciMLBase.DEIntegrator
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehh kind of a hack, but hopefully not too much.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 7, 2026 14:16
@ChrisRackauckas
ChrisRackauckas merged commit 97c4068 into SciML:master Sep 7, 2026
69 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 7, 2026
DEIntegrator is not an AbstractVector and same-object mutation already
invalidates ComputePipeline, so those overrides were dead weight. Add a
scalar Observable(sol) test that covers both #1588 failure modes together.

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Sep 10, 2026
- Compare solution parameter cotangents against the solution's own parameters (#1587)
- Make Makie timeseries recipes Observable-aware (#1589)
- Add 32-bit Core CI lane via test_groups.toml (#1590)
- Trim unused Makie DEIntegrator hooks after #1589 (#1591)
- Keep 32-bit CI lane hard-failing. (#1593)
- Avoid broadcast-based getproperties on SciML functions. (#1595)



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