skip to main content

Counterexample-guided correlation algorithm for translation validation

Published:13 November 2020Publication History
Skip Abstract Section

Abstract

Automatic translation validation across the unoptimized intermediate representation (IR) of the original source code and the optimized executable assembly code is a desirable capability, and has the potential to compete with existing approaches to verified compilation such as CompCert. A difficult subproblem is the automatic identification of the correlations across the transitions between the two programs' respective locations. We present a counterexample-guided algorithm to identify these correlations in a robust and scalable manner. Our algorithm has both theoretical and empirical advantages over prior work in this problem space.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This is a presentation video of my talk at OOPSLA 2020 on our paper “Counterexample-Guided Correlation Algorithm for Translation Validation” accepted in the research track. In this paper, we propose an algorithm named Counter to identify the correlations across the transitions of the unoptimized intermediate representation (IR) of the original source code and the optimized executable assembly. One of the key insights of our paper is that counterexamples generated as the by-product of invariant inference algorithms can help in identifying these correlations code in a robust and scalable manner. Our algorithm Counter is the first algorithm that achieves robust and efficient equivalence checking across vectorizing transformations in the presence of multiple loops in both programs with potentially distinct register allocations.

References

  1. 2019. Polybench/C. https://sourceforge.net/projects/polybench/.Google ScholarGoogle Scholar
  2. 2020. [ONLINE-DEMO] Online demo of the equivalence checker. http://compiler.ai/.Google ScholarGoogle Scholar
  3. 2020. diet libc webpage. https://www.fefe.de/dietlibc/.Google ScholarGoogle Scholar
  4. 2020. OpenBSD libc sources. https://github.com/openbsd/src/tree/master/lib/libc.Google ScholarGoogle Scholar
  5. 2020. Yices2 bug report. https://github.com/SRI-CSL/yices2/issues/146.Google ScholarGoogle Scholar
  6. Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jefrey D. Ullman. 2006. Compilers: Principles, Techniques, and Tools (2Nd Edition). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Clark Barrett, Yi Fang, Benjamin Goldberg, Ying Hu, Amir Pnueli, and Lenore Zuck. 2005. TVOC: A Translation Validator for Optimizing Compilers. In Computer Aided Verification, Kousha Etessami and Sriram K. Rajamani (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 291-295. https://doi.org/10.1007/11513988_29 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Nick Benton. 2004. Simple Relational Correctness Proofs for Static Analyses and Program Transformations. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Venice, Italy) (POPL ¿04). Association for Computing Machinery, New York, NY, USA, 14 ¿ 25. https://doi.org/10.1145/964001.964003 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Frédéric Besson, Sandrine Blazy, and Pierre Wilke. 2014. A Precise and Abstract Memory Model for C Using Symbolic Values. In Programming Languages and Systems, Jacques Garrigue (Ed.). Springer International Publishing, Cham, 449-468. https://doi.org/10.1007/978-3-319-12736-1_24 Google ScholarGoogle ScholarCross RefCross Ref
  10. Z. Chen, Z. Gong, J. J. Szaday, D. C. Wong, D. Padua, A. Nicolau, A. V. Veidenbaum, N. Watkinson, Z. Sura, S. Maleki, J. Torrellas, and G. DeJong. 2017. LORE: A loop repository for the evaluation of compilers. In 2017 IEEE International Symposium on Workload Characterization (IISWC). 219-228. https://doi.org/10.1109/IISWC. 2017.8167779 Google ScholarGoogle ScholarCross RefCross Ref
  11. Berkeley Churchill, Oded Padon, Rahul Sharma, and Alex Aiken. 2019. Semantic Program Alignment for Equivalence Checking. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (Phoenix, AZ, USA) ( PLDI 2019). ACM, New York, NY, USA, 1027-1040. https://doi.org/10.1145/3314221.3314596 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Manjeet Dahiya and Sorav Bansal. 2017a. Black-Box Equivalence Checking Across Compiler Optimizations. In Programming Languages and Systems-15th Asian Symposium, APLAS 2017, Suzhou, China, November 27-29, 2017, Proceedings. 127-147. https://doi.org/10.1007/978-3-319-71237-6_7 Google ScholarGoogle ScholarCross RefCross Ref
  13. Manjeet Dahiya and Sorav Bansal. 2017b. Modeling Undefined Behaviour Semantics for Checking Equivalence Across Compiler Optimizations. In Hardware and Software: Verification and Testing-13th International Haifa Verification Conference, HVC 2017, Haifa, Israel, November 13-15, 2017, Proceedings. 19-34. https://doi.org/10.1007/978-3-319-70389-3_2 Google ScholarGoogle ScholarCross RefCross Ref
  14. Saumya Debray, Robert Muth, and Matthew Weippert. 1998. Alias Analysis of Executable Code. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Diego, California, USA) ( POPL '98). ACM, New York, NY, USA, 12-24. https://doi.org/10.1145/268946.268948 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Dennis Felsing, Sarah Grebing, Vladimir Klebanov, Philipp Rümmer, and Mattias Ulbrich. 2014. Automating Regression Verification. In Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering (Vasteras, Sweden) (ASE '14). ACM, New York, NY, USA, 349-360. https://doi.org/10.1145/2642937.2642987 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Cormac Flanagan and K. RustanM. Leino. 2001. Houdini, an Annotation Assistant for ESC/Java. In FME 2001: Formal Methods for Increasing Software Productivity. Lecture Notes in Computer Science, Vol. 2021. Springer Berlin Heidelberg, 500-517. https://doi.org/10.1007/3-540-45251-6_29 Google ScholarGoogle ScholarCross RefCross Ref
  17. Shubhani Gupta, Aseem Saxena, Anmol Mahajan, and Sorav Bansal. 2018. Efective Use of SMT Solvers for Program Equivalence Checking Through Invariant-Sketching and Query-Decomposition. In Theory and Applications of Satisfiability Testing-SAT 2018, Olaf Beyersdorf and Christoph M. Wintersteiger (Eds.). Springer International Publishing, Cham, 365-382. https://doi.org/10.1007/978-3-319-94144-8_22 Google ScholarGoogle ScholarCross RefCross Ref
  18. C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Commun. ACM 12, 10 (Oct. 1969 ), 576 ¿ 580. https://doi.org/10.1145/363235.363259 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. ISO. 2011. ISO/IEC 9899:2011 Information technology-Programming languages-C. International Organization for Standardization, Geneva, Switzerland. 683 ( est.) pages. http ://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail. htm?csnumber=57853Google ScholarGoogle Scholar
  20. Aditya Kanade, Amitabha Sanyal, and Uday P. Khedker. 2009. Validation of GCC Optimizers Through Trace Generation. Softw. Pract. Exper. 39, 6 (April 2009 ), 611-639. https://doi.org/10.1002/spe.v39: 6 Google ScholarGoogle ScholarCross RefCross Ref
  21. Moritz Kiefer, Vladimir Klebanov, and Mattias Ulbrich. 2018. Relational Program Reasoning Using Compiler IR. J. Autom. Reason. 60, 3 (March 2018 ), 337-363. https://doi.org/10.1007/s10817-017-9433-5 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Sudipta Kundu, Zachary Tatlock, and Sorin Lerner. 2009. Proving Optimizations Correct Using Parameterized Program Equivalence. In Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation (Dublin, Ireland) ( PLDI '09). ACM, New York, NY, USA, 327-337. https://doi.org/10.1145/1542476.1542513 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Shuvendu Lahiri, Chris Hawblitzel, Ming Kawaguchi, and Henrique Rebelo. 2012. SymDif: A language-agnostic semantic dif tool for imperative programs. In Computer Aided Verification (CAV '12) (Tool description). Springer. https://doi.org/10. 1007/978-3-642-31424-7_54 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Xavier Leroy. 2006. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In 33rd ACM symposium on Principles of Programming Languages. ACM Press, 42-54. https://doi.org/10.1145/1111037.1111042 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Leung, D. Bounov, and S. Lerner. 2015. C-to-Verilog translation validation. In Formal Methods and Models for Codesign (MEMOCODE), 2015 ACM/IEEE International Conference on. 42-47. https://doi.org/10.1109/MEMCOD. 2015.7340466 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Nuno P. Lopes and José Monteiro. 2016. Automatic Equivalence Checking of Programs with Uninterpreted Functions and Integer Arithmetic. Int. J. Softw. Tools Technol. Transf. 18, 4 (Aug. 2016 ), 359-374. https://doi.org/10.1007/s10009-015-0366-1 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Saeed Maleki, Yaoqing Gao, Maria J. Garzarán, Tommy Wong, and David A. Padua. 2011. An Evaluation of Vectorizing Compilers. In Proceedings of the 2011 International Conference on Parallel Architectures and Compilation Techniques (PACT '11). IEEE Computer Society, Washington, DC, USA, 372-382. https://doi.org/10.1109/PACT. 2011.68 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Robin Milner. 1971. An Algebraic Definition of Simulation Between Programs. Technical Report. Stanford, CA, USA.Google ScholarGoogle Scholar
  29. Markus Müller-Olm and Helmut Seidl. 2005. Analysis of Modular Arithmetic. In Programming Languages and Systems, Mooly Sagiv (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 46-60. https://doi.org/10.1145/1275497.1275504 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. KedarS. Namjoshi and LenoreD. Zuck. 2013. Witnessing Program Transformations. In Static Analysis, Francesco Logozzo and Manuel Fähndrich (Eds.). Lecture Notes in Computer Science, Vol. 7935. Springer Berlin Heidelberg, 304-323. https://doi.org/10.1007/978-3-642-38856-9_17 Google ScholarGoogle ScholarCross RefCross Ref
  31. George C. Necula. 2000. Translation Validation for an Optimizing Compiler. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (Vancouver, British Columbia, Canada) ( PLDI '00). ACM, New York, NY, USA, 83-94. https://doi.org/10.1145/349299.349314 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Amir Pnueli, Michael Siegel, and Eli Singerman. 1998. Translation Validation. In Proceedings of the 4th International Conference on Tools and Algorithms for Construction and Analysis of Systems (TACAS '98). Springer-Verlag, London, UK, UK, 151-166. https://doi.org/10.5555/646482.691453 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Arnd Poetzsch-Hefter and Marek Gawkowski. 2005. Towards Proof Generating Compilers. Electron. Notes Theor. Comput. Sci. 132, 1 (May 2005 ), 37-51. https://doi.org/10.1016/j.entcs. 2005. 03.023 Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Rahul Sharma, Eric Schkufza, Berkeley Churchill, and Alex Aiken. 2013. Data-driven Equivalence Checking. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications (Indianapolis, Indiana, USA) ( OOPSLA '13). ACM, New York, NY, USA, 391-406. https://doi.org/10.1145/2509136.2509509 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Michael Stepp, Ross Tate, and Sorin Lerner. 2011. Equality-based Translation Validator for LLVM. In Proceedings of the 23rd International Conference on Computer Aided Verification (Snowbird, UT) (CAV'11). Springer-Verlag, Berlin, Heidelberg, 737-742. https://doi.org/10.1007/978-3-642-22110-1_59 Google ScholarGoogle ScholarCross RefCross Ref
  36. Ofer Strichman and Benny Godlin. 2008. Regression Verification-A Practical Way to Verify Programs. In Verified Software: Theories, Tools, Experiments, Bertrand Meyer and Jim Woodcock (Eds.). Lecture Notes in Computer Science, Vol. 4171. Springer Berlin Heidelberg, 496-501. https://doi.org/10.1007/978-3-540-69149-5_54 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Ross Tate, Michael Stepp, Zachary Tatlock, and Sorin Lerner. 2009. Equality Saturation: a New Approach to Optimization. In POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages (Savannah, GA, USA). ACM, New York, NY, USA, 264-276. https://doi.org/10.1145/1480881.1480915 Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Jean-Baptiste Tristan, Paul Govereau, and Greg Morrisett. 2011. Evaluating Value-graph Translation Validation for LLVM. In Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation (San Jose, California, USA) ( PLDI '11). ACM, New York, NY, USA, 295-305. https://doi.org/10.1145/1993498.1993533 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Anna Zaks and Amir Pnueli. 2008. CoVaC: Compiler Validation by Program Analysis of the Cross-Product. In Proceedings of the 15th International Symposium on Formal Methods (Turku, Finland) (FM '08). Springer-Verlag, Berlin, Heidelberg, 35-51. https://doi.org/10.1007/978-3-540-68237-0_5 Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Lenore Zuck, Amir Pnueli, Yi Fang, and Benjamin Goldberg. 2003. VOC: A Methodology for the Translation Validation of Optimizing Compilers. 9, 3 (mar 2003 ), 223-247. https://doi.org/10.3217/jucs-009-03-0223 Google ScholarGoogle ScholarCross RefCross Ref
  41. Lenore Zuck, Amir Pnueli, Benjamin Goldberg, Clark Barrett, Yi Fang, and Ying Hu. 2005. Translation and Run-Time Validation of Loop Transformations. Form. Methods Syst. Des. 27, 3 (Nov. 2005 ), 335-360. https://doi.org/10.1007/s10703-005-3402-z Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Counterexample-guided correlation algorithm for translation validation

      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!