What if you use the same repeat trick for forward mode? IE, replicate x and v vector and do the same as in reverse mode?
https://colab.research.google.com/drive/1tcm7Lvdv0krpPdaYHtWe7NA2bDbEQ0uj#scrollTo=-jwISHOycQ8x 37