spackle

← Spackle home

Benchmark

Spackle ships a labelled corpus and a command that scores a run against it. This page says what the corpus is, how a finding is matched to ground truth, how each metric is computed, how to run it, and what the numbers do not tell you.

This page states no results. The README shows them, in a table generated from the results files committed under bench/results.

What the corpus is

bench/corpus holds small fixture projects. Each is a few files that either contain planted flaws at known locations or are clean decoys: code that looks risky to a pattern matcher and is correct.

Everything under bench/corpus/ is vulnerable on purpose. Never deploy it. bench/README.md has the fixture naming scheme, the truth.json schema and the steps for adding a fixture.

How scoring works

Each fixture is scanned as its own run, in a temporary state directory, and its findings are compared with its truth.json. The matching rule, quoted from internal/bench/score.go:

A reported finding matches a truth entry when the class is equal, the file is equal (forward slashes, case-sensitive) and the line is within 3 lines. Each truth entry and each reported finding is matched at most once; when several candidates exist prefer the smallest line distance, then the lower finding id. Dismissed findings are ignored entirely (not TP, not FP). In a clean fixture every non-dismissed reported finding is a false positive.

In practice:

Metrics

Each is computed over the totals for the run, exactly as below. A ratio with a zero denominator is reported as 0. Ratios are rounded to four decimal places in the file.

Metric Computation
Precision TP / (TP + FP). How much of what Spackle reported is real
Recall TP / (TP + FN). How much of what is planted Spackle found
F1 2 x precision x recall / (precision + recall)
Verified-fix rate Verified fixes / TP
Cost per finding Model spend for the whole run / TP
Decoys flagged The number of clean fixtures with at least one false positive, next to the number of clean fixtures
Fixtures failed Shown only when a fixture's scan failed. Such a fixture is left out of every other figure, and spackle bench does not write a results file unless --force is given

Notes on two of them:

The file also breaks the totals down by language and by difficulty.

How to run it

The deterministic run needs no model and costs nothing:

make bench            # Linux and macOS
.\make.ps1 bench      # Windows PowerShell

Both build the binary and run:

spackle bench --corpus bench/corpus --out bench/results

bench is a maintainer command. It does not appear in spackle help, and spackle bench --help lists its flags:

Flag Default Meaning
--corpus bench/corpus Directory that holds the fixtures
--out bench/results Directory to write the results file into, or to read for --table
--force off Overwrite an existing results file for the same date and model, and write a file even when some fixture scans failed
--table off Print the README table for all results in --out and exit without running
--provider, --model, --base-url none The model to benchmark. See config.md
--budget-usd 5 Spend cap for the whole benchmark, across all fixtures
--budget-tokens 2,000,000 Token cap, applied to each fixture separately
--config ./spackle.toml Config file, for per-stage models and pricing
--allow-unpriced off With --yes, run a model with no known price although a dollar cap is set (the cap is then not enforced)
--fix, --no-fix fixes on --no-fix finds and explains only, so the verified-fix rate is not measured
--max-findings from config Report at most this many findings per fixture
--exclude none Glob of paths not to scan, relative to each fixture; repeatable
--offline off Refuse any connection that would leave this machine (a local model only)
--yes off Skip the confirmation before a paid run

To benchmark a model:

spackle bench --provider anthropic --model claude-opus-5-5 --budget-usd 5

What to expect from a paid run:

The repository also has a manually triggered bench workflow that runs the same command and uploads the results file as an artifact. Committing a results file is a separate, reviewed change.

The results file

One run writes one file: bench/results/<date>-<model>.json. The date is UTC. The model name is lower-cased and reduced to letters, digits, dots, underscores and dashes. A deterministic run is named <date>-none.json.

Field Content
schema spackle.bench/v1. A file with another schema is refused
date YYYY-MM-DD, UTC
spackle_version, commit What produced it
mode deterministic or agentic
provider, model The model benchmarked; model is none for a deterministic run
corpus Counts: fixtures, clean, vulnerable, truth entries, fixtures by language
totals True and false positives, false negatives, precision, recall, F1, verified fixes and rate, cost, tokens, cost per finding, decoys flagged
by_language, by_difficulty The same totals, split
fixtures Per fixture: the counts, each matched pair, each missed truth entry, each spurious finding, and the error if the scan failed
notes Anything that qualifies the run

Because every match, miss and spurious finding is listed, you can check any total by hand.

The honesty rule

Limits

Read the numbers with these in mind.

The useful comparison is between two results files on the same corpus version: one model against another, or one Spackle version against the next. To learn how Spackle does on your code, run it on your code.

This page is rendered from docs/benchmark.md in the repository.