Exhaustively test OptimizeInstructions on ref.cast#7542
Conversation
Write a script to systematically generate test cases for all possible interesting cast patterns. Update the code to correctly handle the case where the cast is known to succeed but still requires a cast to recover exactness.
kripken
left a comment
There was a problem hiding this comment.
With this automation, it is not practical to read the testcase and each of the CHECKS to see the outcome (and in particular, there are no human-written comments explaining each outcome). That makes sense here. But then what the test gives us is IIUC checking for assertions in the pass and validation errors in the output. Can we also do runtime checks, by executing the code with --fuzz-exec which would verify behavior remains the same after the optimization?
That would require adding more stuff so the code is fully runnable, but seems practical?
|
It's a good idea, but I don't think it's feasible right now because our interpreter does not yet use exact types. If you tried to interpret |
Write a script to systematically generate test cases for all possible
interesting cast patterns. Update the code to correctly handle the case
where the cast is known to succeed but still requires a cast to recover
exactness.