Skip to content

docs: note the first-call cost of fuse_broadcasts = true - #746

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
xtalax-droid:forge/issue-737-fuse-broadcasts
Nov 26, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
xtalax-droid:forge/issue-737-fuse-broadcasts

Conversation

@xtalax-droid

Copy link
Copy Markdown
Contributor

Documents the trade-off raised in #737 for discretize(...; fuse_broadcasts = true): it lowers the cost of every residual call but lengthens the first call, so it stays off by default. The paragraph in docs/src/MOLFiniteDifference.md gives the measured table for the Brusselator at dx = 1/8 and a break-even in residual evaluations.

Docs only; no code or default changed.

🤖 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 3 commits November 26, 2026 12:24
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]>
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]>
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]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

PR: #746

Reviewed head: c9fd051
Raw SHA-256: 039c1d13826e0f359d777e561ca7373fb1add01f05bf82ab3f3ed870883013ff
Source SHA-256: fb4eceac4838dd4c617f264e9729c13575e3130969474bab386e7367b8cfe77b
Source: standard-review-v1 (harness-log)
Reviewer session: 01a2187f-e4dd-7133-addb-de38febb572e
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: c9fd051

Review report

VERDICT: MERGE
Round: 1
Head: c9fd051
Slot: 1
CI: green
Session: 01a2187f-e4dd-7133-addb-de38febb572e
Reviewer: codex-cli 0.170.0; model: gpt-6.2-sol

Risk

low (L1: one manual page describing an existing residual code-generation option)

Blocking findings

  • Blocking priorities: none

Non-blocking findings

  • docs/src/MOLFiniteDifference.md:74 and docs/src/MOLFiniteDifference.md:86 — Scope the fusion description and compile-cost guidance. Symbolics documents fusion for elementwise array expressions. In separate Julia processes the first sweep added 22 s at dx = 1/8 and 41 s at dx = 1/16. A repeat added about 40 s at both spacings. The timing is sensitive to the run conditions, and the grid sweep alone leaves the cause of the observed compile cost undetermined.

    Implementation fix: In the manual, use “On the DAE path, discretize(pdesys, discretization; fuse_broadcasts = true) requests fusion of elementwise array expressions in the residual. This can reduce the cost per call and increase first-call compilation time.” Replace the grid-independence claim and recommendation with “For the dx = dy = 1/8 configuration above, the extra 9.4 s divided by the 157 μs saved per call gives a break-even of about 60,000 evaluations of the same residual. Measure first-call and steady-state time for the grid you intend to run.” Verify that the page renders both table rows and that the stated keyword call still returns a DAE with the same residual values as the default.

What I ran

  • git diff --name-status -M origin/master...HEAD, git diff --check origin/master...HEAD, and typos docs/src/MOLFiniteDifference.md. The diff contains one modified manual page. The whitespace and spelling checks exited 0.
  • GROUP=Brusselator julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()' passed 1,154/1,154. The same command with GROUP=Discretization passed 3,702/3,702 equation discretization checks and 64/64 problem construction checks. Both used scratch copies of the reviewed head.
  • The targeted Brusselator residual probe passed 23/23. Default, explicit eager, and fused returned DAEs with exactly equal residuals on nonconstant input across the forcing threshold. The independent uniform-state check accounted for both reaction terms, periodic corner constraints, and the two grid points activated by the forcing. The final probe used the source equations to identify the corner rows after an initial assumption about residual row order failed.
  • Fresh-process @timed probes used Julia 1.12.4, ModelingToolkit 11.47.0, Symbolics 7.49.0, and SymbolicUtils 4.56.4. At dx = dy = 1/8, the first call took 5.20 s eager and 27.41 s fused. Warm calls took 246.0 and 29.5 μs, with 1,496 and 81 allocations per call. The repeat measured 4.11 and 44.39 s cold at that spacing. Fusion reduced warm time and allocation counts at all three documented spacings.
  • julia --startup-file=no --project=docs docs/make.jl reached link checking, then exited with [:linkcheck] after GitHub returned HTTP 429 on existing links. A second run had the same failure category. A Julia Markdown rendering check on the changed page exited 0 and rendered two benchmark data rows.
  • uv run --locked python --version printed Python 3.13.13 and warned that --locked has no effect outside a project. The checkout has no Python lockfile.

What I did not verify

  • The exact published timing numbers on Julia 1.12.1, a complete Documenter render past the external link checker, or remote CI independently of 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":"Tests and probes corroborated the documented tradeoff. The compile-cost explanation and performance guidance should stay tied to the measured setup."}

Head link: c9fd051


🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a2187f-e4dd-7133-addb-de38febb572e (no session URL)

@ChrisRackauckas
ChrisRackauckas merged commit 4b69893 into SciML:master Nov 26, 2026
5 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