Lune

PLDI2025Top-tier venue

CompCertOC: Verified Compositional Compilation of Multi-threaded Programs with Shared Stacks

Ling Zhang, Yuting Wang, Yalun Liang, Zhong Shao

Abstract

It is a long-standing open problem to support verified compilation of multi-threaded programs compositionally when sharing of stack data between threads is allowed. Although certain solutions exist on paper, none of them is completely formalized because of the difficulty in simultaneously enabling sharing and forbidding modification of stack memory in presence of arbitrary memory operations (e.g., pointer arithmetic). We present a compiler verification framework that solves this open problem in the setting of cooperative multi-threading. To address the challenges of sharing stack data, we introduce threaded Kripke memory relations (TKMR) to support both protection and sharing of stacks in a multi-stack memory model. We further introduce threaded forward simulations parameterized by TKMR to capture semantics preservation for compiling program modules in multi-threaded contexts. We show that threaded forward simulations are both horizontally composable— thereby enabling the compositional verification of open threads and heterogeneous modules—and vertically composable— thereby enabling composition of compiler correctness for multiple compiler passes. Furthermore, threaded forward simulations can be converted into backward simulations. We apply this framework to 18 passes of CompCert to get CompCertOC, the first optimizing verified compiler that supports compositional verification of cooperative multi-threaded programs with shared stacks.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Conditional Contextual Refinement cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
  • CompCertO: compiling certified open C components cites CompCertM: CompCert with C-assembly linking and lightweight modular verification
  • Sequential reasoning for optimizing compilers under weak memory concurrency cites Promising 2.0: global optimizations in relaxed memory concurrency
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on8

  1. CompCertM: CompCert with C-assembly linking and lightweight modular verificationYoungju Song, Minki Cho, Dongjoo Kim, Yonghyun Kim et al.POPL 2020 · 49 citations
  2. Promising 2.0: global optimizations in relaxed memory concurrencySung-Hwan Lee, Minki Cho, Anton Podkopaev, Soham Chakraborty et al.PLDI 2020 · 48 citations
  3. Conditional Contextual RefinementYoungju Song, Minki Cho, Dongjae Lee, Chung-Kil Hur et al.POPL 2023 · 29 citations
  4. CompCertO: compiling certified open C componentsJérémie Koenig, Zhong ShaoPLDI 2021 · 18 citations
  5. Sequential reasoning for optimizing compilers under weak memory concurrencyMinki Cho, Sung-Hwan Lee, Dongjae Lee, Chung-Kil Hur et al.PLDI 2022 · 11 citations

Related papers

  1. Fully Composable and Adequate Verified Compilation with Direct Refinements between Open ModulesLing Zhang, Yuting Wang, Jinhua Wu, Jérémie Koenig et al.POPL 2024 · 10 citations
  2. Verified compilation of C programs with a nominal memory modelYuting Wang, Ling Zhang, Zhong Shao, Jérémie KoenigPOPL 2022 · 6 citations
  3. CompCertELF: verified separate compilation of C programs into ELF object filesYuting Wang, Xiangzhe Xu, Pierre Wilke, Zhong ShaoOOPSLA 2020 · 26 citations
  4. Fully Verified Instruction SchedulingZiteng Yang, Jun Shirako, Vivek SarkarOOPSLA 2024 · 1 citation
  5. Interference relation-guided SMT solving for multi-threaded program verificationHongyu Fan, Weiting Liu, Fei HePPoPP 2022 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines