paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Putting Weak Memory in Order via a Promising Intermediate Representation

通过 Promising 中间表示让弱内存有序
PLDI 7(PLDI)2023匹配度 2/10 · 论文研究弱内存并发模型、源到IR映射与Coq机械化验证,属于程序语言形式语义领域,但未涉及用户核心关注的LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析,因此与研究方向匹配度较低。引用 5 inbox
Sung-Hwan Lee, Minki Cho, Roy Margalit, Chung-Kil Hur, Ori Lahav
crossref: 2026-09-10

AI 速览

一句话:提出按序弱内存并发模型,通过 source/IR 分离支持非原子访问与单线程优化,并在 Coq 中验证到 Armv8 的映射。

论文为 C/C++ 等语言设计“按序”共享内存并发模型,使指令按程序顺序执行,以便推理与验证。作者证明按序模型仍能支持非原子访问,并验证单线程代码中的编译器优化(含无关 load 引入)。核心方法是区分源模型(catch-fire 语义)与中间表示模型(竞态读取未定义值),并形式证明源到 IR 映射的可靠性。对于 relaxed atomic 访问,按序模型必须禁止 load-store 重排序,但性能影响有限。源与 IR 语义基于 promising semantics,源到 IR 及 IR 到 Armv8 的正确性证明在 Coq 中机器化。

问题
为 C/C++ 等语言定义按程序顺序执行的弱内存并发模型,同时完整支持非原子访问并允许单线程代码的编译器优化。
方法
区分源语言模型(catch-fire 语义)与中间表示模型(竞态读取未定义值),形式建立源到 IR 的可靠映射;语义基于 promising semantics,并用 Coq 机器化证明源到 IR 与 IR 到 Armv8 的正确性。
评估
通过 Coq 机器化证明验证源到 IR 与 IR 到 Armv8 映射的正确性,并讨论按序模型对 relaxed atomic 需禁止 load-store 重排序的性能影响及可能的硬件 store 指令方案。
原文摘要(Abstract)

We investigate the problem of developing an "in-order" shared-memory concurrency model for languages like C and C++, which executes instructions following their program order, and is thus more amenable to reasoning and verification compared to recent complex proposals with out-of-order execution. We demonstrate that it is possible to fully support non-atomic accesses in an in-order model in a way that validates all compiler optimizations that are performed in single-threaded code (including irrelevant load introduction). The key to doing so is to utilize the distinction between a source model (with catch-fire semantics) and an intermediate representation (IR) model (with undefined value for racy reads) and formally establish the soundness of mapping from source to IR. As for relaxed atomic accesses, an in-order model must forbid load-store reordering. We discuss the rather limited performance impact of this fact and present a pragmatic approach to this problem, which, in the long term, requires a new kind of hardware store instructions for implementing relaxed stores. The source and IR semantics proposed in this paper are based on recent versions of the promising semantics, and the correctness proofs of the mappings from the source to the IR and from the IR to Armv8 are mechanized in Coq. This work is the first to formally relate an in-order source model and an out-of-order IR model with the goal of having an in-order source semantics without any performance overhead for non-atomics.

链接与引用

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

BibTeX
@article{paperbot1953,
  title = {Putting Weak Memory in Order via a Promising Intermediate Representation},
  author = {Sung-Hwan Lee and Minki Cho and Roy Margalit and Chung-Kil Hur and Ori Lahav},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591297}
}