Test for reduction indexing maps being bijections.
Currently, we often test exact indexing map strings. This is not useful for a
couple of reasons:
it's very hard to verify these strings by hand
they're very brittle, since changes to the simplifier or correct changes to
indexing map expressions still break lots of these tests at the same time,
after which we typically copy the test output back to the test code (i.e.,
they're mostly change detectors).
This change modifies some of these tests to instead verify that the indexing
maps are bijections. Together with a test that verifies the actual reduction
output against the interpreter, this gives us good test coverage, while bening
less brittle.
For example, when adding vectorization to an emitter, but with an incorrect
indexing, the test will tell you that multiple points map to the same element,
or to an element that is out of bounds, or some elements aren't mapped to at
all.
Test for reduction indexing maps being bijections.
Currently, we often test exact indexing map strings. This is not useful for a couple of reasons:
This change modifies some of these tests to instead verify that the indexing maps are bijections. Together with a test that verifies the actual reduction output against the interpreter, this gives us good test coverage, while bening less brittle.
For example, when adding vectorization to an emitter, but with an incorrect indexing, the test will tell you that multiple points map to the same element, or to an element that is out of bounds, or some elements aren't mapped to at all.