benchmark-results / README.md
jfbrown95's picture
Use configured bug and security floors and 70% semantic lint cutoff
b861a3e verified
|
Raw History Blame
9.87 kB
metadata
language: []
pretty_name: Perch Benchmark Results
viewer: false

Perch benchmark results

This benchmark compares TypeSafe's Jev, a System One classifier, with open models on finding bugs and security issues in individual code methods. Each record contains a method before and after a transaction change, plus input adapted from a Perch scan: method source, imports, callers, callees, and static call-graph edges where available. Models score each version independently, without seeing the repair. Benign reference methods are included, so a before method is not automatically positive.

Pairs come from open-source projects in Rust, JavaScript, TypeScript, Python, Go, Java, C, C++, C#, PHP, and other languages. Bug, security, and user-written semantic lint rules are separate tracks. Public and private splits are disjoint by source repository.

Reading the results

  • AP measures how well scores rank actual issues across cutoffs.
  • Alert floors: Bug and security checks use their configured Perch floors: 60% for has_bug, 70% for does_what_it_claims, and 60% or 70% for individual CWEs. A method alerts when any applicable issue score is strictly above its floor. Semantic lint uses a 70% run-wide floor. All models use the same floors within each track.
  • Precision is the share of alerts that are correct; recall is the share of actual issues found; F1 combines both.
  • TP, FP, and FN are correct alerts, false alerts, and missed issues.
  • Pair order is the share of eligible repairs where the issue-bearing before method scores above the fixed after method. Ties do not count.

Bugs

Public pairs

Public — 2,220 pairs

Model AP Precision Recall F1 TP FP FN Pair order Inference cost
CLM-v0.1-8B 42.1% 42.2% 81.9% 55.7% 1,525 2,087 336 45.3% ~$0.210
SemiF 44.6% 43.9% 43.0% 43.4% 800 1,023 1,061 44.9% $0.239
DiffusionGemma Jev 46.8% 47.1% 33.4% 39.1% 621 698 1,240 52.4% $0.239
Jev 46.2% 55.6% 5.9% 10.6% 109 87 1,752 42.1% $0.620

Sorted by F1. Bold marks the best value in each quality column; lower FP and FN are better.

Private — 498 pairs

Model AP Precision Recall F1 TP FP FN Pair order Inference cost
CLM-v0.1-8B 42.7% 42.4% 79.5% 55.3% 337 458 87 47.9% ~$0.047
SemiF 44.5% 44.0% 44.3% 44.2% 188 239 236 42.4% $0.054
DiffusionGemma Jev 47.9% 49.4% 35.8% 41.5% 152 156 272 53.1% $0.054
Jev 47.0% 51.9% 6.6% 11.7% 28 26 396 48.1% $0.138

Sorted by F1. Bold marks the best value in each quality column; lower FP and FN are better.

Security

Public pairs

Public — 1,311 pairs

Model AP Precision Recall F1 TP FP FN Pair order Inference cost
SemiF 43.9% 43.6% 100.0% 60.7% 1,142 1,479 0 46.2% $0.208
CLM-v0.1-8B 42.9% 43.6% 100.0% 60.7% 1,142 1,480 0 45.9% ~$1.432
Jev 51.5% 53.1% 34.6% 41.9% 395 349 747 52.6% $0.507
DiffusionGemma Jev 48.2% 49.7% 33.1% 39.7% 378 382 764 53.7% $0.208

Sorted by F1. Bold marks the best value in each quality column; lower FP and FN are better.

Private — 439 pairs

Model AP Precision Recall F1 TP FP FN Pair order Inference cost
SemiF 46.8% 45.3% 100.0% 62.4% 398 480 0 50.0% $0.074
CLM-v0.1-8B 46.9% 45.3% 100.0% 62.4% 398 480 0 51.3% ~$0.528
DiffusionGemma Jev 49.2% 49.4% 21.9% 30.3% 87 89 311 51.5% $0.074
Jev 48.9% 50.6% 20.6% 29.3% 82 80 316 40.2% $0.182

Sorted by F1. Bold marks the best value in each quality column; lower FP and FN are better.

Perch Lint Bench

Public pairs

Public — 214 pairs

Model AP Precision Recall F1 TP FP FN Pair order Inference cost
DiffusionGemma Jev 87.0% 91.1% 52.8% 66.9% 113 11 101 86.4% $0.018
Jev 95.0% 99.1% 50.0% 66.5% 107 1 107 96.3% —
CLM-v0.1-8B 50.5% 50.9% 38.8% 44.0% 83 80 131 51.4% ~$0.010
SemiF 50.0% 50.7% 32.2% 39.4% 69 67 145 56.5% $0.018

Sorted by F1. Bold marks the best value in each quality column; lower FP and FN are better.

Private — 71 pairs

Model AP Precision Recall F1 TP FP FN Pair order Inference cost
Jev 94.3% 97.4% 53.5% 69.1% 38 1 33 94.4% —
DiffusionGemma Jev 83.0% 86.4% 53.5% 66.1% 38 6 33 85.9% $0.006
CLM-v0.1-8B 51.4% 50.7% 50.7% 50.7% 36 35 35 56.3% ~$0.003
SemiF 48.9% 48.4% 42.3% 45.1% 30 32 41 50.7% $0.006

Sorted by F1. Bold marks the best value in each quality column; lower FP and FN are better.

The bug and security tables use Perch's configured question floors. Semantic lint rules have no configured floor, so this benchmark uses a 70% run-wide floor to limit noisy alerts.

CLM-v0.1-8B still alerts on every security method at these floors; SemiF alerts on all but one public negative method and every private method. Their security F1 is therefore effectively the always-alert baseline, as the FP columns show.

Inference costs cover scoring the method sides in each table. Jev costs are estimated from API-reported input tokens at TypeSafe's published rate. Beam costs are API-reported. CLM cost is an estimated share of a 38.4-minute H100 run costing $2.23 total, allocated by embedding count. Jev's semantic-lint token cost was not recorded. Costs are not ranked.

JevLike (192-byte input), Laya (512-token input), and Kev (packed-branch limit) could not score every full-context method. NanoJev was unavailable on Beam. They are excluded rather than ranked on partial results.

Files and reproduction

To run Jev with the current pack, set TYPESAFE_API_KEY or PERCH_API_KEY in your environment:

python3 benchmark.py run --domain bug --scorer jev --predictions bug-jev.jsonl --report bug-jev.json
python3 benchmark.py run --domain security --scorer jev --predictions security-jev.jsonl --report security-jev.json

For another model, use --scorer command --command 'python3 your_adapter.py' --model-revision YOUR_MODEL. The adapter receives the method state and each applicable detection question and returns its true-answer probability. The runner saves predictions for resumption and reports scores only when every method side is complete.

Perch website