I just discovered that autodiff inside and outside of Reactant compilation produce different results:
julia> using Reactant, Enzyme
julia> x = ones(2);
julia> xr = Reactant.to_rarray(x);
julia> autodiff(Reverse, sum, Duplicated(x, zero(x)))
((nothing,),)
julia> @jit autodiff(Reverse, sum, Duplicated(xr, zero(xr))) # why does this return something different?
((nothing,), nothing)
Found it while working on DI integration in JuliaDiff/DifferentiationInterface.jl#918, it errored because I was using only(autodiff(...))