halide/Halide — pull request #442 by dsharletg (2014-08-23 00:00:23+00:00)
Title: Simplify fuzz testing

This implements testing of the amplifier by generating random expressions and verifying that the simplified version of that expression is equal to the original for a random sampling of values. There are also a bunch of fixes for bugs that were found by the testing.

There are a few issues to be aware of:

- It randomizes the seed for the testing, for better coverage. It also prints out the seed it uses to run the tests, so if there is a failure it can be reproduced. I'm uncomfortable with this solution, however, it has found obscure failures that were missed with otherwise very large samplings of expressions (~1 minute of runtime). We might need to move this testing to a separate test, and let it run for a long time (longer than we are willing to wait for the internal tests). It's currently set up to run a few seconds worth of fuzz tests during the internal tests.

- There are still some holes in the types of expressions that get tested. I'm thinking about ways to do more of these, but I decided to send the pull request now because of the large number of changes to the simplifier (bug fixes).