CuraLoc: Repository-Level Fault Localization via Planned Code Inspection
Organizations: Microsoft
Abstract
A bug report describes what went wrong, but rarely where the code should change. Existing repository-level localization methods often let language models iteratively decide what code to inspect next, requiring repeated model calls and substantial token usage. We investigate whether these inspection decisions can instead be planned before source retrieval. In this research, we introduce CuraLoc, which first selects candidate files and represents their symbols using compact behavioral and structural descriptions. In a single planning decision, the model jointly selects starting symbols, chooses code relationships to inspect from each, and forms hypotheses about likely edits. Deterministic retrieval collects the requested source for a final ranking informed by those hypotheses, concentrating model reasoning on choosing and comparing code rather than directing each retrieval step. We demonstrate the efficacy of our proposed approach on the SWE-Bench Lite and Verified datasets. On SWE Bench Verified with GPT-5.2, CuraLoc raises Func@1 from LocAgent's 53.8% to 59.3% while using 90.3% fewer recorded tokens, and also outperforms RepoSearcher (56.2%) and Agentless (39.6%) on Func@1. On SWE-bench Lite, CuraLoc achieves a high 83.8% Func@5 accuracy improving on Agentless by more than 15% in relative accuracy. Additionally, CuraLoc supports different model backbones, with strong localization accuracy demonstrated using both GPT-5.2 and GPT-6 Astra. These results provide evidence that repository-level code inspection can be planned effectively without iterative model-controlled navigation.
Figures & tables
| Method | Func@1 | Func@5 | Func@10 | MRR | File@1 | File@10 | Tokens (K) |
|---|---|---|---|---|---|---|---|
| CuraLoc | |||||||
| LocAgent | |||||||
| RepoSearcher | |||||||
| Agentless | – |
| Method | Func@1 | Func@5 | Func@10 | MRR | File@1 | File@10 | Tokens (K) |
|---|---|---|---|---|---|---|---|
| CuraLoc | |||||||
| LocAgent | |||||||
| RepoSearcher | |||||||
| Agentless |
| Configuration | Func@1 | Func@10 | MRR |
|---|---|---|---|
| Full CuraLoc (reference) | 67.2 | 87.6 | 0.823 |
| Selection-stage readout | 55.8 | 83.2 | 0.739 |
| Source-order selection | 42.3 | 55.1 | 0.518 |
| Without summaries | 64.6 | 86.1 | 0.807 |
| Starting symbols only | 67.2 | 83.9 | 0.822 |
| Relevance-guided formulation | 63.1 | 82.8 | 0.775 |
| Method | Func@1 | Func@3 | Func@5 | Func@10 | MRR | File@1 | File@10 | Tokens (K) |
|---|---|---|---|---|---|---|---|---|
| CuraLoc | 67.0 | 84.4 | 87.4 | 89.2 | 0.935 | 84.1 | 94.5 | 138.9 |
| LocAgent | 63.2 | 80.0 | 82.2 | 85.9 | 0.896 | 81.1 | 96.9 | 95.3 |
| RepoSearcher | 66.7 | 82.8 | 87.4 | 87.4 | 0.926 | 83.9 | 94.1 | 105.0 |
| Agentless | 59.7 | 76.2 | 78.4 | 79.7 | 0.846 | 82.2 | 90.3 | 28.2 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Func@1 | Func@3 | Func@5 | Func@10 | MRR | File@1 | File@10 |
|---|---|---|---|---|---|---|---|
| SWE Bench Verified outside SWE Bench Lite ( ) | |||||||
| CuraLoc | |||||||
| LocAgent | |||||||
| RepoSearcher | |||||||
| Agentless | |||||||
| SWE Bench Verified overlapping SWE Bench Lite ( ) | |||||||
| Method | Run | A | B | C | Total failures |
|---|---|---|---|---|---|
| CuraLoc | 1 | 94 | 4 | 0 | 98 |
| 2 | 79 | 9 | 0 | 88 | |
| 3 | 88 | 4 | 0 | 92 | |
| LocAgent | 1 | 23 | 63 | 10 | 96 |
| 2 | 23 | 59 | 13 | 95 | |
| 3 | 20 | 60 | 13 | 93 |
| Run | Tasks | CuraLoc | LocAgent | Difference |
|---|---|---|---|---|
| 1 | 342 | 338 | 316 | +22 |
| 2 | 359 | 351 | 327 | +24 |
| 3 | 345 | 341 | 319 | +22 |
| Configuration | Func@1 | Func@3 | Func@5 | Func@10 | MRR | File@1 |
| Full CuraLoc (reference) | 67.2 | 81.8 | 85.0 | 87.6 | 0.823 | 88.0 |
| File scoping only | – | – | – | – | – | 74.1 |
| Selection-stage readout | 55.8 | 76.3 | 79.6 | 83.2 | 0.739 | 80.3 |
| Source-order selection | 42.3 | 51.1 | 53.3 | 55.1 | 0.518 | 75.9 |
| Without summaries | 64.6 | 81.0 | 84.3 | 86.1 | 0.807 | 86.1 |
| Starting symbols only | 67.2 | 81.0 | 83.2 | 83.9 | 0.822 | 88.3 |
| Runs | Func@1 | Func@3 | Func@5 | Func@10 | MRR | Tokens/task | |||
|---|---|---|---|---|---|---|---|---|---|
| Stage A: file policy; tokens cover S2+S3 | |||||||||
| 5 | 1 | 60 | 1 | 59.1 | 73.4 | 75.9 | 77.4 | 0.730 | 29,636 † |
| 5 | 3 | 60 | 1 | 64.2 | 79.9 | 83.2 | 85.4 | 0.797 | 41,461 |
| 5 | 5 | 60 | 1 | 62.8 | 78.5 | 81.8 | 85.8 | 0.784 | 46,635 |
| 10 | 1 | 60 | 1 | 58.8 | 73.7 | 77.0 | 78.5 | 0.731 | 38,131 |
| 10 | 3 | 60 | 3 | 51,352 | |||||
Fault Localization
Fault localization identifies the code, component, event, or location responsible for a failure so it can be diagnosed and corrected.
See all 42 papers