Best practices for testing compiler optimizations?

That is a very clever approach! I think we will adopt your suggestion of using test-comp or something like it. I will need to think more about the details you've shared here, and thank you for pointing out the tests in the Racket source as well.