Skip to content

Enzyme Julia 1 job aborts in IIP wrapper mutated-after-call regression #67

Description

@ChrisRackauckas-Claude

Failure

The tests / Enzyme (julia 1, ubuntu-latest) CI job aborts with signal 6 in the regression test at test/Enzyme/enzyme_tests.jl:349.

The assertion is from Enzyme:

julia: /workspace/srcdir/Enzyme/enzyme/Enzyme/GradientUtils.cpp:656: llvm::Value* GradientUtils::getNewFromOriginal(const llvm::Value*) const: Assertion `f != originalToNewFn.end()' failed.
[... ] signal 6 (-6): Aborted
in expression starting at .../test/Enzyme/enzyme_tests.jl:349

Reproduction

On current main (8eacfee9a798ff9b62579a71a1d0a67a2ac0a8a6):

timeout 3600 /home/crackauc/.juliaup/bin/julia +1.12 --project=test/Enzyme -e 'using Pkg; Pkg.instantiate(); include("test/Enzyme/enzyme_tests.jl")'

Observed locally: exit code 134, same Enzyme assertion, same enzyme_tests.jl:349 location.

CI Evidence

The earlier main log reports the same assertion at GradientUtils.cpp:652, signal 6, and test/Enzyme/enzyme_tests.jl:349.

Bisect / Origin Note

The failing regression test block was introduced by 103e9fb6 (Split reverse-mode thunk for the IIP FWW Enzyme rule). The current failure appears to be specific to the Julia 1.x Enzyme lane; the lts Enzyme lane passed in PR #66 and the local Julia 1.10 Pkg.test() run passed all groups.

Activity

  1. ChrisRackauckas-Claude commented on Jul 11, 2026

    @ChrisRackauckas-Claude
    MemberAuthor

    Fresh local check while auditing PR #68:

    • 9c11a85 (v1.9.2) passes timeout 3600 ~/.juliaup/bin/julia +1.12 --startup-file=no --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test(; test_args=["Enzyme"])' with Enzyme group 65 pass.\n- 103e9fb (Split reverse-mode thunk for the IIP FWW Enzyme rule) fails the same command with signal 6 / Enzyme GradientUtils.cpp:656 assertion at test/Enzyme/enzyme_tests.jl:349.\n- 8eacfee also fails with the same assertion.\n\nSo PR Use SciMLTesting public API docs QA #68 is not introducing this; it is a pre-existing main blocker tracked here.
  2. ChrisRackauckas-Claude commented on Jul 12, 2026

    @ChrisRackauckas-Claude
    MemberAuthor

    Additional local triage from a clean origin/main checkout (fd02a35, branch agent/enzyme-main-failure), using the requested command form:

    timeout 3600 env GROUP=Enzyme ~/.juliaup/bin/julia +release --project=. -e 'using Pkg; Pkg.test()'

    Result: reproduced the same signal-6 abort at test/Enzyme/enzyme_tests.jl:349 with Julia 1.12.5, Enzyme v0.13.181, EnzymeCore v0.8.21, Enzyme_jll v0.0.281+0, LLVM v9.10.0, and GPUCompiler v1.23.0.

    Dependency / version boundary checks on the minimal args mutated after call scenario:

    • Julia 1.11.9 passes with the same Enzyme v0.13.181 / Enzyme_jll v0.0.281+0 stack and returns g = [3.1499999999999995, 12.8], matching [4.5p1, 32p2].
    • Julia 1.12.0 fails with the same GradientUtils.cpp:656 assertion and the same Enzyme stack.
    • Julia 1.12.5 also fails; pinning Enzyme v0.13.180 / Enzyme_jll v0.0.280+0 still fails, so this is not just the latest Enzyme release.
    • The same loss written without FunctionWrappersWrapper passes on Julia 1.12.5 with Enzyme v0.13.181.

    I also injected the minimal scenario into 77e373f (v1.9.3, before 103e9fb) under Julia 1.12.5 / Enzyme 0.13.181, and it aborts the same way. So 103e9fb appears to be the first commit that adds suite coverage for this path, not necessarily the root cause of the compiler abort.

    Attempted local workaround: adding Enzyme rules for raw FunctionWrappers.FunctionWrapper analogous to the existing FunctionWrappersWrapper rules did not change the failure; Enzyme still reached jlcapi_CallWrapper IR and aborted. I reverted that experiment locally.

    Current best culprit: Julia 1.12 changes expose an Enzyme failure on the FunctionWrappers call ABI (jlcapi_CallWrapper) used by this wrapped IIP reverse-mode path. A repo-local fix was not identified in this pass.

  3. ChrisRackauckas-Claude commented on Jul 15, 2026

    @ChrisRackauckas-Claude
    MemberAuthor

    Formal follow-up from the CI investigation:

    • With Julia 1.12.6 and Enzyme 0.13.183, a source-history bisect identifies 103e9fb692536f06ee10838b712596ad76dac284 (the split reverse-mode thunk change) as the first FunctionWrappersWrappers commit that exercises the aborting path.
    • Its immediate parent 66c60cfd6d95906c7e3297d7aa5896c99dccb750 passes the complete Enzyme test file under the same pinned environment.
    • Current main aborts with Enzyme 0.13.183 and 0.13.184, while Enzyme 0.13.185 passes the full Enzyme group (68/68).

    Draft PR #71 raises both package and test-environment compatibility floors to Enzyme 0.13.185 without changing the regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions