Skip to content

Fix plot idxs dimension check to use transform output arity - #660

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-plot-mixed-dims
Sep 26, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-plot-mixed-dims

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Same fix as SciMLBase#1609 for the copy of the plot helpers that SciMLBase PR #1305 intends to delegate to: stop asserting length(var) - 1 == dims on idxs input arity; check each transform's output coordinate count and throw ArgumentError when series genuinely disagree (2-D vs 3-D).

Follow-up (independent review #1): (1) short-label branch now also requires x[1] === DEFAULT_PLOT_FUNC so (adder,0,3,4) stays "f(t,u[3],u[4])". (2) deleted probe helpers; dims come from evaluated map(f, ...) output (avoids MethodError/DomainError on transforms that used to plot).

Follow-up (independent review #2): restored the exported solplot_vecs_and_labels(dims, vars, plott, A) 4-arg signature (dims accepted and ignored; computed output dims count); deleted the orphan history comment; added a test calling the 4-arg form.

Part of SciML/DifferentialEquations.jl#360 — primary user-facing fix is SciML/SciMLBase.jl#1609.

Review follow-up: before (new tests on prior PR code)

Expression: labels == ["u[3]", "f(t,u[3],u[4])"]
 Evaluated: ["u[3]", "u[4]"] == ["u[3]", "f(t,u[3],u[4])"]

MethodError: no method matching (::var"#g#g##0")(::Int64, ::Int64)
  @ RecursiveArrayTools plot_series_output_dims ...
plot idxs ... (#360) |   13     2      1     16

Review follow-up: after

plot idxs with mixed input arity but matching output dims (#360) |   27     27  3.7s
Public API Tests |   49     49  (in GROUP=Core)

Test group tail (GROUP=Core via Pkg.test)

Test Summary:        | Pass  Total   Time
Linear Algebra Tests |   54     54  22.5s
Test Summary:         | Pass  Total  Time
SciMLStructures Tests |   53     53  6.5s
Test Summary:     | Pass  Total  Time
Measurement Tests |    2      2  0.1s
     Testing RecursiveArrayTools tests passed

Not verified

  • SciMLBase#1305 merge / that SciMLBase actually calls this RAT path after delegation.
  • Plots.jl end-to-end rendering of the CoupledSprings MWE.

What to push back on

  • Whether this should land before or after SciMLBase#1305 merges.
  • custom transforms (f,0,i) are now labelled f(t,u[i]) instead of u[i]; this is more accurate (e.g. (sq,0,3) plots u3²), but it is a visible label change.

Please ignore this draft until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: the plot helper in src/vector_of_array.jl (DiffEqArray/VectorOfArray recipes). The exported solplot_vecs_and_labels(dims, vars, plott, A) keeps its 4-argument signature and ignores dims. The logic is identical to the merged Fix plot idxs dimension check to use transform output arity SciMLBase.jl#1609. Visible change: custom transforms (f,0,i) are labelled f(t,u[i]) instead of u[i].
  • Evidence: the new tests fail before and pass after (rat | 49 49). Plotted data for existing forms is unchanged. The two red CI jobs (SciMLSensitivity Downstream Core1 and Core6) fail the same way on master: https://github.com/SciML/RecursiveArrayTools.jl/actions/runs/36085624927.
  • Independent review: Claude Code (Opus 5.5), three rounds. The final one, on 4df9547 (the current head), rated it low with high confidence, verdict MERGE. The one remaining nit is optional.
  • Merge: auto-merge candidate. It keeps RAT in step with the merged SciMLBase#1609.

Risk assessment and review coordination by 🤖 Claude Code (model: claude-opus-5-5[1m]), https://claude.ai/code/session_01NdFVhANTF4nepTbqYxjfRP

ChrisRackauckas and others added 3 commits September 23, 2026 09:58
Mirror the SciMLBase fix: assert plot-series consistency on each
transform's output length, not idxs input arity, and throw
ArgumentError when series genuinely mix 2-D and 3-D outputs.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.09.18-9a7762b
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/jobs/fix-SciMLBase-DE360/log.txt on amdci2.julia.csail.mit.edu
Mirror SciMLBase: require DEFAULT_PLOT_FUNC for short labels, and take
series dims from evaluated map(f, ...) output instead of probing with
integer 1s that break typed/domain-restricted transforms.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.09.18-9a7762b
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/jobs/fix-SciMLBase-DE360/log.txt on amdci2.julia.csail.mit.edu
The exported helper previously took (dims, vars, plott, A). Keep accepting
dims for compatibility and ignore it; plotted dims come from evaluated
series output. Add a regression call of the 4-argument form.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.09.18-9a7762b
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/jobs/fix-SciMLBase-DE360/log.txt on amdci2.julia.csail.mit.edu
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 26, 2026 13:01
@ChrisRackauckas
ChrisRackauckas merged commit 41d0012 into SciML:master Sep 26, 2026
44 of 46 checks passed
ChrisRackauckas referenced this pull request Sep 26, 2026
Agent-Harness: Claude Code
Agent-Model: claude-opus-5-5[1m]
Agent-Session: local Claude Code session 3cd6500a-1f81-46b5-ac0b-c466e15b6a53 on Chris's Mac (session ID, no URL)

Co-authored-by: Claude Opus 5.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