Putting Randomized Compiler Testing into Production
We describe our experience over the last 15 months on a compiler testing technology transfer project: taking the GraphicsFuzz research project on randomized metamorphic testing of graphics shader compilers, and building the necessary tooling around it to provide a highly automated process for improving the Khronos Vulkan Conformance Test Suite (CTS) with test cases that expose fuzzer-found compiler bugs, or that plug gaps in test coverage. We present this tooling for test automation—gfauto—in detail, as well as our use of differential coverage and test case reduction as a method for automatically synthesising tests that fill coverage gaps. We explain the value that GraphicsFuzz has provided in automatically testing the ecosystem of tools for transforming, optimizing and validating Vulkan shaders, and the challenges brought by testing a tool ecosystem rather than a single tool. We discuss practical issues associated with putting automated metamorphic testing into production, and provide illustrative examples of bugs found during our work.