15651

Automatic test case reduction of randomly generated OpenCL kernels

Moritz Pflanzer
Imperial College London, Department of Computing
Imperial College London, 2015

@article{pflanzer2015automatic,

   title={Automatic test case reduction of randomly generated OpenCL kernels},

   author={Pflanzer, Moritz and Donaldson, Alastair and Lascu, Andrei and Field, Tony},

   year={2015}

}

Download Download (PDF)   View View   Source Source   

2296

views

While software developers can review their programs to fix bugs, they might not be able to patch a compiler bug due to which their perfectly valid programs misbehave. Moreover, even a formal verification of source code provides no guarantees if the code is miscompiled. For these reasons great effort is spent to increase the reliability of compilers. One recent approach is compiler fuzzing in combination with random differential testing to detect miscompilations. Because the correct behaviour of randomly generated programs is not known they are compiled with multiple compilers or with different optimisation levels and the behaviour of the resulting binaries is compared to detect miscompilations. Randomly generated programs are often large, sometimes by necessity, because this increases the chances that they cause a bug. On the other hand, for large programs it is more difficult to locate and extract the root cause of the triggered bug. Therefore automatic test case reduction was recently proposed in the context of testing C compilers. The key problem with the idea to automatically remove parts from test cases is to avoid undefined behaviour because it leads to useless reduction results if it interferes with the actual misbehaviour or is present in the final test cases. In the scope of this project the existing implementation of the C-Reduce framework has been lifted to the domain of OpenCL kernels. In doing so the principal challenge has been to find appropriate analysis tools for the design of interestingness tests to prevent undefined behaviour, because the previously used tools are not compatible with OpenCL. It turned out that a reliable detection of undefined behaviour is only possible if the dynamic analysis of Oclgrind is used as oracle. To make this practical, the most significant achievement has been the design of a new plugin to reliably detect the usage of undefined values which have been identified as one of the largest sources of undefined behaviour which is overlooked by static tools. Additionally, the contributions of this project include bug reports and patches for general issues with Oclgrind, a patch to fix a case of wrong code generation in the Clang compiler which has been discovered during the project and improvements of the transformations in C-Reduce. Further, parts of the C-Reduce algorithm for Windows have been reimplemented to improve the performance of the automatic reductions. Finally, the robustness and performance of automatic reductions in the domain of many-core compilers have been evaluated. The reduced test cases are free from undefined behaviour and with less than one kilobyte small enough to be reported without the need for manual postprocessing. Moreover, the average reduction time of 100 minutes per test case is short enough to integrate the process into the everyday development.
No votes yet.
Please wait...

* * *

* * *

HGPU group © 2010-2024 hgpu.org

All rights belong to the respective authors

Contact us: