Abstract
Graphics shaders are the core of modern 3D visual effects, enabling developers to create realistic, real-time rendering of 3D scenes. Shaders are specialized programs written in high-level shading languages like GLSL, and graphics shader compilers translate these high-level shader programs into low-level binaries that run on GPUs. These shader compilers are complex programs with multiple layers: front-end, middle-end, and back-end. Despite significant development efforts from industrial GPU vendors such as NVIDIA and AMD, graphics shader compilers still contain bugs that can impact downstream applications and lead to negative consequences from poor user experience in entertainment to accidents in driving assistance systems. Because they are complex and deep in the compilation pipeline, the back-ends of shader compilers are particularly challenging to test. Our empirical exploration shows that state-of-the-art testing tools for shader compilers do not specifically target the back-ends and are thus ineffective in uncovering back-end bugs. This work fills this gap and introduces ShaDiv, an automated testing tool specifically designed to uncover bugs in the back-ends of graphics shader compilers. To this end, ShaDiv generates test inputs with two novel, carefully designed strategies to support the unique computational models of the back-ends, namely control and data flow divergence among GPU threads. ShaDiv deliberately perturbs divergence patterns in both the control and data flow of shader programs to effectively trigger back-end optimizations. Our evaluation of ShaDiv on graphics shader compilers from four mainstream GPU vendors uncovered 12 back-end bugs. Further comparison with existing shader compiler testing tools shows that ShaDiv achieves a 25% coverage increase in the back-end components and finds four times as many back-end bugs.
| Original language | English |
|---|---|
| Title of host publication | Proceedings of the ACM on Programming Languages |
| Editors | Michael HICKS |
| Publisher | Association for Computing Machinery |
| Pages | 1367-1391 |
| Number of pages | 25 |
| Volume | 9 |
| DOIs | |
| Publication status | Published - Jun 2025 |
| Externally published | Yes |
| Event | 2025 ACM SIGPLAN Conference on Programming Languages Design and Implementation - Seoul, Korea, Republic of Duration: 16 Jun 2025 → 20 Jun 2025 |
Conference
| Conference | 2025 ACM SIGPLAN Conference on Programming Languages Design and Implementation |
|---|---|
| Abbreviated title | PLDI 2025 |
| Country/Territory | Korea, Republic of |
| City | Seoul |
| Period | 16/06/25 → 20/06/25 |
Bibliographical note
Acknowledgements:We thank the reviewers and shepherd for their valuable comments and suggestions. We also thank Prof. Wei Meng from the Chinese University of Hong Kong for his participation in the discussions of this work.
Publisher Copyright:
© 2025 owner/author(s)
Keywords
- Shader Compiler
- Testing
- Divergence
- GPU
- SIMT
- Back-End