Augmenting and Synthesizing Term Rewriting Systems for Use in Compilers

dc.contributor.advisorBodik, Rastislav
dc.contributor.authorNewcomb, Julie
dc.date.accessioned2022-04-19T23:44:01Z
dc.date.available2022-04-19T23:44:01Z
dc.date.issued2022-04-19
dc.date.submitted2021
dc.descriptionThesis (Ph.D.)--University of Washington, 2021
dc.description.abstractHalide is a domain-specific language for high-performance image processing and tensor computations, widely adopted in industry. Internally, the Halide compiler relies on a term rewriting system to prove properties of code required for efficient and correct compilation. This rewrite system is a collection of handwritten transformation rules that incrementally rewrite expressions into simpler forms; the system requires high performance in both time and memory usage to keep compile times low, while operating over the undecidable theory of integers. In this work, we apply formal techniques to prove the correctness of existing rewrite rules and provide a guarantee of termination. Then, we build an automatic program synthesis system in order to craft new, provably correct rules from failure cases where the compiler was unable to prove properties. We identify and fix 4 incorrect rules as well as 8 rules which could give rise to infinite rewriting loops. We demonstrate that the synthesizer can produce better rules than hand-authored ones in five bug fixes, and describe four cases in which it has served as an assistant to a human compiler engineer. We further show that it can proactively improve weaknesses in the compiler by synthesizing a large number of rules without human supervision and showing that the enhanced ruleset lowers peak memory usage of compiled code without appreciably increasing compilation times. We then turn from the goal of improving a handwritten term rewriting system to synthesizing an entirely new one. We argue that an artifact from a TRS termination proof, a special type of order over terms known as a reduction order, is an effective and expressive means of writing a specification for a term rewriting system. We demonstrate its own on a case study of another component of the Halide compiler called the variable solver. We present a synthesis process that takes a specification written in the form of a reduction order and a set of sample input expressions and produces a new ruleset. Furthermore, we show that we can use this synthesis process to allow users to experiment with different specifications by automatically generating new TRSs and evaluating them empirically, without ever handing to write a rule by hand.
dc.embargo.termsOpen Access
dc.format.mimetypeapplication/pdf
dc.identifier.otherNewcomb_washington_0250E_23826.pdf
dc.identifier.urihttp://hdl.handle.net/1773/48473
dc.language.isoen_US
dc.rightsnone
dc.subject
dc.subjectComputer science
dc.subject.otherComputer science and engineering
dc.titleAugmenting and Synthesizing Term Rewriting Systems for Use in Compilers
dc.typeThesis

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Newcomb_washington_0250E_23826.pdf
Size:
687.94 KB
Format:
Adobe Portable Document Format