paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Indexed Types for a Statically Safe WebAssembly

面向静态安全 WebAssembly 的索引类型
POPL 8(POPL)2024匹配度 3/10 · 论文用索引类型为 WebAssembly 做静态检查并安全移除动态检查,属于类型系统/静态分析与工程落地工作,与“静态分析”主题有交集;但它不涉及 LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析,未命中用户当前核心交叉方向。引用 4 inbox
Adam T. Geller, Justine Frank, William J. Bowman
crossref: 2026-09-10

AI 速览

一句话:提出 Wasm-precheck,用索引类型静态检查程序值约束,从而安全移除 Wasm 的动态安全检查。

WebAssembly(Wasm)依赖动态安全检查(如内存边界检查)来保证安全,但带来运行时开销。本文提出 Wasm-precheck:Wasm 的一个超集,用索引类型(indexed types)表达并检查程序值的简单约束,使得编译器可以静态地、安全地删除这些动态检查。作者将 Wasm-precheck 实现为 Wasmtime 编译器与运行时的扩展,并与带显式动态检查的 Wasm 配置进行运行时与编译时性能对比:在广泛使用的 PolyBenchC 基准上平均运行时性能提升 1.71 倍,代价是二进制体积增加 7.18%、类型检查时间慢 1.4%。作者还证明了 Wasm-precheck 的类型安全与内存安全,证明 Wasm 可安全嵌入 Wasm-precheck(保证向后兼容),证明 Wasm-precheck 可类型擦除到 Wasm,并讨论了设计与实现上的权衡。

问题
Wasm 程序的安全依赖运行时动态检查(如内存边界检查),这带来了不可忽视的性能开销,而现有类型系统不足以静态表达程序值上的约束。
方法
设计 Wasm-precheck——Wasm 的索引类型超集,用索引类型对程序值约束进行静态表达与检查,并作为 Wasmtime 编译器与运行时的扩展实现。
评估
在 PolyBenchC 基准上与带显式动态检查的 Wasm 配置对比运行时与编译时性能,并给出类型安全、内存安全、向后兼容嵌入以及类型擦除到 Wasm 的机器化证明式论证。
原文摘要(Abstract)

We present Wasm-precheck, a superset of WebAssembly (Wasm) that uses indexed types to express and check simple constraints over program values. This additional static reasoning enables safely removing dynamic safety checks from Wasm, such as memory bounds checks. We implement Wasm-precheck as an extension of the Wasmtime compiler and runtime, evaluate the run-time and compile-time performance of Wasm-precheck vs Wasm configurations with explicit dynamic checks, and find an average run-time performance gain of 1.71 x faster in the widely used PolyBenchC benchmark suite, for a small overhead in binary size ( 7.18 % larger) and type-checking time (1.4% slower). We also prove type and memory safety of Wasm-precheck, prove Wasm safely embeds into Wasm-precheck ensuring backwards compatibility, prove Wasm-precheck type-erases to Wasm, and discuss design and implementation trade-offs.

链接与引用

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

BibTeX
@article{paperbot2624,
  title = {Indexed Types for a Statically Safe WebAssembly},
  author = {Adam T. Geller and Justine Frank and William J. Bowman},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632922}
}