Benchmarks
Measure pull request review quality with reproducible JSONL suites and explicit context ablation.
Metrics measured
CodeSpider's evaluation harness (internal/benchmark, CLI: codespider bench) is compatible
with ReviewBench and SWE-PRBench-style JSONL fixtures and reports the following metrics:
| Metric | Definition |
|---|---|
| Precision | TP / (TP + FP) — emitted findings matching a ground-truth issue in the same file and category. |
| Recall | TP / (TP + FN) — ground-truth issues detected across the benchmark split. |
| F1 Score | Harmonic mean of Precision and Recall. |
| False-Positive Rate (FPR) | Fraction of clean (zero-issue) PR fixtures receiving at least one spurious finding. |
| Inline Line Accuracy | Matched findings whose reported end_line falls within ±3 lines of ground truth. |
| Latency & allocations | Wall-clock review time per PR and change in runtime.MemStats.TotalAlloc (cumulative bytes allocated, not peak memory). |
Context ablation & baseline separation
Following SWE-PRBench methodology, CodeSpider separates deterministic static intelligence from LLM reasoning so teams can isolate static signal from model cost:
- Offline deterministic baseline (
--offline): Measures pure AST, invariant, and secret-scan accuracy with zero LLM calls or token spend. - Agentic comparison mode: Evaluates models (such as
gpt-5,gpt-5-mini, or local vLLM endpoints) under equivalentmax_stepsandmax_tokens_per_runbudgets.
JSONL fixture schema
| Field | Purpose |
|---|---|
| id, repo, language | Fixture identifier, repository slug, and primary language. |
| diff & commit_patches | Unified PR diff plus optional intermediate commits for deleted-before-HEAD secret detection. |
| base_files & files | Before/after file snapshots for Go AST and type-based contract diffing. |
| expected | Ground-truth array of {file, line, category, severity} objects. |
Reproduce the eight-case offline baseline
This local capture ran on 2026-11-27 with go1.27.1 darwin/arm64 at source commit
fed7f5c.
It makes no LLM calls and uses the
pinned JSONL fixture.
git clone https://github.com/Eresus-Security-OSS/CodeSpider.git
cd CodeSpider
git checkout fed7f5cc90ec22a8e8a15abe45e61f824a4cf1f4
go run ./cmd/codespider bench --offline --dataset testdata/benchmarks/local_suite.jsonl Benchmark: testdata/benchmarks/local_suite.jsonl (offline-deterministic)
Cases: 8 | TP: 9 | FP: 0 | FN: 0 | FP/PR: 0.000
Precision: 1.000 [0.701..1.000] | Recall: 1.000 [0.701..1.000] | F1: 1.000
FPR: 0.000 [0.000..0.793] | LineAcc: 1.000 | SevAcc: 1.000 | AvgLatencyMs: 8.75 The 8.75 ms figure is a mean for this local offline suite. The sample does not measure model latency, real-world review accuracy or competitor performance. The recorded Gitea walkthrough is a separate validation run.