I’m working on a package that implements custom autodiff rules for Enzyme. I’ve defined augmented_primal and reverse methods for EnzymeRules.
These functions are called indirectly through autodiff.
When I run my test suite, the code coverage tool doesn’t track that these augmented_primal and reverse methods are being executed, even though the tests pass and produce correct results.
I suspect this is because Enzyme calls these rules at compile-time/code generation rather than through normal Julia runtime dispatch, so coverage tools can’t track them.
My Questions:
-
What’s the recommended way to test custom Enzyme rules to ensure they’re covered in tests?
-
Is there a way to directly call
augmented_primalandreversein tests (e.g., by manually constructing theRevConfigWidth{1}config)?