Lune

PLDI2026顶会

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Towards Unified Analysis of GPU Consistency 引用了 Specifying and testing GPU workgroup progress models
  • Taking Back Control in an Intermediate Representation for GPU Computing 引用了 Specifying and testing GPU workgroup progress models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper6

  1. Specifying and testing GPU workgroup progress modelsTyler Sorensen, Lucas F. Salvador, Harmit Raval, Hugues Evrard 等OOPSLA 2021 · 11 次引用
  2. An abstract interpretation for SPMD divergence on reducible control flow graphsJulian Rosemann, Simon Moll, Sebastian HackPOPL 2021 · 8 次引用
  3. Towards Unified Analysis of GPU ConsistencyHaining Tong, Natalia Gavrilenko, Hernán Ponce de León, Keijo HeljankoASPLOS 2024 · 5 次引用
  4. Taking Back Control in an Intermediate Representation for GPU ComputingVasileios Klimis, Jack Clark, Alan Baker, David Neto 等POPL 2023 · 5 次引用
  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

  1. Program Reconditioning: Avoiding Undefined Behaviour When Finding and Reducing Compiler BugsBastien Lecoeur, Hasan Mohsin, Alastair F. DonaldsonPLDI 2023 · 15 次引用
  2. GL2GPU: Accelerating WebGL Applications via Dynamic API Translation to WebGPUYudong Han, Weichen Bi, Ruibo An, Deyu Tian 等WWW 2025 · 3 次引用
  3. DarthShader: Fuzzing WebGPU Shader Translators & CompilersLukas Bernhard, Nico Schiller, Moritz Schloegel, Nils Bars 等CCS 2024 · 3 次引用
  4. SIMT-Step Execution: A Flexible Operational Semantics for GPU Subgroup BehaviorZheyuan Chen, Naomi Rehman, Guido Martínez, Tyler SorensenPLDI 2026 · 2 次引用
  5. Descend: A Safe GPU Systems Programming LanguageBastian Köpcke, Sergei Gorlatch, Michel SteuwerPLDI 2024 · 7 次引用
黄昏的海面,两侧是细线勾勒的悬崖