Skip to content

Make the mixed-derivative precompile workload reach corner extrapolation - #751

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/perf-precompile-mixed-corners
Nov 27, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
xtalax-droid:forge/perf-precompile-mixed-corners

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

The mixed-derivative precompile workload added in #750 used four interior points per axis, which is too few for the five interior taps in array_corner_extrapolation, so it took the zero-corner branch and never compiled corner extrapolation. Its data also did not satisfy the equation at the boundary. This is the non-blocking note from the review of #750: #750 (comment)

Changes:

  • src/precompile.jl: the mixed-derivative workload now uses x => 9, y => 9 and the initial and four face values of g(t,x,y) = x^2*y + 2t, which solves Dt(u) = Dxxy(u).
  • test/Mixed_Derivatives/MOL_Mixed_Deriv.jl: a guard that builds the symbolic ODE for that same fixture and asserts the initial right-hand side is 2 at all 49 interior points, to within 1e3 * eps() * h^-3. It passes on current master too, since it checks the discretization rather than the workload.

User-visible behaviour is unchanged; only what gets precompiled differs.

Measured on Julia 1.12.1, AMD Ryzen AI Max+ 395, 32 threads. Before is upstream/master (8fc8093), after is this branch. First discretize in a fresh process (3 runs each, median, import excluded):

system before after
mixed_derivs2d (21 points per axis) 3.44 s 2.87 s
mixed 9x9 with g data 3.39 s 2.52 s
heat3d_dirichlet 3.16 s 2.92 s
grayscott2d_neumann 3.01 s 2.84 s

The latency gain from #750 is kept and slightly extended. Cost, one run each of Base.compilecache with dependencies cached: 139.7 s before, 131.8 s after (within run-to-run noise); image 167.4 MB before, 167.2 MB after; peak RSS 6.39 GB before, 6.34 GB after; using MethodOfLines median of 5 is 0.86 s before, 0.91 s after.

Verification: GROUP=Mixed_Derivatives (8 pass, 1 existing broken), GROUP=QA (21 pass) and GROUP=Components pass; Runic --check clean.

🤖 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 27, 2026 04:23
g = x^2 y + 2t solves Dt(u) = Dxxy(u), so the initial right-hand side is 2 at every
interior point of a nine-point grid, which has enough interior taps for corner
extrapolation.

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]>
Four interior points per axis are too few for the five interior taps of
array_corner_extrapolation, so the workload took the zero-corner branch. Use nine
points per axis and data from g = x^2 y + 2t, which solves the equation.

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

Correction: the link in the description to the review note on #750 is wrong (the comment id in it does not exist). The review comment it refers to is #750 (comment) .


🤖 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: #751

Reviewed head: 89a6ea1
Raw SHA-256: 25d6ccefef6387b01ccb7caacdc9cb436dc94b7a200c76da23c1cf54a2864d9f
Source SHA-256: 875cad2a122a3f467959ebe4b6055942096731383111e4b825c4fc92655cb2ec
Source: standard-review-v1 (harness-log)
Reviewer session: 01a21ba7-efc8-7a73-a135-3e0087d7767e
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: low (L2)
  • Verdict: MERGE
  • Reviewed head: 89a6ea1

Review report

VERDICT: MERGE
Round: 1
Head: 89a6ea1
Slot: 1
CI: green
Session: 01a21ba7-efc8-7a73-a135-3e0087d7767e
Reviewer: codex-cli 0.170.0; model: gpt-6.2-sol

Risk

low (L2: expands precompile and test coverage of existing mixed-derivative corner extrapolation)

Blocking findings

  • Blocking priorities: none

Non-blocking findings

  • test/Mixed_Derivatives/MOL_Mixed_Deriv.jl:99 — The manufactured solution is zero at three corners at the checked time. With only the lower-left corner pinned to zero, the shipped test still passed both assertions. Adding a constant of 1 gave a maximum RHS error of 0.0 with normal extrapolation and errors of 256.0 to 512.0 when I pinned each corner to zero individually. Implementation fix. Add 1 to g(t, x, y) in this testset and in the mixed Dirichlet precompile workload at src/precompile.jl:83. Keep the 49-state assertion and the existing roundoff bound for every RHS entry against the analytic value of 2. The updated assertion should fail for each independent corner mutation.

What I ran

  • GROUP=Mixed_Derivatives julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()' on Julia 1.12.4. The package precompiled and the group reported 8 Pass, 1 Broken, 9 Total and Testing MethodOfLines tests passed. The broken case is an unchanged @test_broken in the group. The precompile log flagged one dependency as retryable before the test process completed.
  • julia --startup-file=no --project=base probes.jl base against the merge base with the same resolved dependencies. The original package precompiled and the new test passed 2/2 there as well.
  • julia --startup-file=no --project=head probes.jl variants. The new fixture constructed an 81-entry problem through discretize and a 49-state ODE through symbolic_discretize and mtkcompile. The manufactured RHS error was 0.0 at both times checked. On the asymmetric 8×11 grid with a negative analytic RHS, the maximum error was 6.82e-13. With the manufactured data and 0.2 spacing, the error was 62.5.
  • julia --startup-file=no --project=head probes.jl mutation. Disabling all corner extrapolation produced one pass and one failure in the shipped test. The RHS error was 256.0 against the 1.1368683772161603e-10 bound. Both single-corner probe scripts exited successfully after checking the outcomes reported above.
  • git diff --check origin/master...HEAD exited 0. The checkout remained clean.
  • uv run --locked python --version returned Python 3.13.13 and warned that --locked has no effect outside a project.

What I did not verify

Other Julia versions, other test groups, and controlled precompile timing. A project-locked Python environment was unavailable because the checkout has no uv.lock.

AUTHOR_GRADE: {"task": "test", "score": 4, "difficulty": 2, "rounds": 1, "author_harness": "Claude Code 2.1.325", "author_model": "claude-sonnet-5-5", "note": "The affected group passed and the analytic RHS assertion caught disabled extrapolation. The fixture let an isolated lower-left corner failure escape."}

Head link: 89a6ea1


🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a21ba7-efc8-7a73-a135-3e0087d7767e (no session URL)

@ChrisRackauckas
ChrisRackauckas merged commit ee319ec into SciML:master Nov 27, 2026
91 checks passed
ChrisRackauckas referenced this pull request Nov 27, 2026
Bump version to 1.7.1

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: AI agent <[email protected]>
Agent-Harness: Codex Desktop 0.171.0-alpha.13.2 via SciMLFactory hourly_releases
Agent-Model: gpt-6.2-astra
Agent-Session: local session 01a21e76-5645-7482-9bea-5d2c148f14ff (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