RELAY: Scaling Historical Build Restoration through Rule Reuse and Agentic Repair
Organizations: The University of Osaka, Osaka, Japan
Abstract
Vulnerability benchmarks and software engineering research depend on rebuilding historical software. Yet builds rely on external resources, such as base images and packages, that change independently of the source code. In this study, we examine this environment decay on 14,159 OSS-Fuzz cases. We find that 69.7% no longer complete reconstruction and verification, and that most failures share a small number of recurring failure symptoms. A recurring failure can therefore be diagnosed once and its repair reused. We present Relay, a hybrid framework that uses an LLM to derive and validate deterministic repair rules from representative failures, reuses them without model calls, and escalates cases unresolved by rules to a per-case agent. We evaluate Relay in human-guided and fully automated rule-derivation campaigns and compare it with a per-case agent approach. We find that rule derivation can be fully automated, and that reusable rules restore as many builds as per-case agents with fewer build executions. However, agents restore cases that the rules cannot. Our results show that a hybrid approach that applies rules first and escalates the remaining cases to an agent restores more builds than either approach alone and at a lower cost than using agents alone.
Figures & tables
| Dataset or evaluation subset | Cases |
| Historical cases executed | 14,159 |
| Cases that failed reconstruction | 9,868 |
| Failed cases with usable failure evidence | 4,513 |
| Cases reached by the repair campaigns | 2,451 |
| Cases held out from rule derivation (RQ3) | 400 |
| Cases still failing before the rule-agent comparison (RQ3) | 50 |
| Setting | Value |
|---|---|
| Local models | Qwen3.8-27B and Qwen3.6-27B, Q4_K_M |
| Local serving | Ollama, four one-GPU replicas (RTX A6000, 48 GB) |
| Local sampling | Temperature 1.0, top- 0.95, top- 20 |
| Local context | 131,072 tokens |
| Hosted models | Terra: medium; Sol: high reasoning effort |
| Reasoning | Enabled and preserved across turns |
| Phase | With rules | No patch | Total |
|---|---|---|---|
| Human-guided (about 3 months) | 231 | 202 | 433 |
| Automated (2 weeks) | 238 | 84 | 322 |
| Total | 469 | 286 | 755 |
| Ecosystem | Recovered/attempted | Rate | 95% CI |
|---|---|---|---|
| C | 19/66 | 28.8% | [19.3, 40.6] |
| JVM | 50/212 | 23.6% | [18.4, 29.7] |
| C++ | 119/692 | 17.2% | [14.6, 20.2] |
| Go | 41/349 | 11.7% | [8.8, 15.5] |
| Python | 2/49 | 4.1% | [1.1, 13.7] |
| Rust | 7/309 | 2.3% | [1.1, 4.6] |
| Outcome Group | Recovered cases | Crash reproduced | Benchmark-ready |
|---|---|---|---|
| No patch | 286 | 145 (50.7%) | 127 (44.4%) |
| Repair chain | 469 | 247 (52.7%) | 205 (43.7%) |
| Outcome | Cases |
|---|---|
| No rule matched the observed failure | 376 |
| All matching rules tried; build unresolved | 8 |
| Rule matched; repair could not be applied | 5 |
| LibreOffice cases excluded from evaluation | 11 |
| Total | 400 |
| Recovered | 0 |
| Rules | Qwen3.8 | Terra | Rules, then Qwen3.8 | Rules, then Terra | |
| Restored / 50 | 30 | 26 | 24 | 39 | 37 |
| Builds | 47 | 145 | 88 | 111 | 83 |
| Builds per restored case | 1.57 | 5.58 | 3.67 | 2.85 | 2.24 |
| Agent tokens | 0 | 14.8M | 16.6M | 6.3M | 7.2M |
| Model API charge | $0 | local | $10.53 | local | $4.41 |
| Measure | Qwen3.8 | Qwen3.6 | Terra |
|---|---|---|---|
| Recovered / 57 | 16 | 14 | 10 |
| Rate | 28.1% | 24.6% | 17.5% |
| 95% Wilson CI | [18,41] | [15,37] | [10,29] |
| Crash reproduced | 10 | 11 | 7 |
| Build executions | 156 | 128 | 78 |
| Builds per recovered case | 9.75 | 9.14 | 7.80 |
Software Engineering Agents
Software Engineering Agents are AI systems that use code, tools, and feedback to perform software development tasks.
See all 344 papers