As you may know, @adrhill and I are putting the finishing touches to an AD interface package:
https://github.com/gdalle/DifferentiationInterface.jl
One of our goals is to make life easier for everyone who ever had to write one package extension per AD backend. It seems that this is the case for you @tpapp, and that LogDensityProblemsAD.jl falls into the spectrum of cases we cover (one array in, one scalar out).
Would you like to try it out as a potential tool for simplification? Happy to help if that's the case.
Related: