Metamorphic Shader Fusion for Testing Graphics Shader Compilers
Dongwei Xiao, Zhibo Liu, Shuai Wang
Abstract
Computer graphics are powered by graphics APIs (e.g., OpenGL, Direct3D) and their associated shader compilers, which render high-quality images by compiling and optimizing user-written high-level shader programs into GPU machine code. Graphics rendering is extensively used in production scenarios like virtual reality (VR), gaming, autonomous driving, and robotics. Despite the development by industrial manufacturers such as Intel, Nvidia, and AMD, shader compilers - like traditional software - may produce ill-rendered outputs. In turn, these errors may result in negative results, from poor user experience in entertainment to accidents in driving assistance systems. This paper introduces FSHADER, a metamorphic testing (MT) framework designed specifically for shader compilers to uncover erroneous compilations and optimizations. FSHADER tests shader compilers by mutating input shader programs via four carefully-designed metamorphic relations (MRs). In particular, FSHADER fuses two shader programs via an MR and checks the visual consistency between the image rendered from the fused shader program with the output of fusing individually rendered images. Our study of 12 shader compilers covers five mainstream GPU vendors, including Intel, AMD, Nvidia, ARM, and Apple. We successfully uncover over 16K error-triggering inputs that generate incorrect rendering outputs. We manually locate and characterize buggy optimization places, and developers have confirmed representative bugs.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get a4d74218-f048-4643-92fe-5758a89020b0Cited by top-tier papers5
- Extraction and Mutation at a High Level: Template-Based Fuzzing for JavaScript EnginesWai Kin Wong, Dongwei Xiao, Anthony Cheuk Tung Lai, Yiteng Peng et al.OOPSLA 2025 · 4 citations
- DTD: Comprehensive and Scalable Testing for DebuggersHongyi Lu, Zhibo Liu, Shuai Wang, Fengwei ZhangFSE 2024 · 2 citations
- Divergence-Aware Testing of Graphics Shader Compiler Back-EndsDongwei Xiao, Shuai Wang, Zhibo Liu, Yiteng Peng et al.PLDI 2025 · 1 citation
- PhyFu: Fuzzing Modern Physics Simulation EnginesDongwei Xiao, Zhibo Liu, Shuai WangASE 2023 · 1 citation
- MTZK: Testing and Exploring Bugs in Zero-Knowledge (ZK) CompilersDongwei Xiao, Zhibo Liu, Yiteng Peng, Shuai WangNDSS 2025
Related papers
- Metamorphic Testing of Secure Multi-party Computation (MPC) CompilersYichen Li, Dongwei Xiao, Zhibo Liu, Qi Pang et al.FSE 2024 · 5 citations
- DarthShader: Fuzzing WebGPU Shader Translators & CompilersLukas Bernhard, Nico Schiller, Moritz Schloegel, Nils Bars et al.CCS 2024 · 3 citations
- Test-case reduction and deduplication almost for free with transformation-based compiler testingAlastair F. Donaldson, Paul Thomson, Vasyl Teliman, Stefano Milizia et al.PLDI 2021 · 39 citations
- Fuzzing Deep Learning Compilers with HirGenHaoyang Ma, Qingchao Shen, Yongqiang Tian, Junjie Chen et al.ISSTA 2023 · 24 citations
- Fuzzing Open-Source GPU Hardware with SIMT Program GenerationZibo Gao, Jie Wang, Qihang Zhou, Lixiao Shan et al.USENIX Security 2026
