Goal: enable users to check the aliasing between primal and shadow when runtime activity is on (https://enzymead.github.io/Enzyme.jl/stable/faq/#faq-runtime-activity):
Enabling runtime activity does therefore, come with a sharp edge, which is that if the computed derivative of a function is mutable, one must also check to see if the primal and shadow represent the same pointer, and if so the true derivative of the function is actually zero.
Related: