Skip to content

Julia 1.10: a compact factor query's first native Reverse gradient aborts the process on registered Enzyme (libEnzyme heap-slot pointee type) #58

Open

Description

@nsiccha

Since ReactiveKernelsPPL 0.1.123 (7f0cf31), the compact factor queries of one selection structure (prepare_query_ad(...; coordinates = :support)) call one shared program, with their selection as constant call arguments. When that program reads a parameter block at a partition's rows, the first native Enzyme Reverse gradient on Julia 1.10 aborts the whole process while it compiles. Nothing can catch it:

Call parameter type does not match function signature!
  ... %object_id = call i64 @ijl_object_id_(...)
define internal fastcc void @preprocess_julia__partition_array_call_...
LLVM ERROR: function failed verification (1)

The exit code is 134.

Cause (libEnzyme)

view of a SubArray of RKPPL's compact overlay (_CompactCellPoint) reaches Base's default dataids, which calls objectid on a value held in a stack slot of ReactiveKernels._partition_array_call. When Enzyme moves that slot to the heap, libEnzyme replaces a pointee-changing addrspacecast with the new allocation. Under LLVM 15's typed pointers, jl_object_id_ then receives a pointer of the wrong type. Julia 1.12 and 1.13 use opaque pointers and are not affected. The upstream fix is open as EnzymeAD/Enzyme#3491. ReactiveKernels does not route around Enzyme defects, so RK's code is unchanged.

Status

The repair is on the dogfood line of nsiccha/Enzyme.jl from nsiccha/Enzyme.jl@a814f87 (libEnzyme build nsiccha/Enzyme@979b679, carried as a dogfood-only cherry-pick). No registered Enzyme release has it. Every dogfood commit reports Enzyme 0.13.218, a version General also lists, so [compat] cannot state this floor. A run-time repair probe is being added on the dogfood line; once it lands, RK can refuse such a query early and name the floor.

Reproduce

On Julia 1.10.12 with ReactiveKernels 0.1.119 / ReactiveKernelsPPL 0.1.128 (b398136), in an environment holding RK, RKPPL and Enzyme:

julia --project=<env> packages/ReactiveKernelsPPL/test/test_density_factor_overlay_views.jl
Enzyme result
registered 0.13.219 (Enzyme_jll 0.0.307) abort as above, exit 134
dogfood 3de90eeb (libEnzyme 33709d12) abort as above, exit 134
dogfood a814f87 (libEnzyme 979b679) 7 of 7 pass

A selection of scalars only (test_density_factors.jl, "Jacobian support includes authored bound dependencies") passes with all three, so not every compact query reaches this path. packages/ReactiveKernelsPPL/test/runtests.jl includes the overlay-views file, so a Julia 1.10 RKPPL test run on registered Enzyme stops there.

Close this once a registered Enzyme release differentiates the reproducer on Julia 1.10.

Activity

  1. nsiccha commented on Nov 8, 2026

    @nsiccha
    OwnerAuthor

    Update, measured on ReactiveKernels main b6196f1 (RK 0.1.121 / RKPPL 0.1.129), Julia 1.10.12.

    RK 0.1.120 (2971142) changed _partition_array_call from one Vararg method to one positional method per operand count. Its operands no longer share one stack tuple, so the libEnzyme verifier abort described above no longer happens. The reproducer still fails without the right Enzyme:

    Enzyme test_density_factor_overlay_views.jl
    registered 0.13.219 (Enzyme_jll 0.0.307) EnzymeRuntimeActivityError at the first gradient (3 pass, 1 error)
    dogfood 3de90eeb EnzymeRuntimeActivityError (3 pass, 1 error)
    dogfood 0147c6f 7 of 7
    dogfood a814f87, a68104d 7 of 7

    view of the compact overlay still reaches Base's default dataids → objectid on a stack slot, and Enzyme's constant-field proof gives up there. nsiccha/Enzyme.jl@0147c6f repairs that on the dogfood line; no registered release has the repair.

    So:

    • RK 0.1.111 to 0.1.119 (RKPPL 0.1.123 to 0.1.128) abort the process as described above, and need dogfood a814f87 or later.
    • From RK 0.1.120 the query raises a catchable EnzymeRuntimeActivityError at the first gradient, and needs dogfood 0147c6f or later.

    Runtime activity is not the fix. This issue stays open until a registered Enzyme release differentiates the reproducer on Julia 1.10.

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