paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Formal Account of the Wasm 3.0 Concurrency Model

Wasm 3.0 并发模型的形式化刻画
OOPSLA 10(OOPSLA2)2026匹配度 2/10 · 该论文研究 Wasm 3.0 并发形式语义、编译正确性与模型检测,属于纯 PL/形式语义方向;与用户核心关注点(AI+PL 交叉、LLM/Agent 改进静态分析、浮点程序分析、贝叶斯程序分析)没有直接关联。虽然具备形式化、工具实现和工业落地元素,但不涉及 LLM/Agent 或相关交叉场景。引用 0 inbox
Azalea Raad, Michalis Kokologiannakis, Viktor Vafeiadis, Conrad Watt
crossref: 2026-10-02

AI 速览

一句话:为 Wasm 3.0 的 struct 提出并发语义,证明编译方案与优化正确,建立 DRF 性质并提供模型检测工具。

WebAssembly 3.0 引入了由运行时自动管理生命周期的动态分配类型化 struct,以便将带 GC 的源语言编译到 Wasm;但受 web 平台遗留技术约束影响,这些 struct 无法与 Wasm 既有并发特性共用,并被类型系统禁止跨线程共享。本文为 Wasm 3.0 struct 给出并发语义,旨在为 Wasm 社区正在推进的 shared-everything threads 项目提供依据,并证明三类正确性:(a) 到 x86 与 Arm 的预期编译方案;(b) 从 C/C++ 与 OCaml 并发原语到 Wasm 的编译;(c) 预期编译器优化。文章还建立了 DRF(data-race freedom)性质,并提供用于验证并发 Wasm 程序的模型检测工具;此外批判性审视 Wasm 1.0 内存模型,指出若干可使其实践与放松内存研究前沿更一致的修改。

问题
Wasm 3.0 新增的类型化 struct 受 web 平台遗留约束与类型系统限制,无法与既有并发特性结合、也不能跨线程共享,而社区 shared-everything threads 项目正试图放宽这些限制。
方法
为 Wasm 3.0 struct 形式化一套并发(含弱内存)语义,并据此证明到 x86/Arm 的编译方案、从 C/C++ 与 OCaml 并发原语到 Wasm 的编译以及预期编译器优化的正确性,同时建立 DRF 性质并实现对并发 Wasm 程序的模型检测工具。
评估
通过形式化证明验证编译方案与优化,并以模型检测工具评估并发 Wasm 程序;还包含对 Wasm 1.0 内存模型的批判性分析与改进建议。
原文摘要(Abstract)

WebAssembly (Wasm) is a platform-independent target for web applications that provides rudimentary support for untyped concurrent programming. While Wasm 1.0’s memory model was a simple buffer of raw bytes, the recently-finalised Wasm 3.0 feature set adds a new instruction set for dynamically allocated typed structs whose lifetime is managed automatically by the Wasm runtime. This feature was intended to facilitate the compilation of garbage-collected source languages to Wasm. However, due to legacy technical constraints inherited from the wider web platform, Wasm structs cannot be used with Wasm’s existing concurrency features and are prevented by the language’s type system from being shared between multiple threads. As of now, a broad industrial project within the Wasm community named shared-everything threads seeks to relax these restrictions and specify the concurrent behaviour of Wasm 2.0 structs. To inform these efforts, we formalise a concurrency semantics for Wasm 3.0 structs and prove the correctness of (a) the intended compilation scheme to x86 and Arm; (b) compilation from C/C++ and OCaml concurrency primitives to Wasm; and (c) intended compiler optimisations. We also establish a DRF property and provide a model checking tool for verifying concurrent Wasm programs. We have carried out our work with the aim that our semantics should be adopted as the official concurrency model for Wasm 3.0 as the shared-everything threads project progresses. Along the way, we critically appraise the existing Wasm 1.0 memory model, identifying several changes that could be made to better align it with the state of the art in relaxed memory research.

链接与引用

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

BibTeX
@article{paperbot12091,
  title = {A Formal Account of the Wasm 3.0 Concurrency Model},
  author = {Azalea Raad and Michalis Kokologiannakis and Viktor Vafeiadis and Conrad Watt},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA2},
  year = {2026},
  doi = {10.1145/3839465}
}