Simuliris: A Separation Logic Framework for Verifying Concurrent Program Optimizations

被引:17
作者
Gaeher, Lennard [1 ]
Sammler, Michael [1 ]
Spies, Simon [1 ]
Jung, Ralf [1 ]
Dang, Hoang-Hai [1 ]
Krebbers, Robbert [2 ]
Kang, Jeehoon [3 ]
Dreyer, Derek [1 ]
机构
[1] MPI SWS, Saarland Informat Campus, Saarland, Germany
[2] Radboud Univ Nijmegen, Nijmegen, Netherlands
[3] Korea Adv Inst Sci & Technol, Seoul, South Korea
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2022年 / 6卷 / POPL期
基金
欧洲研究理事会; 荷兰研究理事会;
关键词
separation logic; program optimizations; data races; Iris; MODEL;
D O I
10.1145/3498689
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Today's compilers employ a variety of non-trivial optimizations to achieve good performance. One key trick compilers use to justify transformations of concurrent programs is to assume that the source program has no data races: if it does, they cause the program to have undefined behavior (UB) and give the compiler free rein. However, verifying correctness of optimizations that exploit this assumption is a non-trivial problem. In particular, prior work either has not proven that such optimizations preserve program termination (particularly non-obvious when considering optimizations that move instructions out of loop bodies), or has treated all synchronization operations as external functions (losing the ability to reorder instructions around them). In this work we present Simuliris, the first simulation technique to establish termination preservation (under a fair scheduler) for a range of concurrent program transformations that exploit UB in the source language. Simuliris is based on the idea of using ownership to reason modularly about the assumptions the compiler makes about programs with well-defined behavior. This brings the benefits of concurrent separation logics to the space of verifying program transformations: we can combine powerful reasoning techniques such as framing and coinduction to perform thread-local proofs of non-trivial concurrent program optimizations. Simuliris is built on a (non-step-indexed) variant of the Coq-based Iris framework, and is thus not tied to a particular language. In addition to demonstrating the effectiveness of Simuliris on standard compiler optimizations involving data race UB, we also instantiate it with Jung et al.'s Stacked Borrows semantics for Rust and generalize their proofs of interesting type-based aliasing optimizations to account for concurrency.
引用
收藏
页数:31
相关论文
共 45 条
[1]   An indexed model of recursive types for foundational proof-carrying code [J].
Appel, AW ;
McAllester, D .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2001, 23 (05) :657-683
[2]   Simple relational correctness proofs for static analyses and program transformations [J].
Benton, N .
ACM SIGPLAN NOTICES, 2004, 39 (01) :14-25
[3]  
Beringer L, 2014, LECT NOTES COMPUT SC, V8410, P107
[4]   Permission accounting in separation logic [J].
Bornat, R ;
Calcagno, C ;
O'Hearn, P ;
Parkinson, M .
ACM SIGPLAN NOTICES, 2005, 40 (01) :259-270
[5]  
Boyland J, 2003, LECT NOTES COMPUT SC, V2694, P55
[6]  
Cuellar Santiago, 2020, THESIS PRINCETON U
[7]   ReLoC: A Mechanised Relational Logic for Fine-Grained Concurrency [J].
Frumin, Dan ;
Krebbers, Robbert ;
Birkedal, Lars .
LICS'18: PROCEEDINGS OF THE 33RD ANNUAL ACM/IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, 2018, :442-451
[8]  
Gaher Lennard, 2022, Simuliris: Technical Documentation and Coq Development, DOI 10.5281/zenodo.5667545
[9]  
Gu RH, 2018, ACM SIGPLAN NOTICES, V53, P646, DOI 10.1145/3192366.3192381
[10]  
Gu RH, 2015, ACM SIGPLAN NOTICES, V50, P595, DOI [10.1145/2676726.2676975, 10.1145/2775051.2676975]