Separate What from How: Repairing Static Analyzer Summaries with a Typed Repair IR
Abstract
Static analyzers rely on API summaries to model library calls. Flawed summaries can cause false alarms or hide real bugs. Repairing them requires preserving dependencies among summary facts, which free-form LLM edits can violate. We present OpCraft, a system that uses counterexamples to validate repairs to static-analyzer API summaries. OpCraft expresses LLM-selected edits in Summary Repair IR (SRI), a typed intermediate representation that makes operator applicability, effects, dependencies, bindings, and ordering explicit. Deterministic backends translate SRI sequences into validation code and analyzer patches. OpCraft accepts a repair only when the generated code produces the expected analyzer behavior. We evaluate OpCraft on single-defect and multi-defect benchmarks for the Clang Static Analyzer (CSA). Across three LLMs, OpCraft repairs at least 96% of single-defect tasks at pass@1, compared with 30% to 37% for free-form repair. It also remains effective on multi-defect tasks. Ablations show that reliable repair requires typed applicability, effects, and dependency semantics beyond output schema checks. CSA C++ patch candidates generated from accepted SRI sequences pass both per-task LLVM validation and the full CSA regression suite.
Create a lesson
Related papers
When Diagnostics Mislead in Verified Code Repair
Shared title terminologycs.SEJunyi Yang
Analyzing and Clarifying Software Change Intentions via Project Asset Dependency Mining
Shared title terminologycs.SEYingtao Fang, Zhi Jin, Tiankuo Zhao et al.
Beyond Static GUI Agent: Evolving LLM-based GUI Testing via Dynamic Memory
Shared title terminologycs.SEMengzhuo Chen, Zhe Liu, Chunyang Chen et al.
Two Views, One Fix: Multi-Modal Learning for Automated Vulnerability Repair
Shared title terminologycs.SENoah Frontzkowski, Emanuele Iannone, Riccardo Scandariato
Typed Decision Probabilities Can Fail Silently
Shared title terminologycs.SEJunwei Yao, Yongxi Zhou, Wenbo Ye et al.
DUPLEX: A Dual-Plane Architecture for Monitored and Staged Repo-Level Code Repair
Shared title terminologycs.SEYinuo Deng, Kaiyu Deng, Hanchen Wang et al.