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 \emph{uniformity analysis}—a static check that rejects programs that could cause \emph{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) \emph{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) \emph{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) \emph{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) \emph{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.
Wed 17 JunDisplayed time zone: Mountain Time (US & Canada) change
16:10 - 17:50 | GPU ProgrammingPLDI Research Papers at Flatirons 3 Chair(s): Gilbert Louis Bernstein University of Washington | ||
16:10 20mTalk | Kuiper: Correct and Efficient GPU Programming with Dependent Types and Separation Logic PLDI Research Papers Guido Martínez Microsoft Research, Bastian Köpcke TU Berlin, Jonáš Fiala ETH Zurich, Gabriel Ebner Microsoft Research, Tahina Ramananandro Microsoft Research, Michel Steuwer TU Berlin, Tyler Sorensen Microsoft Research, Nikhil Swamy Microsoft Research DOI Pre-print | ||
16:30 20mTalk | Modular GPU Programming with Typed PerspectivesDistinguished Paper PLDI Research Papers Manya Bansal Massachusetts Institute of Technology, Daniel Sainati University of Pennsylvania, Joseph W. Cutler University of Pennsylvania, Saman Amarasinghe Massachusetts Institute of Technology, Jonathan Ragan-Kelley Massachusetts Institute of Technology DOI | ||
16:50 20mTalk | [TOPLAS] StreamAlloc: A Framework for Analyzing and Transforming CUDA Code to Enable Asynchronous Execution PLDI Research Papers | ||
17:10 20mTalk | SIMT-Step Execution: A Flexible Operational Semantics For GPU Subgroup Behavior PLDI Research Papers Zheyuan Chen University of California at Santa Cruz, Naomi Rehman University of California at Santa Barbara, Guido Martínez Microsoft Research, Tyler Sorensen Microsoft Research; University of California at Santa Cruz DOI Pre-print | ||
17:30 20mTalk | Uniformity Analysis in the WebGPU Shading Language PLDI Research Papers James Lee-Jones Imperial College London, John Wickerson Imperial College London, Alastair F. Donaldson Imperial College London DOI | ||