When you happen to be awake with a spare moment, @TheGrE, I'm more and more curious about how your Part 2 / mod-3 solution for
Prime Circuit Optimisation differs from mine. The more I play with it, and with extensions to higher moduli, the better my waste-1-gate-total-for-the-sake-of-clarity solution looks.