paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Taking Back Control in an Intermediate Representation for GPU Computing

为 GPU 计算的中间表示夺回控制权
POPL 7(POPL)2023匹配度 4/10 · 该论文在形式化建模、工业落地和问题驱动方面符合用户偏好,但其主题是 GPU 编译器中间表示 SPIR-V 的控制流规范与模糊测试,与用户核心关注的 AI/LLM 和静态分析交叉、浮点程序分析、贝叶斯程序分析等方向没有直接关联。引用 5 inbox
Vasileios Klimis, Jack Clark, Alan Baker, David Neto, John Wickerson, Alastair F. Donaldson
crossref: 2026-09-10

AI 速览

一句话:为 SPIR-V 结构化控制流建立形式模型,据此修正规范、校验工具,并用模型引导的模糊测试发现 20 个编译器缺陷。

本文报告了将轻量级形式化方法应用于工业标准 GPU 中间表示 SPIR-V 的经验,重点重构其结构化控制流的定义。作者给出的形式模型首先揭示了 SPIR-V 规范中控制流定义存在的多处歧义与不必要的复杂性;随后与规范作者合作推动修订,最新版规范已采纳这套重新定义的控制流规则。作者还用该模型交叉校验支持 SPIR-V 的开发者工具与一致性测试套件,在提升工具与测试质量的同时也改进了模型本身。最后,他们提出一种由形式模型驱动的编译器模糊测试新方法,用于检测误编译缺陷,并在 Google、Khronos Group、Intel 与 Mozilla 的 SPIR-V 编译器中发现了 20 个此前未知的独立缺陷。该工作展示了形式化建模与分析技术对工业标准语言设计与实现的切实影响。

问题
SPIR-V 规范中结构化控制流的定义存在歧义与不必要的复杂性,且缺乏形式语义支撑开发者工具与一致性测试。
方法
采用轻量级形式化方法为 SPIR-V 结构化控制流建立形式模型,并基于该模型进行规范审查与修订、工具和一致性测试套件的交叉校验,以及由模型驱动的编译器模糊测试。
评估
与 SPIR-V 规范作者协作修正规范(新版本已采纳修订后的控制流定义),交叉校验并改进工具与测试套件,并通过模糊测试在来自 Google、Khronos、Intel、Mozilla 的 SPIR-V 编译器中找到 20 个此前未知的缺陷。
原文摘要(Abstract)

We describe our experiences successfully applying lightweight formal methods to substantially improve and reformulate an important part of Standard Portable Intermediate Representation SPIRV, an industry-standard language for GPU computing. The formal model that we present has allowed us to (1) identify several ambiguities and needless complexities in the way that structured control flow was defined in the SPIRV specification; (2) interact with the authors of the SPIRV specification to rectify these problems; (3) validate the developer tools and conformance test suites that support the SPIRV language by cross-checking them against our formal model, improving the tools, test suites, and our models in the process; and (4) develop a novel method for fuzzing SPIRV compilers to detect miscompilation bugs that leverages our formal model. The latest release of the SPIRV specification incorporates the revised set of control-flow definitions that have arisen from our work. Furthermore, our novel compiler-fuzzing technique has led to the discovery of twenty distinct, previously unknown bugs in SPIRV compilers from Google, the Khronos Group, Intel, and Mozilla. Our work showcases the practical impact that formal modelling and analysis techniques can have on the design and implementation of industry-standard programming languages.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2078,
  title = {Taking Back Control in an Intermediate Representation for GPU Computing},
  author = {Vasileios Klimis and Jack Clark and Alan Baker and David Neto and John Wickerson and Alastair F. Donaldson},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571253}
}