arXiv:2609.01775cs.ETSep 2026

Manuscript Offprint

arXiv:2609.01775

Dictionary-Guided Mutation Operators for Automated HDL Repair

Maisha Mastora, Dean Sullivan

Maisha Mastora

Department of Electrical and Computer Engineering

University of New Hampshire

Durham, NH, USA

maisha.mastora@unh.edu

Dean Sullivan

Department of Electrical and Computer Engineering

University of New Hampshire

Durham, NH, USA

dean.sullivan@unh.edu

Abstract—Automated repair of Hardware Description Language (HDL) designs remains challenging due to the large search space of candidate repairs and the strict syntactic and semantic constraints imposed by HDL grammars. Generic mutation strategies overwhelmingly generate syntactically invalid candidates that waste compilation and simulation budget, while synthesis-driven and template-based approaches impose their own constraints on generality and portability. In this paper, we propose a dictionary-guided HDL repair system that combines ANTLR-derived DUT-specific mutation vocabularies with a simulation-divergence fault localization (FL) module. The mutation operator applies category-constrained token substitutions, insertions, and deletions directly to Verilog source via regex-based matching, without requiring AST manipulation or synthesis. The FL module identifies diverging output wires from a single simulation run and scores source lines by structural proximity to those signals, directing the mutation search toward high-suspicion regions. A deterministic targeted sweep exhausts all dictionary mutations on the highest-scored lines before falling back to a genetic programming (GP) search. Evaluated on the CirFix benchmark suite across six design under test (DUT) families, the proposed approach produces correct oracle-passing repairs on 14 bug variants, including a 6-edit multi-bug instance that CirFix cannot repair, and achieves an 18×18\times speedup over CirFix on a two-edit benchmark variant. These results indicate that dictionary-constrained mutation operators, combined with lightweight simulation-divergence FL, are a practical and competitive approach to automated HDL repair for common bug classes without formal analysis or synthesis dependencies.

Index Terms—HDL repair, automated program repair, Verilog, mutation operators, fault localization.

I. INTRODUCTION

Automated Program Repair (APR) has been studied extensively in the software domain, where techniques such as symbolic reasoning, constraint solving, and heuristic search have demonstrated the ability to produce correct patches with minimal human intervention [1]. A parallel line of work treats repair as a search problem guided by an oracle, where the objective is to navigate a large space of program transformations toward variants that satisfy the required correctness specification. From this perspective, the quality of the search is determined not only by the oracle, but by the mutation operator that generates candidates for evaluation.

A fundamental limitation of text-level or byte-level mutation is poor alignment with program syntax. For languages with rich formal grammars — such as HDLs — unconstrained token edits produce syntactically invalid candidates at a high rate, exhausting compilation and simulation budget on variants that cannot contribute to repair. Prior work in structured fuzzing has demonstrated that token-aware mutation, which respects the syntactic structure of the input language, substantially improves exploration efficiency [2], [3]. The same principle applies directly to HDL repair: constraining mutations to grammar-permitted, design-local tokens increases the density of valid and behaviorally plausible candidates in the search space.

HDLs are particularly well-suited to this approach. Their syntax and semantics are defined by formal grammars with explicit token classes, operator categories, and contextual constraints. These structures can be extracted statically from any design to construct a DUT-specific mutation vocabulary without simulation or synthesis. The vocabulary defines precisely what substitutions, insertions, and deletions are structurally meaningful for each token category in the design under repair.

In this paper, we present a complete HDL repair system built around this principle. The core contributions are: (i) an ANTLR-based dictionary construction pipeline that extracts DUT-specific structural and numeric token vocabularies from the Verilog grammar and the buggy source; (ii) a simulation-divergence FL module that scores source lines by proximity to diverging output wires without AST parsing; (iii) a category-constrained mutation operator that directs substitutions, insertions, and deletions toward high-suspicion regions; and (iv) a targeted deterministic sweep that exhausts single-edit repairs before engaging a GP fallback, enabling multi-edit repair through iterative partial-fix accumulation.

We evaluate our work on the CirFix benchmark suite [4] across six DUT families, comparing against CirFix as a baseline. Our approach repairs 14 bug variants, including variants that CirFix cannot fix, and achieves substantially lower evaluation counts on several benchmarks. The results suggest that dictionary-constrained mutation, without formal analysis or synthesis, is a viable and competitive strategy for HDL repair.

979-8-3195-3156-8/26/$31.00 © 2026 IEEE across a range of common bug classes. Crucially, the mutation vocabulary is derived automatically from each design, requiring no manual repair templates.