paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Veracity: declarative multicore programming with commutativity

Veracity:利用可交换性的声明式多核编程
OOPSLA 6(OOPSLA2)2022匹配度 2/10 · 该论文属于 PL 中的并发语言设计、编译与形式化验证,涉及可交换性推理和锁合成,但未涉及 LLM/Agentic 程序、浮点程序分析或贝叶斯程序分析,与用户画像中的核心交叉方向无直接关联。引用 2 inbox
Adam Chen, Parisa Fathololumi, Eric Koskinen, Jared Pincus
crossref: 2026-09-10

AI 速览

一句话:提出声明式多核编程范式,程序员以顺序方式书写并显式标注代码片段的可交换条件,编译器据此自动并行化。

多核编程的现有抽象(如并发对象、事务内存)虽简化了编程,但仍需复杂工程。本文提出一种声明式编程风格:程序员像往常一样编写顺序程序,并显式表达代码片段在何种条件下可顺序交换(commutativity)。这种可交换条件为编译器利用可交换性与并行性的联系提供了新入口。作者给出了程序员顺序视角的语义,并在正确性条件下证明编译器转换后的并行执行与顺序语义等价;由于可串行化/线性化并不适用,他们提出作用域可串行化(scoped serializability),并用锁合成技术加以保证。进一步,论文将可交换块归约为逻辑规约,从而自动验证并合成可交换条件。作者在 Multicore OCaml 中实现了 Veracity 语言,在多种新基准程序上自动生成可交换条件,验证了并发加速随计算规模增加而出现,并将该工作应用于小型内存文件系统和众筹区块链智能合约的改编。

问题
多核编程仍依赖并发对象、事务内存等复杂工程抽象,难以直接表达顺序程序片段之间的独立性,从而阻碍编译器自动挖掘并行性。
方法
让程序员在顺序代码中标注可交换块及其可交换条件;给出顺序视角语义,定义作用域可串行化并用锁合成保证正确性;再把可交换块归约为逻辑规约,以符号推理自动验证和合成可交换条件。
评估
在 Multicore OCaml 中实现 Veracity 语言,在多种新基准程序上评估可交换条件的自动生成与并发加速效果,并用于内存文件系统和众筹区块链智能合约的改编案例。
原文摘要(Abstract)

There is an ongoing effort to provide programming abstractions that ease the burden of exploiting multicore hardware. Many programming abstractions ( e.g. , concurrent objects, transactional memory, etc.) simplify matters, but still involve intricate engineering. We argue that some difficulty of multicore programming can be meliorated through a declarative programming style in which programmers directly express the independence of fragments of sequential programs. In our proposed paradigm, programmers write programs in a familiar, sequential manner, with the added ability to explicitly express the conditions under which code fragments sequentially commute. Putting such commutativity conditions into source code offers a new entry point for a compiler to exploit the known connection between commutativity and parallelism. We give a semantics for the programmer’s sequential perspective and, under a correctness condition, find that a compiler-transformed parallel execution is equivalent to the sequential semantics. Serializability/linearizability are not the right fit for this condition, so we introduce scoped serializability and show how it can be enforced with lock synthesis techniques. We next describe a technique for automatically verifying and synthesizing commute conditions via a new reduction from our commute blocks to logical specifications, upon which symbolic commutativity reasoning can be performed. We implemented our work in a new language called Veracity, implemented in Multicore OCaml. We show that commutativity conditions can be automatically generated across a variety of new benchmark programs, confirm the expectation that concurrency speedups can be seen as the computation increases, and apply our work to a small in-memory filesystem and an adaptation of a crowdfund blockchain smart contract.

链接与引用

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

BibTeX
@article{paperbot1413,
  title = {Veracity: declarative multicore programming with commutativity},
  author = {Adam Chen and Parisa Fathololumi and Eric Koskinen and Jared Pincus},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {OOPSLA2},
  year = {2022},
  doi = {10.1145/3563349}
}