SACB / source /README.md
ilintar's picture
Add corpus source: base repos, task overlays, hidden tests, and the authoring tools
9368cc4 verified
|
Raw
History Blame Contribute Delete
3.08 kB

SACB — corpus source

The parquet files in this repository are the materialised benchmark: each record carries a full file map, hidden tests and reference fix, which is everything a harness needs to run SACB.

This directory is what those records were built from, so the corpus can be regenerated, extended, or ported to another language.

Layout

corpus/<lang>/<repo>/repo/            the base tree, in its CORRECT state
corpus/<lang>/<repo>/tasks/<id>/task.json   metadata + the bug report
corpus/<lang>/<repo>/tasks/<id>/break/      overlay that injects the defect
corpus/<lang>/<repo>/tasks/<id>/tests/      hidden tests
corpus/<lang>/<repo>/tasks/<id>/gold/       optional; defaults to the base tree

The base repository is the correct code and each task overlays a defect on top of it. The reference fix is therefore the base itself, which is why a task cannot ship with a "solution" that does not work. For add-a-feature tasks the break overlay simply removes the implementation.

Tools

script role
tools/build_corpus.py validate every task and emit the JSONL the parquet is built from
tools/make_tasks.py helper used by the authoring scripts
tools/tasks_*.py the authoring batches, one defect or compound per entry
tools/gen_compounds.py compose compound tasks from validated single defects
tools/select_corpus.py choose the shipped mix to hit a target resolved rate
tools/upload_sacb.py publish to this repository
tools/harness-tests/ tests for the llama-eval harness itself

These import eval_sandbox and agentic_eval from examples/llama-eval/ in llama.cpp, so point sys.path at a checkout that has them.

Regenerating

python3 tools/build_corpus.py --corpus corpus --out agentic-corpus.jsonl

fail_to_pass and pass_to_pass are derived, never written by hand: the tests are run once against the defective tree and once against the reference, and the sets fall out of the difference. The builder rejects a task whose defect no test exercises, and one whose reference fix does not itself pass. It caught several authoring mistakes that way, which is the point.

Adding a task

Add an entry to a tasks_*.py batch giving the exact anchor text to replace and the tests, run the builder, and fix whatever it rejects. Anchors are matched exactly and must occur exactly once, so a defect can never silently fail to be injected.

Adding a language

The harness takes a new language as a LangSpec entry (linter argv, test runner, packages) without any other change. Java was scoped out of this release but needs no harness work — a JDK tarball plus the JUnit console-standalone jar would keep the no-container property.

Calibration

CALIBRATION.md records every measurement taken while tuning this corpus, and in particular the four assumptions about difficulty that measurement contradicted. Read it before changing the composition — the headline is that repository size, not defect count, is what makes these tasks hard.