Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3503222.3507751acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections
research-article
Open access

Tree traversal synthesis using domain-specific symbolic compilation

Published: 22 February 2022 Publication History

Abstract

Efficient computation on tree data structures is important in compilers, numeric computations, and web browser layout engines. Efficiency is achieved by statically scheduling the computation into a small number of tree traversals and by performing the traversals in parallel when possible. Manual design of such traversals leads to bugs, as observed in web browsers. Automatic schedulers avoid these bugs but they currently cannot explore a space of legal traversals, which prevents exploring the trade-offs between parallelism and minimizing the number of traversals.
We describe Hecate, a synthesizer of tree traversals that can produce both serial and parallel traversals. A key feature is that the synthesizer is extensible by the programmer who can define a template for new kinds of traversals. Hecate is constructed as a solver-aided domain-specific language, meaning that the synthesizer is generated automatically by translating the tree traversal DSL to an SMT solver that synthesizes the traversals. We improve on the general-purpose solver-aided architecture with a scheduling-specific symbolic evaluation that maintains the engineering advantages solver-aided design but generates efficient ILP encoding that is much more efficient to solve than SMT constraints.
On the set of Grafter problems, Hecate synthesizes traversals that trade off traversal fusion to exploit parallelism. Additionally, Hecate allows defining a tree data structure with an arbitrary number of children. Together, parallelism and data structure improvements accelerate the computation 2× on a tree rendering problem. Finally, Hecate’s domain-specific symbolic compilation accelerates synthesis 3× compared to the general-purpose compilation to an SMT solver; when scheduling a CSS engine traversal, this ILP-based synthesis executes orders of magnitude faster.

References

[1]
Greg J. Badros, Alan Borning, Kim Marriott, and Peter J. Stuckey. 1999. Constraint Cascading Style Sheets for the Web. In Proceedings of the 12th Annual ACM Symposium on User Interface Software and Technology (UIST’15). ACM, New York, NY, USA. 73–82. https://doi.org/10.1145/320719.322588
[2]
Clark Barrett, Christopher L. Conway, Morgan Deters, Liana Hadarean, Dejan Jovanović, Tim King, Andrew Reynolds, and Cesare Tinelli. 2011. CVC4. In Proceedings of the 23rd International Conference on Computer Aided Verification (CAV’11). Springer-Verlag, Berlin, Heidelberg. 171–177. isbn:978-3-642-22109-5 http://dl.acm.org/citation.cfm?id=2032305.2032319
[3]
Jeffrey P. Bigham. 2014. Making the Web Easier to See with Opportunistic Accessibility Improvement. In Proceedings of the 27th Annual ACM Symposium on User Interface Software and Technology (UIST ’14). ACM, New York, NY, USA. 117–122. isbn:978-1-4503-3069-5 https://doi.org/10.1145/2642918.2647357
[4]
Alan Borning, Richard Lin, and Kim Marriott. 1997. Constraints for the Web. In Proceedings of the Fifth ACM International Conference on Multimedia (MULTIMEDIA ’97). ACM, New York, NY, USA. 173–182. isbn:0-89791-991-2 https://doi.org/10.1145/266180.266361
[5]
Bert Bos. 2016. CSS 2.2: Collapsing Margins. https://tinyurl.com/j66mfru
[6]
Bert Bos. 2016. CSS 2.2: Floats. https://tinyurl.com/ssn8rco
[7]
Bert Bos, Tantek Çelik, Ian Hickson, and Håkon Wium Lie. 2011. CSS 2.1: Collapsing Margins. https://tinyurl.com/rspsl2j
[8]
Bert Bos, Tantek Çelik, Ian Hickson, and Håkon Wium Lie. 2011. CSS 2.1: Floats. https://tinyurl.com/s67ebaa
[9]
Bert Bos, Håkon Wium Lie, Chris Lilley, and Ian Jacobs. 1998. CSS 2: Collapsing Margins. https://tinyurl.com/seb5h92
[10]
Bert Bos, Håkon Wium Lie, Chris Lilley, and Ian Jacobs. 1998. CSS 2: Floats. https://tinyurl.com/vbt29em
[11]
Browserling. 2018. https://www.browserling.com/
[12]
Browsershots. 2018. http://browsershots.org/
[13]
Browserstack. 2018. https://www.browserstack.com/screenshots
[14]
Matt Brubeck. 2014. Incorrect layout of element following a float, involving margins. https://github.com/servo/servo/issues/4307
[15]
Kartik Chandra and Rastislav Bodík. 2018. Bonsai: synthesis-based reasoning for type systems. Proc. ACM Program. Lang., 2, POPL (2018), 62:1–62:34.
[16]
S. R. Choudhary, M. R. Prasad, and A. Orso. 2012. CrossCheck: Combining Crawling and Differencing to Better Detect Cross-browser Incompatibilities in Web Applications. In 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation. 171–180. issn:2159-4848 https://doi.org/10.1109/ICST.2012.97
[17]
Ravi Chugh, Brian Hempel, Mitchell Spradlin, and Jacob Albers. 2016. Programmatic and Direct Manipulation, Together at Last. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’16). ACM, New York, NY, USA. 341–354. isbn:978-1-4503-4261-2 https://doi.org/10.1145/2908080.2908103
[18]
Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In Proceedings of the Theory and Practice of Software, 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’08/ETAPS’08). Springer-Verlag, Berlin, Heidelberg. 337–340. isbn:3-540-78799-2, 978-3-540-78799-0 http://dl.acm.org/citation.cfm?id=1792734.1792766
[19]
Joost Engelfriet and Gilberto Filè. 1982. Simple multi-visit attribute grammars. Journal of computer and system sciences, 24, 3 (1982), 283–314. http://doc.utwente.nl/69001/
[20]
Yu Feng, Ruben Martins, Osbert Bastani, and Isil Dillig. 2018. Program synthesis using conflict-driven learning. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2018, Philadelphia, PA, USA, June 18-22, 2018, Jeffrey S. Foster and Dan Grossman (Eds.). ACM, 420–435.
[21]
LLC Gurobi Optimization. 2019. Gurobi Optimizer Reference Manual. http://www.gurobi.com
[22]
Sylvain Halle, Nicolas Bergeron, Francis Guerin, and Gabriel Le Breton. 2015. Testing Web Applications Through Layout Constraints. In 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST). 1–8. https://doi.org/10.1109/ICST.2015.7102635
[23]
Osamu Hashimoto and Brad A. Myers. 1992. Graphical Styles for Building Interfaces by Demonstration. In Proceedings of the 5th Annual ACM Symposium on User Interface Software and Technology (UIST ’92). ACM, New York, NY, USA. 117–124. isbn:0-89791-549-6 https://doi.org/10.1145/142621.142635
[24]
IBM. 2016. The CPLEX Optimizer. https://www.ibm.com/analytics/cplex-optimizer/
[25]
Anantha Keesara. 2007. Bug 15662 - layout is coming down because of style 'float:left' of <div> https://bugs.webkit.org/show_bug.cgi?id=15662
[26]
Donald E. Knuth. 1968. Semantics of Context-Free Languages. In In Mathematical Systems Theory. 127–145.
[27]
K. Rustan M. Leino. 2010. Dafny: An Automatic Program Verifier for Functional Correctness. In Proceedings of the 16th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning (LPAR’10). Springer-Verlag, Berlin, Heidelberg. 348–370. isbn:3-642-17510-4, 978-3-642-17510-7 http://dl.acm.org/citation.cfm?id=1939141.1939161
[28]
Sonal Mahajan, Negarsadat Abolhassani, Phil McMinn, and William G.J. Halfond. 2018. Automated Repair of Mobile Friendly Problems in Web Pages. In International Conference on Software Engineering (ICSE 2018). ACM, 140–150.
[29]
Sonal Mahajan, Abdulmajeed Alameer, Phil McMinn, and William G. J. Halfond. 2017. Automated Repair of Layout Cross Browser Issues Using Search-based Techniques. In Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2017). ACM, New York, NY, USA. 249–260. isbn:978-1-4503-5076-1 https://doi.org/10.1145/3092703.3092726
[30]
S. Mahajan, A. Alameer, P. McMinn, and W. G. J. Halfond. 2018. Automated Repair of Internationalization Presentation Failures in Web Pages Using Style Similarity Clustering and Search-Based Techniques. In 2018 IEEE 11th International Conference on Software Testing, Verification and Validation (ICST). 215–226. https://doi.org/10.1109/ICST.2018.00030
[31]
A. Mesbah and M. R. Prasad. 2011. Automated cross-browser compatibility testing. In 2011 33rd International Conference on Software Engineering (ICSE). 561–570. issn:0270-5257 https://doi.org/10.1145/1985793.1985870
[32]
Leo A. Meyerovich, Matthew E. Torok, Eric Atkinson, and Rastislav Bodik. 2013. Parallel Schedule Synthesis for Attribute Grammars. In Proceedings of the 18th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’13). ACM, New York, NY, USA. 187–196. isbn:978-1-4503-1922-5 https://doi.org/10.1145/2442516.2442535
[33]
Greg Nelson and Derek C. Oppen. 1980. Fast Decision Procedures Based on Congruence Closure. J. ACM, 27, 2 (1980), April, 356–364. issn:0004-5411 https://doi.org/10.1145/322186.322198
[34]
Pavel Panchekha, Adam T. Geller, Michael D Ernst, Zachary Tatlock, and Shoaib Kamil. 2018. Verifying That Web Pages Have Accessible Layout. PLDI’18. https://doi.org/10.1145/3192366.3192407
[35]
Pavel Panchekha and Emina Torlak. 2016. Automated Reasoning for Web Page Layout. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016). ACM, New York, NY, USA. 181–194. isbn:978-1-4503-4444-9 https://doi.org/10.1145/2983990.2984010
[36]
Phitchaya Mangpo Phothilimthana, Tikhon Jelvis, Rohin Shah, Nishant Totla, Sarah Chasins, and Rastislav Bodik. 2014. Chlorophyll: Synthesis-aided Compiler for Low-power Spatial Architectures. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA. 396–407. isbn:978-1-4503-2784-8 https://doi.org/10.1145/2594291.2594339
[37]
The Clang Project. 2021. Clang: a C language family frontend for LLVM. https://clang.llvm.org
[38]
The Servo Parallel Browser Engine Project. 2018. Rendering issue of styled buttons. https://github.com/servo/servo/issues/18991
[39]
Shauvik Roy Choudhary, Husayn Versee, and Alessandro Orso. 2010. WEBDIFF: Automated Identification of Cross-browser Issues in Web Applications. In Proceedings of the 2010 IEEE International Conference on Software Maintenance (ICSM ’10). IEEE Computer Society, Washington, DC, USA. 1–10. isbn:978-1-4244-8630-4 https://doi.org/10.1109/ICSM.2010.5609723
[40]
Laith Sakka, Kirshanthan Sundararajah, and Milind Kulkarni. 2017. TreeFuser: a framework for analyzing and fusing general recursive tree traversals. Proc. ACM Program. Lang., 1, OOPSLA (2017), 76:1–76:30.
[41]
Laith Sakka, Kirshanthan Sundararajah, Ryan R. Newton, and Milind Kulkarni. 2019. Sound, fine-grained traversal fusion for heterogeneous trees. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2019, Phoenix, AZ, USA, June 22-26, 2019, Kathryn S. McKinley and Kathleen Fisher (Eds.). ACM, 830–844.
[42]
Eric Schkufza, Rahul Sharma, and Alex Aiken. 2013. Stochastic Superoptimization. In Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’13). ACM, New York, NY, USA. 305–316. isbn:978-1-4503-1870-9 https://doi.org/10.1145/2451116.2451150
[43]
Armando Solar-Lezama. 2008. Program Synthesis by Sketching. Ph.D. Dissertation. Berkeley, CA, USA. isbn:978-1-109-09745-0 AAI3353225.
[44]
Ivan E. Sutherland. 1964. Sketch Pad a Man-machine Graphical Communication System. In Proceedings of the SHARE Design Automation Workshop (DAC ’64). ACM, New York, NY, USA. 6.329–6.346. https://doi.org/10.1145/800265.810742
[45]
Emina Torlak and Rastislav Bodik. 2013. Growing Solver-aided Languages with Rosette. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (Onward! 2013). ACM, New York, NY, USA. 135–152. isbn:978-1-4503-2472-4 https://doi.org/10.1145/2509578.2509586
[46]
Emina Torlak and Rastislav Bodik. 2014. A Lightweight Symbolic Virtual Machine for Solver-aided Host Languages. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA. 530–541. isbn:978-1-4503-2784-8 https://doi.org/10.1145/2594291.2594340
[47]
Richard Uhler and Nirav Dave. 2014. Smten with Satisfiability-based Search. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA ’14). ACM, New York, NY, USA. 157–176. isbn:978-1-4503-2585-1 https://doi.org/10.1145/2660193.2660208
[48]
Christopher J. van Wyk. 1982. A High-Level Language for Specifying Pictures. ACM Trans. Graph., 1, 2 (1982), April, 163–182. issn:0730-0301 https://doi.org/10.1145/357299.357303
[49]
Thomas A. Walsh, Gregory M. Kapfhammer, and Phil McMinn. 2017. Automated Layout Failure Detection for Responsive Web Pages Without an Explicit Oracle. In Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2017). ACM, New York, NY, USA. 192–202. isbn:978-1-4503-5076-1 https://doi.org/10.1145/3092703.3092712
[50]
T. A. Walsh, P. McMinn, and G. M. Kapfhammer. 2015. Automatic Detection of Potential Layout Faults Following Changes to Responsive Web Pages (N). In 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE). 709–714. https://doi.org/10.1109/ASE.2015.31
[51]
Leland Wilkinson. 2005. The Grammar of Graphics (Statistics and Computing). Springer-Verlag New York, Inc., Secaucus, NJ, USA. isbn:0387245448
[52]
Brad Vander Zanden and Brad A. Myers. 1991. The Lapidary Graphical Interface Design Tool. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (CHI ’91). ACM, New York, NY, USA. 465–466. isbn:0-89791-383-3 https://doi.org/10.1145/108844.109005

Cited By

View all
  • (2024)Orchard: Heterogeneous Parallelism and Fine-grained Fusion for Complex Tree TraversalsACM Transactions on Architecture and Code Optimization10.1145/365260521:2(1-25)Online publication date: 21-May-2024
  • (2023)Conflict-Driven Synthesis for Layout EnginesProceedings of the ACM on Programming Languages10.1145/35912467:PLDI(638-659)Online publication date: 6-Jun-2023

Index Terms

  1. Tree traversal synthesis using domain-specific symbolic compilation

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ASPLOS '22: Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
    February 2022
    1164 pages
    ISBN:9781450392051
    DOI:10.1145/3503222
    This work is licensed under a Creative Commons Attribution International 4.0 License.

    Sponsors

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 22 February 2022

    Check for updates

    Badges

    Author Tags

    1. program synthesis
    2. symbolic compilation
    3. tree traversal

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    ASPLOS '22

    Acceptance Rates

    Overall Acceptance Rate 535 of 2,713 submissions, 20%

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)150
    • Downloads (Last 6 weeks)19
    Reflects downloads up to 12 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Orchard: Heterogeneous Parallelism and Fine-grained Fusion for Complex Tree TraversalsACM Transactions on Architecture and Code Optimization10.1145/365260521:2(1-25)Online publication date: 21-May-2024
    • (2023)Conflict-Driven Synthesis for Layout EnginesProceedings of the ACM on Programming Languages10.1145/35912467:PLDI(638-659)Online publication date: 6-Jun-2023

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media