skip to main content

Kater: Automating Weak Memory Model Metatheory and Consistency Checking

Published:11 January 2023Publication History
Skip Abstract Section

Abstract

The metatheory of axiomatic weak memory models covers questions like the correctness of compilation mappings from one model to another and the correctness of local program transformations according to a given model---topics usually requiring lengthy human investigation. We show that these questions can be solved by answering a more basic question: "Given two memory models, is one weaker than the other?" Moreover, for a wide class of axiomatic memory models, we show that this basic question can be reduced to a language inclusion problem between regular languages, which is decidable.

Similarly, implementing an efficient check for whether an execution graph is consistent according to a given memory model has required non-trivial manual effort. Again, we show that such efficient checks can be derived automatically for a wide class of axiomatic memory models, and that incremental consistency checks can be incorporated in GenMC, a state-of-the-art model checker for concurrent programs. As a result, we get the first time- and space-efficient bounded verifier taking the axiomatic memory model as an input parameter.

References

  1. Parosh Aziz Abdulla, Stavros Aronis, Mohamed Faouzi Atig, Bengt Jonsson, Carl Leonardsson, and Konstantinos Sagonas ( 2015 ). “Stateless model checking for TSO and PSO.” In: TACAS 2015. Vol. 9035. LNCS. Berlin, Heidelberg: Springer, pp. 353-367. doi: https://doi.org/10.1007/978-3-662-46681-0_28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern ( 2018 ). “Frightening small children and disconcerting grown-ups: Concurrency in the Linux kernel.” In: ASPLOS 2018. Williamsburg, VA, USA: ACM, pp. 405-418. doi: https://doi.org/10.1145/3173162.3177156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Jade Alglave, Luc Maranget, and Michael Tautschnig ( July 2014 ). “Herding cats: Modelling, simulation, testing, and data mining for weak memory.” In: ACM Trans. Program. Lang. Syst. 36.2, 7 : 1-7 : 74. doi: https://doi.org/10.1145/2627752. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Mark Batty, Kayvan Memarian, Scott Owens, Susmit Sarkar, and Peter Sewell ( 2012 ). “Clarifying and compiling C/C++ concurrency: From C+ +11 to POWER.” In: POPL 2012. Philadelphia, PA, USA: ACM, pp. 509-520. doi: https://doi.org/10. 1145/2103656.2103717. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber ( 2011 ). “ Mathematizing C ++ concurrency.” In: POPL 2011. Austin, Texas, USA: ACM, pp. 55-66. doi: https://doi.org/10.1145/1926385.1926394. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Filippo Bonchi and Damien Pous ( 2013 ). “Checking NFA equivalence with bisimulations up to congruence.” In: POPL 2013. Ed. by Roberto Giacobazzi and Radhia Cousot. ACM, pp. 457-468. doi: https://doi.org/10.1145/2429069.2429124. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. James Bornholt and Emina Torlak ( 2017 ). “Synthesizing memory models from framework sketches and Litmus tests.” In: PLDI 2017. Ed. by Albert Cohen and Martin T. Vechev. ACM, pp. 467-481. doi: https://doi.org/10.1145/3062341.3062353. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Stephen Dolan, KC Sivaramakrishnan, and Anil Madhavapeddy ( 2018 ). “Bounding Data Races in Space and Time.” In: PLDI 2018. Philadelphia, PA, USA: ACM, pp. 242-255. doi: https://doi.org/10.1145/3192366.3192421. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Shaked Flur, Kathryn E. Gray, Christopher Pulte, Susmit Sarkar, Ali Sezgin, Luc Maranget, Will Deacon, and Peter Sewell ( 2016 ). “Modelling the ARMv8 architecture, operationally: Concurrency and ISA.” In: POPL 2016. St. Petersburg, FL, USA: ACM, pp. 608-621. doi: https://doi.org/10.1145/2837614.2837615. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Shaked Flur, Susmit Sarkar, Christopher Pulte, Kyndylan Nienhuis, Luc Maranget, Kathryn E. Gray, Ali Sezgin, Mark Batty, and Peter Sewell ( 2017 ). “Mixed-size concurrency: ARM, POWER, C/C++ 11, and SC.” In: POPL 2017. Paris, France: ACM, pp. 429-442. doi: https://doi.org/10.1145/3009837.3009839. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Natalia Gavrilenko, Hernán Ponce-de-León, Florian Furbach, Keijo Heljanko, and Roland Meyer ( 2019 ). “BMC for weak memory models: Relation analysis for compact SMT encodings.” In: CAV 2019. Ed. by Isil Dillig and Serdar Tasiran. Cham: Springer International Publishing, pp. 355-365. doi: https://doi.org/10.1007/978-3-030-25540-4_19. Google ScholarGoogle ScholarCross RefCross Ref
  12. Fei He, Zhihang Sun, and Hongyu Fan ( 2021 ). “Satisfiability modulo Ordering Consistency Theory for Multi-Threaded Program Verification.” In: PLDI 2021. Virtual, Canada: ACM, pp. 1264-1279. doi: https://doi.org/10.1145/3453483.3454108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Tsunehiko Kameda and Peter Weiner ( 1970 ). “ On the State Minimization of Nondeterministic Finite Automata.” In: IEEE Trans. Computers 19.7, pp. 617-627. doi: https://doi.org/10.1109/T-C. 1970. 222994. Google ScholarGoogle ScholarCross RefCross Ref
  14. Michalis Kokologiannakis, Ori Lahav, Konstantinos Sagonas, and Viktor Vafeiadis (Dec. 2017 ). “Efective stateless model checking for C/C++ concurrency.” In: Proc. ACM Program. Lang. 2.POPL, 17 : 1-17 : 32. doi: https://doi.org/10.1145/3158105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Michalis Kokologiannakis, Iason Marmanis, Vladimir Gladstein, and Viktor Vafeiadis (Jan. 2022 ). “Truly stateless, optimal dynamic partial order reduction.” In: Proc. ACM Program. Lang. 6.POPL. doi: https://doi.org/10.1145/3498711. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Michalis Kokologiannakis, Azalea Raad, and Viktor Vafeiadis ( 2019 ). “Model checking for weakly consistent libraries.” In: PLDI 2019. New York, NY, USA: ACM. doi: https://doi.org/10.1145/3314221.3314609. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Michalis Kokologiannakis and Viktor Vafeiadis ( 2020 ). “HMC: Model checking for hardware memory models.” In: ASPLOS 2020. ASPLOS '20. Lausanne, Switzerland: ACM, pp. 1157-1171. doi: https://doi.org/10.1145/3373376.3378480. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Michalis Kokologiannakis and Viktor Vafeiadis ( 2021 ). “GenMC: A model checker for weak memory models.” In: CAV 2021. Ed. by Alexandra Silva and K. Rustan M. Leino. Vol. 12759. LNCS. Springer, pp. 427-440. doi: https://doi.org/10.1007/978-3-030-81685-8_20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Dexter Kozen ( 1997 ). “Kleene Algebra with Tests.” In: ACM Trans. Program. Lang. Syst. 19.3. doi: https://doi.org/10.1145/ 256167.256195. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Dexter Kozen and Frederick Smith ( 1996 ). “Kleene Algebra with Tests: Completeness and Decidability.” In: CSL 1996. Ed. by Dirk van Dalen and Marc Bezem. Vol. 1258. LNCS. Springer, pp. 244-259. doi: https://doi.org/10.1007/3-540-63172-0\_43. Google ScholarGoogle ScholarCross RefCross Ref
  21. Ori Lahav, Nick Giannarakis, and Viktor Vafeiadis ( 2016a ). “ Taming Release-acquire Consistency.” In: POPL 2016. St. Petersburg, FL, USA: ACM, pp. 649-662. doi: https://doi.org/10.1145/2837614.2837643. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Ori Lahav and Viktor Vafeiadis ( 2016b ). “Explaining Relaxed Memory Models with Program Transformations.” In: FM 2016. Springer, pp. 479-495. doi: https://doi.org/10.1007/978-3-319-48989-6_29. Google ScholarGoogle ScholarCross RefCross Ref
  23. Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, and Derek Dreyer ( 2017 ). “Repairing sequential consistency in C/C++ 11.” In: PLDI 2017. Barcelona, Spain: ACM, pp. 618-632. doi: https://doi.org/10.1145/3062341.3062352. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Leslie Lamport (Sept. 1979 ). “How to Make a Multiprocessor Computer that Correctly Executes Multiprocess Programs.” In: IEEE Trans. Computers 28.9, pp. 690-691. doi: https://doi.org/10.1109/TC. 1979. 1675439. Google ScholarGoogle ScholarCross RefCross Ref
  25. Sela Mador-Haim, Rajeev Alur, and Milo M. K. Martin ( 2010 ). “Generating Litmus Tests for Contrasting Memory Consistency Models.” In: CAV 2010. Ed. by Tayssir Touili, Byron Cook, and Paul B. Jackson. Springer. doi: https://doi.org/10.1007/978-3-642-14295-6\_26. Google ScholarGoogle ScholarCross RefCross Ref
  26. Sela Mador-Haim, Rajeev Alur, and Milo M. K. Martin ( 2011 ). “Litmus tests for comparing memory consistency models: how long do they need to be?” In: DAC 2011. Ed. by Leon Stok, Nikil D. Dutt, and Soha Hassoun. ACM. doi: https: //doi.org/10.1145/2024724.2024842. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Brian Norris and Brian Demsky ( 2013 ). “CDSChecker: Checking concurrent data structures written with C/C++ atomics.” In: OOPSLA 2013. ACM, pp. 131-150. doi: https://doi.org/10.1145/2509136.2509514. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Scott Owens, Susmit Sarkar, and Peter Sewell ( 2009 ). “A better x86 memory model: x86-TSO.” In: TPHOLs 2009. Munich, Germany: Springer, pp. 391-407. doi: https://doi.org/10.1007/978-3-642-03359-9_27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Anton Podkopaev, Ori Lahav, and Viktor Vafeiadis (Jan. 2019 ). “Bridging the gap between programming languages and hardware weak memory models.” In: Proc. ACM Program. Lang. 3.POPL, 69 : 1-69 : 31. doi: https://doi.org/10.1145/3290382. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Yuval Filmus (https://cs.stackexchange.com/users/683/yuval-filmus) ( 2022 ). Is the power of a regular language regular? Is the root of a regular language regular? Computer Science Stack Exchange. URL:https://cs.stackexchange.com/q/99371 (version: 2018-10-31). eprint: https://cs.stackexchange.com/q/99371. url: https://cs.stackexchange.com/q/99371 (visited on Oct. 20, 2022 ). Google ScholarGoogle Scholar
  31. Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell ( 2018 ). “Simplifying ARM concurrency: Multicopy-atomic axiomatic and operational models for ARMv8.” In: Proc. ACM Program. Lang. 2.POPL, 19 : 1-19 : 29. doi: https://doi.org/10.1145/3158107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Christopher Pulte, Jean Pichon-Pharabod, Jeehoon Kang, Sung-Hwan Lee, and Chung-Kil Hur ( 2019 ). “Promising-ARM/RISCV: A simpler and faster operational concurrency model.” In: PLDI 2019. Phoenix, AZ, USA: ACM, pp. 1-15. doi: https: //doi.org/10.1145/3314221.3314624. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Susmit Sarkar, Kayvan Memarian, Scott Owens, Mark Batty, Peter Sewell, Luc Maranget, Jade Alglave, and Derek Williams ( 2012 ). “Synchronising C/C++ and POWER.” In: PLDI 2012. ACM, pp. 311-322. doi: https://doi.org/10.1145/2254064. 2254102. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Susmit Sarkar, Peter Sewell, Jade Alglave, Luc Maranget, and Derek Williams ( 2011 ). “Understanding POWER multiprocessors.” In: PLDI 2011. ACM, pp. 175-186. doi: https://doi.org/10.1145/1993498.1993520. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. SPARC International Inc. ( 1992 ). The SPARC Architecture Manual: Version 8. Prentice-Hall, Inc. Google ScholarGoogle Scholar
  36. SPARC International Inc. ( 1994 ). The SPARC architecture manual (version 9). Prentice-Hall. Google ScholarGoogle Scholar
  37. Emina Torlak, Mandana Vaziri, and Julian Dolby ( 2010 ). “MemSAT: checking axiomatic specifications of memory models.” In: PLDI 2010. Ed. by Benjamin G. Zorn and Alexander Aiken. ACM, pp. 341-350. doi: https://doi.org/10.1145/1806596.1806635. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, and Francesco Zappa Nardelli ( 2015 ). “Common compiler optimisations are invalid in the C11 memory model and what we can do about it.” In: POPL 2015. Mumbai, India: ACM, pp. 209-220. doi: https://doi.org/10.1145/2676726.2676995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. John Wickerson, Mark Batty, Tyler Sorensen, and George A. Constantinides ( 2017 ). “Automatically Comparing Memory Consistency Models.” In: POPL 2017. ACM, pp. 190-204. doi: https://doi.org/10.1145/3009837.3009838. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Kater: Automating Weak Memory Model Metatheory and Consistency Checking

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!