Skip to content

Document and test wrapping the integrator solution with wrap_sol - #747

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/issue-332-integrator-solution
Nov 26, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/issue-332-integrator-solution

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

Docs and test for wrapping the integrator solution with SciMLBase.wrap_sol (issue #332).

init/step! leave the plain DAESolution in integ.sol, so PDE-level indexing (integ.sol[u(t, x)], integ.sol[x]) throws "Symbol ... is not present in the system". SciMLBase.wrap_sol(integ.sol) returns the usual PDETimeSeriesSolution. This adds a docs section on stepping with the integrator interface and a Sol_Interface testset (1D heat equation). GROUP=Sol_Interface passes (524/524).

Refs #332. This does not make integ.sol itself wrapped; that needs a hook in the integrator, outside this package.

🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1

xtalax and others added 2 commits November 26, 2026 12:40
…p_sol

init and step! leave the unwrapped solution in integ.sol, so PDE-level
indexing such as integ.sol[u(t, x)] fails. Document wrapping it with
SciMLBase.wrap_sol and cover that in the Sol_Interface tests (SciML#332).

Agent-Harness: Claude Code 2.1.325
Agent-Model: claude-sonnet-5-5
Agent-Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
… integrator docs

Agent-Harness: Claude Code 2.1.325
Agent-Model: claude-sonnet-5-5
Agent-Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1
Agent-Review: unreviewed
Co-authored-by: Claude Code <[email protected]>
@xtalax-droid

Copy link
Copy Markdown
Contributor Author

The underlying limitation (integrators created with init/step! do not wrap the solution for PDE discretizations) is now tracked upstream: SciML/SciMLBase.jl#1674. Until a hook exists there, the documented workaround is SciMLBase.wrap_sol(integ.sol).


🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: 6c520c71-764b-4a7e-a484-62d5a95bcfa1

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #747

Reviewed head: 3ceb1df
Raw SHA-256: 2d00e2b3fa581243e45221a314299ad108db200140fefe0639e37ccad0517628
Source SHA-256: 2d4404557596aaddc4df2bd675531be40331c424bf268b99089b3044be9ae979
Source: standard-review-v1 (harness-log)
Reviewer session: 01a2186c-c037-7662-bf7f-3cc9d7db4513
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: low (L1)
  • Verdict: MERGE
  • Reviewed head: 3ceb1df

Review report

VERDICT: MERGE
Round: 1
Head: 3ceb1df
Slot: 1
CI: green
Session: 01a2186c-c037-7662-bf7f-3cc9d7db4513
Reviewer: codex-cli 0.170.0; model: gpt-6.2-sol

Risk

low (L1: solution guide prose and an additive test of existing integrator behavior)

Blocking findings

  • Blocking priorities: none

Non-blocking findings

  • docs/src/solutions.md:75 — Explain why the wrapper should be refreshed after stepping. In the two-step probe, the first DAE wrapper grew from 18 to 20 saved times while its field array retained 18 rows. The ODE wrapper grew from 3 to 5 saved times while its field array retained 3 rows. Both wrappers shared the integrator's time vector. The guide already tells readers to discard the first wrapper.

    Implementation fix: Replace the final paragraph in “Stepping with the integrator interface” with “The wrapped field arrays and interpolants contain the samples saved when you called wrap_sol. The time axis sol[t] can grow as the integrator saves more samples. After stepping, create a fresh wrapper before inspecting PDE data.” In Test 14 of test/Sol_Interface/solution_interface.jl:310, take a copy of the first field array, step again, and rewrap integ.sol. Assert that the refreshed times match the raw saved times, the refreshed field has one row per saved time, and its initial rows equal the saved copy.

What I ran

  • GROUP=Sol_Interface JULIA_PKG_PRECOMPILE_AUTO=0 julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()' on Julia 1.12.4 printed Sol_Interface | 524 524 and Testing MethodOfLines tests passed.
  • A 2D DAE and ODE probe in the resolved test environment passed 48/48 checks. It exercised raw symbol lookup, rewrapping after a second step, and save_everystep=false. A manufactured heat solution quadratic in each spatial coordinate gave maximum field errors of 1.33e-11 for the DAE and 2.76e-10 for the ODE. An affine probe with nonzero corner data failed six analytic checks. A diagnostic isolated all discrepancies at the tested endpoint to four corners, where native, partially wrapped, and completed solutions all returned zero, consistent with array_corner_eqs in src/discretization/discretize_equations.jl.
  • Julia reported public=true and documented=true for SciMLBase.wrap_sol on 3.48.0 and 3.58.0. The heat tutorial imports exposed init, step!, and SciMLBase.
  • Documenter rendered the changed page to HTML with the new stepping section. The full julia --startup-file=no --project=docs docs/make.jl run reached ExpandTemplates. I stopped it after 65 minutes while it was evaluating the unchanged UDE example.
  • julia -m Runic --check test/Sol_Interface/solution_interface.jl, the diff piped to typos -, and git diff --check origin/master...HEAD each exited 0. uv run --locked python --version reported Python 3.13.13 and warned that there was no active Python project. The checkout has no uv.lock.

What I did not verify

Full-site documentation build, other test groups and Julia versions, and CI beyond the supplied status.

AUTHOR_GRADE: {"task":"docs","score":4,"difficulty":2,"rounds":1,"author_harness":"Claude Code 2.1.325","author_model":"claude-sonnet-5-5","note":"The affected suite and independent DAE and ODE probes pass. The guide can be more precise about the live saved-time vector."}

Head link: 3ceb1df


🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a2186c-c037-7662-bf7f-3cc9d7db4513 (no session URL)

@ChrisRackauckas
ChrisRackauckas merged commit 3fd9cb7 into SciML:master Nov 26, 2026
91 checks passed
ChrisRackauckas referenced this pull request Nov 26, 2026
Bump version to 1.7.0
Bump version to 1.7.0

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: AI agent <[email protected]>
Agent-Harness: hourly_releases
Agent-Model: none (deterministic)
Agent-Session: local job hourly-release-a8196c0d-e4da-4761-a5ea-083bedf7f947 (no session URL)
Agent-Session: local job hourly-release-cd233b8b-1693-433c-8d21-4c21ffddc425 (no session URL)
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.

4 participants