paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Dargent: A Silver Bullet for Verified Data Layout Refinement

Dargent:验证数据布局精化的银弹
POPL 7(POPL)2023匹配度 3/10 · 论文属于形式化验证、程序精化与 DSL 方向,与静态分析和形式化验证领域相邻;但它不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,也没有把 LLM/Agent 作为工具用于改进验证,因此与当前研究画像的核心交叉点不匹配。引用 4 inbox
Zilin Chen, Ambroise Lafont, Liam O'Connor, Gabriele Keller, Craig McLaughlin, Vincent Jackson, Christine Rizkallah
crossref: 2026-09-10

AI 速览

一句话:提出 Dargent 数据布局描述语言与精化框架,为 Cogent 生成带形式正确性证明的 C 代码,消除 marshalling 复制开销。

系统程序员需要对数据结构内存布局进行细粒度控制,以生成高性能代码并兼容现有代码、标准协议或硬件,但操作低级内存表示既困难又易错。传统做法是编写繁琐的 marshalling 代码,在编译器表示与紧凑格式间转换,既易错又因复制带来显著运行时开销;已有自动化或验证 marshalling 的方案仍未消除该开销。本文提出 Dargent:一种数据布局描述语言与数据精化框架,允许程序员声明式指定代数数据类型在内存中的布局。作者将其应用于 Cogent 语言,但方法具有通用性。Dargent 生成直接按目标内存布局操作数据的 C 代码,并保留该 C 代码相对于函数式语义的正确性形式证明。由此,程序员无需实现和验证 marshalling 代码,消除了复制,改善了与周边系统的互操作,并提升整体可信度。

问题
系统编程中需要精确控制数据结构内存布局以满足性能与接口要求,而手动 marshalling 易错且复制开销大。
方法
提出声明式数据布局描述语言与数据精化框架 Dargent,为 Cogent 生成直接操作目标布局的 C 代码并保留形式正确性证明。
评估
在 Cogent 上应用该框架,说明生成的 C 代码可相对函数语义获得形式证明,并消除 marshalling 代码与复制开销。
原文摘要(Abstract)

Systems programmers need fine-grained control over the memory layout of data structures, both to produce performant code and to comply with well-defined interfaces imposed by existing code, standardised protocols or hardware. Code that manipulates these low-level representations in memory is hard to get right. Traditionally, this problem is addressed by the implementation of tedious marshalling code to convert between compiler-selected data representations and the desired compact data formats. Such marshalling code is error-prone and can lead to a significant runtime overhead due to excessive copying. While there are many languages and systems that address the correctness issue, by automating the generation and, in some cases, the verification of the marshalling code, the performance overhead introduced by the marshalling code remains. In particular for systems code, this overhead can be prohibitive. In this work, we address both the correctness and the performance problems. We present a data layout description language and data refinement framework, called Dargent, which allows programmers to declaratively specify how algebraic data types are laid out in memory. Our solution is applied to the Cogent language, but the general ideas behind our solution are applicable to other settings. The Dargent framework generates C code that manipulates data directly with the desired memory layout, while retaining the formal proof that this generated C code is correct with respect to the functional semantics. This added expressivity removes the need for implementing and verifying marshalling code, which eliminates copying, smoothens interoperability with surrounding systems, and increases the trustworthiness of the overall system.

链接与引用

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

BibTeX
@article{paperbot2091,
  title = {Dargent: A Silver Bullet for Verified Data Layout Refinement},
  author = {Zilin Chen and Ambroise Lafont and Liam O'Connor and Gabriele Keller and Craig McLaughlin and Vincent Jackson and Christine Rizkallah},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571240}
}