Skip to content

Mark discrete time-grid search helpers as Enzyme inactive - #4496

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/enzyme-inactive-search
Sep 11, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/enzyme-inactive-search

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Treat discrete time-grid search helpers as Enzyme inactive so reverse-mode through sol(t) no longer enters the FindFirstFunctions SIMD preserve region. Blocking inlining makes Enzyme see the index as constant (correct almost everywhere) and avoids the gc_preserve dominance abort.

Note

This PR should be ignored until reviewed by @ChrisRackauckas.

Verification

Original MWE from EnzymeAD/Enzyme.jl#3565 (OrdinaryDiffEqTsit5 + Enzyme reverse through ref(t)):

Before (without fix, git stash):

LLVM ERROR: function failed verification (4)
[..] signal (6): Aborted
EXIT: 134

After (with fix):

Test Summary:                      | Pass  Total   Time
Enzyme reverse through interpolant |    2      2  34.9s
SUCCESS: bu=[-0.3, 1.0] bp=[0.36311947343289785] (matches analytic `du[1]` and `ref(1.5)[1]`)

Commands run:

GROUP=Core julia --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test()'
# Core Infrastructure AllocCheck, JET, Aqua + all Core testsets pass, including new Enzyme Interpolation (2 passed)

GROUP=QA julia --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test()'
# Aqua 26 passed, JET 30 passed +1 broken (pre-existing), AllocCheck passed

New regression test lib/OrdinaryDiffEqCore/test/enzyme_interpolation_tests.jl fails (process abort, LLVM ERROR) before and passes after.

Not verified

  • GPU group (needs hardware).
  • Downstream packages / SciMLSensitivity EnzymeVJP path (only local MWE verified).
  • julia pre / allowed-to-fail jobs.

Reviewer notes

  • Uses EnzymeCore.EnzymeRules.inactive (not inactive_noinl) deliberately to block inlining; inactive_noinl still inlines and still crashes.
  • Adds Enzyme to [extras]/test targets for OrdinaryDiffEqCore only; no new runtime dep.
  • QA allowlist adds :inactive alongside existing :inactive_noinl for EnzymeCore.EnzymeRules internals.

🤖 Generated with OpenCode (Muse Spark) (model: muse-spark-1.3-contributor-free)
Session: /home/crackauc/sandbox/tmp_20260911_055443_18155

Links:

Treat _searchsortedfirst/_searchsortedlast and TsSearchHint helpers as
inactive with inlining blocked so Enzyme sees the index as constant and
never enters the FindFirstFunctions preserve region.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: OpenCode <[email protected]>
Agent-Harness: OpenCode (Muse Spark)
Agent-Model: muse-spark-1.3-contributor-free
Agent-Session: /home/crackauc/sandbox/tmp_20260911_055443_18155
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 11, 2026 10:39
@ChrisRackauckas
ChrisRackauckas merged commit f45f4cc into SciML:master Sep 11, 2026
250 of 260 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 11, 2026
- Unify companion global error estimators into GlobalErrorEstimation (#4492)
- Add adjoint-based global error control as a SciMLSensitivity extension (#3953)
- ExpRK: cache ishermitian (rebase of #4305, + review fixes) (#4497)
- Mark discrete time-grid search helpers as Enzyme inactive (#4496)
- GlobalAdjoint: every-step trajectory scope and step-grid control (#4495)
- GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498)
- Release GlobalDiffEq 1.7.1 (#4501)
- Fix GlobalDiffEq precompilation on Julia 1.13 and companion accuracy (#4500)
- Make mass-matrix identity/zero/diagonal checks GPU-safe (#4502)
- Fix BDF step rejection for backward-in-time integration (#4503)



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]>
ChrisRackauckas added a commit that referenced this pull request Sep 12, 2026
- Release OrdinaryDiffEqBDF 2.4.7 (#4490)
- Unify companion global error estimators into GlobalErrorEstimation (#4492)
- Add adjoint-based global error control as a SciMLSensitivity extension (#3953)
- ExpRK: cache ishermitian (rebase of #4305, + review fixes) (#4497)
- Mark discrete time-grid search helpers as Enzyme inactive (#4496)
- GlobalAdjoint: every-step trajectory scope and step-grid control (#4495)
- GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498)
- Release GlobalDiffEq 1.7.1 (#4501)
- Fix GlobalDiffEq precompilation on Julia 1.13 and companion accuracy (#4500)
- Make mass-matrix identity/zero/diagonal checks GPU-safe (#4502)



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]>
ChrisRackauckas added a commit that referenced this pull request Sep 13, 2026
- Unify companion global error estimators into GlobalErrorEstimation (#4492)
- Add adjoint-based global error control as a SciMLSensitivity extension (#3953)
- ExpRK: cache ishermitian (rebase of #4305, + review fixes) (#4497)
- Mark discrete time-grid search helpers as Enzyme inactive (#4496)
- GlobalAdjoint: every-step trajectory scope and step-grid control (#4495)
- GlobalAdjoint: defer to adjoint_sensitivities default instead of pinning an adjoint (#4498)
- Release GlobalDiffEq 1.7.1 (#4501)
- Fix GlobalDiffEq precompilation on Julia 1.13 and companion accuracy (#4500)
- Make mass-matrix identity/zero/diagonal checks GPU-safe (#4502)
- Fix BDF step rejection for backward-in-time integration (#4503)



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