Divergence-Aware Testing of Graphics Shader Compiler Back-Ends

Dongwei XIAO, Shuai WANG*, Zhibo LIU, Yiteng PENG, Daoyuan WU, Zhendong SU*

*Corresponding author for this work

Research output: Book Chapters | Papers in Conference ProceedingsConference paper (refereed)Researchpeer-review

1 Citation (Scopus)

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 languageEnglish
Title of host publicationProceedings of the ACM on Programming Languages
EditorsMichael HICKS
PublisherAssociation for Computing Machinery
Pages1367-1391
Number of pages25
Volume9
DOIs
Publication statusPublished - Jun 2025
Externally publishedYes
Event2025 ACM SIGPLAN Conference on Programming Languages Design and Implementation - Seoul, Korea, Republic of
Duration: 16 Jun 202520 Jun 2025

Conference

Conference2025 ACM SIGPLAN Conference on Programming Languages Design and Implementation
Abbreviated titlePLDI 2025
Country/TerritoryKorea, Republic of
CitySeoul
Period16/06/2520/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

Fingerprint

Dive into the research topics of 'Divergence-Aware Testing of Graphics Shader Compiler Back-Ends'. Together they form a unique fingerprint.

Cite this