Note: Issue identified when working on TotalRewriter decision tree logic:
The original total rewriter logic would simplify a product expression in a
manner that would let it be lifted but the new code does not simplify in the
same way as before (details later) and the less simplified expression cannot be
processed by the current pick_single_element logic (irrespective if running the
old or decision tree based total rewriter - i.e. the old TotalRewriters
rewriter calling logic had been masking an issue currently not captured by our
tests). If you look at LBPTest.testPickSingleElement() I have added 3 tests to
the end of the list that highlight/localize the issue. The first of the tests
is commented out and is an example that neither the old list based or new
decision tree logic can handle. Basically what was happening with the old inner
repetitive rewrite loop in TotalRewriter is that it would generate an
expression similar to that in the second of the three examples (i.e. simpler
without as many variables/nested conditions) but the new decision tree logic
would cause the commented out example to be generated before the lift product
rewriter was called.
The reason the original TotalRewriter logic did this is because it had two
loops to exhaustively rewrite a given expression within a context. In the inner
loop it would keep applying a rewriter once it rewrote an expression until it
no longer made any more changes before going to the outer loop which would
restart from the beginning of the list of rewriters. With the introduction of a
decision tree this inner loop was removed and the decision tree rewrite call is
implemented as a rewrite once, this causes LBPStressIT.testStressTest2() to
fail due to no longer being able to lift a product expression (as outlined in
the new tests added to LBPTest.testPickSingleElement()).
As this is an issue independent of the new decision tree logic, I've added a
temporary hack to the TotalRewriter logic to simulate its old inner loop logic.
Once we resolve the issue with pick_single_element identified here we can
remove this hack. Let me know what you think.
Original issue reported on code.google.com by ctjoreilly@gmail.com on 25 Jul 2013 at 5:44
Original issue reported on code.google.com by
ctjoreilly@gmail.com
on 25 Jul 2013 at 5:44