Enzyme.jl
Julia automatic differentiation with a machine-readable registry of local repairs.
Head 9430736f8c · committed
114 recorded repairs · fixes, sources & pins
The repair registry records capabilities on this branch. It is not a count of open upstream issues. Native repairs may require the libEnzyme build pinned by this revision.
- A type whose parameters do not apply, formed on a path that never runs, no longer raises its error while compiling the derivative
Tests: test/absint.jl
- Bound deferred activity retries while preserving reconsideration when new inactivity facts are proved
- Activity analysis hypotheses share their parent's sets instead of copying them, cutting the first gradient of a large function
- Julia 1.10: reverse array_del_end clears every restored adjoint in each batch lane
Tests: test/array_del_end.jl
- Restore floating-point vector shadow storage and preserve reverse pointer offsets across deletion and sizehint! on Julia 1.11 and later
Tests: test/array_storage.jl; test/sort_filter_derivatives.jl; test/memoryref_root.jl
- Runtime-activity tapes initialize their pointer fields atomically, so a collection right after allocation does not see garbage (Julia 1.12, 1.13)
- Julia 1.10: LLVM's Attributor no longer runs on differentiated code, so wide batched derivatives compile in time linear in the width
Tests: test/attributor_stages.jl
- Forward rules of BLAS calls that overwrite their output (beta == 0) write a zero tangent instead of 0 * the incoming tangent, which could be NaN
Tests: test/blas.jl
- A merge of four or more paths inside a loop recomputes its branch decisions instead of taping them per iteration
Tests: test/branch_predicates.jl
- ReverseWithPrimal returns the right primal value when the forward pass skips a call
- First calls of derivatives on several threads at once no longer deadlock between Enzyme's compile lock and Julia's codegen or inference lock
Tests: test/concurrent_compile.jl
- Reverse gradients stay memory-safe while other threads allocate: functions that reach a GC safepoint keep its memory effects before GC lowering
Tests: test/gc_safepoints.jl
- Retrieve cached custom-rule returns on reverse paths not dominated by the forward load
- Static Reverse of a read that picks Const or active data: loads through a merged pointer are split, and constant struct fields read through need no copy
- The Const-or-active read repair also holds in nested modes and for reads in a loop under forced bounds checking
- A reshape of Const array storage can be stored beside active arrays without a runtime activity error, including Julia 1.10 runtime calls and Julia 1.11+ MemoryRef headers
Tests: test/const_reshape.jl
- Const data a vararg method reads back from its tuple beside active data: objectid counts as a read, and slot reloads count as Const data
Tests: test/const_slot_reloads.jl
- Julia 1.10: copying a view of Const data into memory beside active data no longer uses the Const array as its own derivative storage
- Forward differentiation supplies zero tangents for inactive unboxed floating-point values with incomplete native type information
- Pass immutable Active return seeds to custom reverse rules without heap boxing.
Tests: test/rules/reverse_seed.jl
- A loop-carried value read from an array on every edge into the loop (a peeled first step) stays a phi of values, so its loop's reverse does not reload the array per iteration
Tests: test/data_phi_loads.jl
- A top-level autodiff_deferred no longer corrupts the JIT's symbol table (Failed to materialize symbols, segfault or double free)
Tests: test/deferred_trampoline.jl
- Derivative arithmetic carries the fast-math flags nsz and contract by default, and Enzyme.API.fast_math_flags! chooses them
Tests: test/floating_point.jl
- Julia 1.10: Illegal cached pointer from an array element read in a loop: the cache choice moves past the data pointer load
- Differentiating a call through a non-constant global module binding (jl_f_getglobal) works in every mode
Tests: test/module_lookup.jl
- Empty array allocations do not impose an element layout on constructor-map return joins
Tests: test/empty_array_types.jl
- Derivatives of erfcx of a real argument at every order without the cancelling identity
Tests: test/ext/specialfunctions.jl
- erfcx rules apply seeds with the derivative, so products whose partial leaves Float64's range stay exact
Tests: test/ext/specialfunctions.jl
- Explicit type layouts retain active fields beyond the default 500-byte inference offset limit, including wide dynamically dispatched tuple tails and broadcasts
Tests: test/type_offset_layouts.jl
- Julia 1.10: stack slots that hold only one float type are typed as floats, so a runtime-indexed tuple merged with its reload has a type
Tests: test/float_stack_slot.jl
- The Forward rule of a division never squares the divisor, so nested derivatives through a tiny or huge divisor stay finite
Tests: test/ext/specialfunctions.jl
- Forward over Reverse through a BLAS matrix product works: lascl has Forward and Reverse rules
- Repeated Forward over Reverse calls free the loop-trip-count caches of the inner reverse pass
- Julia 1.10: Forward over Reverse of a function with a large tape no longer segfaults or fails verification
- Reverse no longer caches inputs a call reads when later writes go to fresh owned storage (streaming output buffers)
Tests: test/fresh_buffer_cache.jl
- The fresh-buffer saving also holds when later non-inlined calls write only arrays they allocate (broadcasts, similar, sum with dims)
Tests: test/fresh_buffer_cache.jl
- The fresh-buffer saving also holds when the result is reshaped and the inputs arrive in a structured argument
Tests: test/fresh_buffer_cache.jl
- The fresh-buffer saving holds across a whole kernel: stack-slot stores, allocating callees, BLAS products and write barriers are bounded
Tests: test/fresh_buffer_cache.jl
- Static Reverse of a read that picks active data or data the function made no longer raises EnzymeRuntimeActivityError
Tests: test/fresh_data_merge.jl
- Preserve Julia GC allocation initialization bundles through forward and reverse differentiation, including zero initialization of shadow allocations
Tests: test/gc_alloc_bundles.jl
- Julia 1.10: a stack slot moved to the heap keeps its call argument typed, so view of a SubArray held on the stack passes LLVM's verifier
Tests: test/heap_slot_object_id.jl
- Forward and Reverse rules for products with the Q of a QR, LQ or Hessenberg factorization (gemqrt!, ormqr!, ormlq! and relatives)
- Derivatives taken while a package image is written work in later sessions: split mode, jacobian, one-hot seeds and nested derivatives
Tests: test/precompile.jl
- Julia 1.10: Enzyme's inference keeps the argument types of bounded recursive calls, so nested reductions like sum(sum, columns) stay typed
Tests: test/inference_recursion.jl
- InlineABI repairs and preserves the sret/returnRoots calling convention for retained helpers returning mixed aggregates, avoiding a Julia GC-lowering crash in first-order Forward with inactive integer arrays
Tests: test/inline_return_roots.jl
- Reverse of an inner loop inlined into an outer loop that reads its output costs what the same loop costs in a non-inlined function
Tests: test/inlined_loop_nest.jl
- Julia 1.10: type analysis no longer traps on an integer division whose known values include a zero divisor (DivideError while compiling)
- Combined and forward derivatives compile at their first call instead of inside the caller's inference, so other threads do not wait on the codegen lock
Tests: test/lazy_thunk.jl
- Literal constant objects captured beside active views get a separate zero shadow instead of raising EnzymeRuntimeActivityError
- A logger defined after Enzyme no longer breaks derivatives compiled in generated functions
Tests: test/logger_world.jl
- Differentiating Base's map over a tuple of 32 or more elements of several types no longer raises IllegalTypeAnalysisException, and its result is typed: the interpreter maps such tuples field by field (DifferentiationInterface's contexts past 31, such as a nested hvp over Constant and Cache contexts)
Tests: test/tuple_map.jl
- Preserve allocation instances carried across loop iterations instead of replaying them through one cache slot
- Reverse keeps the gradient of every iteration of a running value updated by ifelse or division and also used inside its loop
- Julia 1.13: a Reverse compile no longer segfaults in ScalarEvolution::LoopGuards on placeholder phis
- Julia 1.10: a value that does not change in a loop is cached once per loop entry, not once per iteration
Tests: test/loop_invariant_cache.jl
- make_zero, make_zero! and remake_zero! write @atomic fields atomically and share Tasks and bindings, so locks, Channels and GlobalRefs get shadows
Tests: test/make_zero.jl; test/locks.jl
- make_zero and make_zero! of a tuple, named tuple or Ref of floating-point numbers, integers, and arrays or Refs of floating-point numbers make no seen table, and the Tuple method dispatches each of up to 32 fields statically
Tests: test/make_zero.jl
- Julia 1.12, 1.13: Reverse of a recursive function over a view no longer allocates a tape per call
Tests: test/memoryref_root.jl
- Reverse no longer recomputes, on a path that skipped it, the condition of a three-way merge, which could throw (a DomainError from sqrt)
- Nested derivatives through a tape's constant members (sort, unique, slices of Const data) no longer raise EnzymeRuntimeActivityError
Tests: test/nested_tape_activity.jl
- The nodecayed phi fold replaces a phi only by a value that dominates it, which forced bounds checking can break
Tests: test/data_pointer_phi.jl
- Julia 1.10: Illegal cached pointer from a loop that reads Const data around a call that may throw: redundant nodecayed phis are folded
Tests: test/data_pointer_phi.jl
- Type analysis treats a cast of a global it must not recurse into (jl_nothing seeding every GC-tracked cache slot) as opaque: Forward over Reverse of a kernel caching Vector{Int} and Vector{Float64} elements no longer fails with Illegal updateAnalysis
- A reader that stores into an output array allocated before its loop no longer tapes its inputs per term
Tests: test/owned_output_cache.jl
- Pack eligible ragged reverse tapes into growing buffers with saved event offsets, preserving mutation and higher derivatives
- Group reverse tapes across inner loops sharing an event-dependent bound, and recompute identical branch index arithmetic
- Julia 1.10: second derivatives through a dynamic call no longer fail, because the readonly operand set of the call is inferred as one Val
- The readonly proof for an unannotated callable accepts stores into by-value argument copies, data passed on to callees, and float data read from held arrays
Tests: test/readonly_argument.jl
- The readonly proof accepts writes into a copy of held data whose elements hold no references
Tests: test/readonly_argument.jl
- The readonly proof accepts calls to a function with a custom derivative rule that has more than one call site
Tests: test/readonly_argument.jl
- The readonly proof checks a dynamic call when it first runs, on the operands that hold the callable's data
Tests: test/readonly_argument.jl
- Accept memset initialization of local argument and GC roots slots in the readonly check, while still rejecting writes through held pointers
- Julia 1.11+: the readonly proof accepts float stores into a fresh array inside a loop that reads a captured array
Tests: test/readonly_argument.jl
- Julia 1.10: Reverse keeps a fresh array a non-inlined call fills instead of rebuilding it uninitialized, so its gradient is not lost
- The readonly proof walks a function with several call sites once per set of argument positions receiving the data, and follows data thrown and caught
Tests: test/readonly_argument.jl
- Static Reverse of a lazy broadcast reduction over Const data, or of any struct holding Const data beside active data that a recursive function passes on, gives the Const field no zero-filled copy per call
- Julia 1.10: Reverse of an unused array's stores no longer fails with Illegal replace ficticious phi
Tests: test/rematerialized_store.jl
- Reverse replays a while loop over inactive data once instead of taping its exit test per iteration, inside calls differentiated with a tape
- A package image keeps the derivatives its precompile workload computes, so a later session links them instead of compiling (x86-64 Linux)
Tests: test/precompile.jl
- A derivative kept in a package image still links after a package that invalidates Enzyme's compiler loads
Tests: test/precompile.jl
- Derivative retention scans loaded ELF sections instead of mistaking relocation and other metadata for process addresses
- An integer array a non-inlined call returns, stored beside active data, is its own shadow instead of raising EnzymeRuntimeActivityError
- Ordinary Reverse keeps the shadows of storage a call initializes and returns (indexed copies, nested wrappers, tuples)
Tests: test/returned_memory.jl
- Give constant differentiable fields separate zero shadows in runtime tuple and struct constructors under static Reverse
Tests: test/typeunstable.jl
- Forward values still available in the reverse pass allow their users to be recomputed once on entry to a reverse loop
Tests: test/reverse_loop_entry.jl
- A value of the outer iteration used in an inner loop's arms is recomputed once per entry of the inner loop's reverse
Tests: test/reverse_loop_entry.jl
- A value of the outer iteration computed through a branch and read in an inner loop is rebuilt once per entry of the inner loop's reverse
Tests: test/reverse_loop_entry.jl
- Julia 1.10: runtime-activity Reverse of an array allocated per iteration and read with only no longer hits an unreachable rematerialized switch
- Avoid recursive runtime map wrappers for custom collections with imprecise return types while preserving the long-tuple map rewrite
Tests: test/tuple_map.jl; test/applyiter.jl; test/mixedapplyiter.jl; test/runtime_calls.jl; test/test_builtin_dynamic.jl
- Differentiate runtime-dispatched map over long mixed tuples, including inference-hidden tuples and splatted calls, by exposing the concrete runtime types to the existing method-checked tuple rewrite
Tests: test/tuple_map.jl; test/applyiter.jl; test/mixedapplyiter.jl; test/runtime_calls.jl
- Reverse gives a guarded division a zero derivative where the guard is false, instead of NaN from a speculated select
Tests: test/select_strong_zero.jl
- A custom rule may cache a primal input or its shadow, so a used dynamic setproperty! return no longer aborts the compiler
Tests: test/typeunstable.jl
- Reused sibling-loop load caches use the current loop's reverse index
Tests: test/sibling_loop_cache.jl
- Independent Reverse adjoint sums inherit explicit reassociation permission from eligible primal additive reductions
Tests: test/simd_adjoint_reduction.jl; test/floating_point.jl
- Allow singleton subtypes of AbstractFloat with no runtime payload in type layouts, including static floats used by MeasureTheory For measures
Tests: test/float_layouts.jl; test/integration/MeasureTheory/runtests.jl
- Inside a loop, Reverse computes a merge's second condition only on the paths that ran it
- A boxed Bool, Char or integer Enzyme allocates (the primal of a small Union return, a custom rule's union tape) carries Julia's small type tag, so the garbage collector no longer aborts on it
Tests: test/small_typetag_boxes.jl
- Julia 1.11+: the reverse rules of sort! and partialsort! survive a later in-place resize of the same vector
- With Enzyme loaded from source rather than its package image (Julia 1.12+), the generator of a reverse-mode runtime splat no longer raises UndefVarError for vaEltypes
Tests: test/source_loaded.jl
- Loading StaticArrays no longer makes the first derivative of a session compile Enzyme's compiler again
Tests: test/precompile.jl
- Derivative arithmetic no longer reassociates, so a representable gradient such as that of exp(log(t * 1e-190)) does not underflow
Tests: test/floating_point.jl
- Reverse gradient! writes into matching mutable derivative storage in tuples, named tuples, Refs and structs, including calls through DifferentiationInterface without contexts
Tests: test/gradient_inplace.jl; test/integration/DifferentiationInterface/structured_gradient.jl
- Enzyme.WithGradient supplies a function's gradient, and opaque native calls keep their activity and report a missing derivative
Tests: test/foreign_call.jl; test/rules/provided_gradient.jl
- Loading Enzyme preserves compiled abstract-array callers of ndims, eltype and convert
Tests: test/tuplearray.jl; test/sugar.jl
- A later store of a pointer, such as a Ref store-back after a BLAS product, no longer makes the call copy the numbers it read
Tests: test/typed_later_writes.jl
- Julia 1.10: restored return roots no longer shift removed-argument metadata, fixing a codegen type assertion through Base.unalias in nested AD
Tests: test/unalias.jl
- Julia 1.10: the first Reverse gradient of a large function no longer spends cubic time deciding which loads to cache
- Julia 1.13: custom reverse rules can read unchanged tuples containing array references without conflicting root alias metadata
- Julia 1.12: a stack-slot reload without its type tag, which libEnzyme's rewrite of the function drops, is typed from the slot's writes again, so a Hessian-vector product through a custom rule with try/catch or try/finally, and split-mode Reverse of a view whose index vector is reloaded from a vararg method's argument tuple, do not raise EnzymeRuntimeActivityError
Tests: test/rule_handler_slot_reloads.jl; test/const_slot_reloads.jl; test/const_element_store.jl
- A value the differential-use analysis read provisionally inside a cycle is not memoized as finally unneeded: Reverse over Forward of a typed nested comprehension no longer fails with Illegal replace ficticious phi
- Julia 1.10: fields of a Const struct that a vararg method reads back from its argument tuple get their Julia type, so static Reverse does not raise
Tests: test/const_element_store.jl
- Julia 1.10: a stored null clears a slot field as a zero memset does, for wide vararg tuples a large function zeroes field by field
Tests: test/const_element_store.jl
- Julia 1.10: the constant-field proof keeps a slot that one method receives at two places
Tests: test/const_element_store.jl
- Keep wide tuple splats typed during differentiation by raising inference and optimization limits from 32 to 512; repairs Julia 1.12 Forward and Reverse calls with 32 or 40 constant arguments beside an active Ref
Tests: test/wide_active_args.jl; test/tuple_map.jl; test/applyiter.jl; test/many_args.jl
Related revisions
- Enzyme.jl native library pin
eb82b697068538ee9074e2751f160838a8154005Pin source
- Branch revision
9430736f8c9f694279002001f08675d52289637b- Declared base revision
9cc1c3a1c0a59e014a8254d3ac96bc0564245b77- Upstream revision
9cc1c3a1c0a59e014a8254d3ac96bc0564245b77