Uniformity Analysis in the WebGPU Shading Language
James Lee-Jones, John Wickerson, Alastair F. Donaldson
摘要
The WebGPU programming model brings general-purpose GPU programming to the web, allowing untrusted JavaScript to issue parallel workloads to client GPUs. To ensure reliability, WebGPU mandates uniformity analysis —a static check that rejects programs that could cause barrier divergence , a GPU control-flow error that can hang execution and require OS-level recovery. While traditional GPU models treat barrier divergence as undefined behaviour, WebGPU’s need for safety and reliability makes this unacceptable. We present the first comprehensive formal and practical study of uniformity analysis in WebGPU, identifying four key issues and making corresponding contributions: (1) Lack of definition: The analysis currently defines non-uniform programs only as those it rejects, without an independent notion of barrier divergence. We provide an operational semantics for TinyWGSL, a core calculus of the WebGPU Shading Language (WGSL), developed in consultation with WGSL specification editors and implementers. This semantics rigorously defines barrier divergence in the context of WGSL for the first time. (2) Complex specification: The current description of uniformity analysis in WGSL is lengthy and imprecise. We reformulate it via concise formal rules for TinyWGSL and argue their soundness with respect to our semantics. (3) Lack of soundness and precision: Using our semantics, we expose soundness and precision flaws in the analysis as presented in the WGSL specification. In response, we have proposed four significant changes to the specification (all accepted). (4) Testing difficulty: The complex, semi-formal definition of uniformity in the WGSL specification makes it hard to test implementations. We mechanise uniformity analysis in Alloy and use Alloy’s test generation to stress-test the Chromium implementation, revealing specification–implementation discrepancies and a bug in the Chromium implementation. Overall, our work resolves an important GPU programming problem (rigorously defining barrier divergence), brings an interesting new analysis to the attention of the PL community, and demonstrates the impact of applying formal PL techniques to an important industrial language specification.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper6
- Specifying and testing GPU workgroup progress modelsTyler Sorensen, Lucas F. Salvador, Harmit Raval, Hugues Evrard 等OOPSLA 2021 · 被引用 11 次
- An abstract interpretation for SPMD divergence on reducible control flow graphsJulian Rosemann, Simon Moll, Sebastian HackPOPL 2021 · 被引用 8 次
- Towards Unified Analysis of GPU ConsistencyHaining Tong, Natalia Gavrilenko, Hernán Ponce de León, Keijo HeljankoASPLOS 2024 · 被引用 5 次
- Taking Back Control in an Intermediate Representation for GPU ComputingVasileios Klimis, Jack Clark, Alan Baker, David Neto 等POPL 2023 · 被引用 5 次
- SafeRace: Assessing and Addressing WebGPU Memory Safety in the Presence of Data RacesReese Levine, Ashley Lee, Neha Abbas, Kyle Little 等OOPSLA 2025 · 被引用 3 次
相关 Paper
- Program Reconditioning: Avoiding Undefined Behaviour When Finding and Reducing Compiler BugsBastien Lecoeur, Hasan Mohsin, Alastair F. DonaldsonPLDI 2023 · 被引用 15 次
- DarthShader: Fuzzing WebGPU Shader Translators & CompilersLukas Bernhard, Nico Schiller, Moritz Schloegel, Nils Bars 等CCS 2024 · 被引用 3 次
- GL2GPU: Accelerating WebGL Applications via Dynamic API Translation to WebGPUYudong Han, Weichen Bi, Ruibo An, Deyu Tian 等WWW 2025 · 被引用 3 次
- SIMT-Step Execution: A Flexible Operational Semantics for GPU Subgroup BehaviorZheyuan Chen, Naomi Rehman, Guido Martínez, Tyler SorensenPLDI 2026 · 被引用 2 次
- Descend: A Safe GPU Systems Programming LanguageBastian Köpcke, Sergei Gorlatch, Michel SteuwerPLDI 2024 · 被引用 7 次
