arXiv:2611.06515cs.SENov 2026

Manuscript Offprint

arXiv:2611.06515

Scythe: Semantic-Aware Rewriting for Fast,Effective Program Reduction

Ioanna Moraiti, Charalambos Mitropoulos, Artem Anchikov, Sotirios Ioannidis, Dimitris Mitropoulos, Thodoris Sotiropoulos

Ioanna Moraiti¹, Charalambos Mitropoulos², Artem Anchikov³, Sotirios Ioannidis²

Dimitris Mitropoulos⁴,⁵, Thodoris Sotiropoulos¹

¹Unaffiliated, ²Technical University of Crete, ³ETH Zurich,

⁴University of Athens, ⁵National Infrastructures for Research and Technology

{ioannamoraiti@outlook.com, theosotr@windowslive.com}, {cmitropoulos, sioannidis} @tuc.gr, aanchikov@ethz.ch, dimitro@ba.uoa.gr

Abstract—Automated program reduction shrinks a program into a smaller one that preserves a property of interest. Language-agnostic grammar-based reducers are easy to retarget across languages, but because they reason only about syntax, they cannot perform the coupled edits needed to remove whole declarations, e.g., a method cannot be deleted while it is still called. As a result, they waste oracle calls on edits that cannot succeed and often leave irrelevant declarations behind. We present SCYTHE, a fast, semantic-aware pre-processing step that runs in front of any grammar-based reducer without modifying it. SCYTHE encodes the program as a typed declaration dependency graph and performs a set of semantic-aware operators that decouple declarations from their use sites, making them removable while keeping the program well-typed. Fine-grained token-level minimization is then left to the downstream reducer. On 73 benchmarks across C, Java, and Solidity, combining SCYTHE with PERSES never yields a larger result than PERSES alone, and a strictly smaller one on 70 of 73 cases. On average, the combination produces programs 55.6% smaller (up to 95.5%) and is 2.3× faster (up to 7.4×). SCYTHE also boosts LATRA, a reducer that, unlike the purely syntactic PERSES, also applies language-specific transformations: the combination produces programs 10.6% smaller (up to 61.8%) and is 2.4× faster on average. Video: https://youtu.be/uEq_YYU0zZw

Index Terms—Program reduction, delta debugging, compiler testing, semantics

I. INTRODUCTION

Automated program reduction is integral to debugging and bug deduplication in software systems that take programs as input, such as compilers, interpreters, and static analyzers. Given a program PP that exhibits a property of interest, such as a compiler crash, a miscompilation, or a static-analysis report, a reducer produces a smaller program P′P' that still exhibits it, querying an oracle (a script that checks the property) on each candidate [1]. Existing reducers fall into two families. Language-specific reducers, such as C-Reduce [1], apply transformations tailored to one language (e.g., C). These transformations make reduction effective, but the tools are hard to retarget to other languages. Language-agnostic, grammar-based reducers [2], [3] instead delete syntax while guaranteeing that the result still parses, so they can be retargeted to a new language simply by supplying its grammar. However, this generality comes at a cost. Language-agnostic reducers can be slow, even on small programs, and often leave behind code that is irrelevant to the property of interest.

Example: Consider a Java program that crashes the Java compiler (javac, JDK 8.0.32); it spans 300 lines with 16 top-level types, 55 methods, and heavy use of inheritance, generics, and lambdas. Figure 1a shows the version produced by PERSES [2], a state-of-the-art language-agnostic reducer, after roughly five minutes. Several remaining declarations (e.g., class Base, field active, method label) are irrelevant to the bug, yet PERSES cannot remove them because they are still referenced elsewhere.

The problem: Programs targeted by reduction tools contain many declarations unrelated to the property of interest (here, most of the 16 types and 55 methods). The goal is to identify and remove these irrelevant declarations, ideally eliminating large blocks of code quickly with few oracle queries. However, doing so requires breaking the dependencies that tie each declaration to its use sites, edits that a language-agnostic reducer cannot perform.

Our tool: We bridge the gap between language-agnostic and language-specific reducers with SCYTHE, a fast, semantic-aware pre-processing step that runs before a language-agnostic reducer. It targets developers and testers of compilers, interpreters, and static analyzers, e.g., when reducing fuzzerround bugs. SCYTHE removes whole classes, methods, and fields, applying a set of general, semantic-aware decoupling operators that rewrite a declaration's use sites. The declaration then becomes removable while the program remains well-typed. SCYTHE supports C, Java, and Solidity, and is easily extensible to new languages. On our running example, the SCYTHE + PERSES pipeline produces the smaller program of Figure 1b in about two minutes (2.1× speedup), with 43% fewer tokens than PERSES alone. Across 73 benchmarks, SCYTHE never makes the output of PERSES larger, at least halves it in 50 cases, and speeds up reduction by up to 7.4×. On Java, SCYTHE alone, in under a minute on average, already beats PERSES on 23 of 34 benchmarks. Paired with LATRA [4], SCYTHE yields programs 10.6% smaller (up to 61.8%) and reduction 2.4× faster on average, all without modifying the underlying reducers.