Skip to main content

PASR-Bench

A small, pre-registered protocol for measuring a code-context retriever, and the harness that runs it. Packaged separately from pasr-mcp (pip install ./eval, distribution name pasr-bench). Results for PASR itself: RESULTS.md and ../docs/competitors-benchmark.md.

What it measures

Real-agent run — four arms per task, each producing the same ArmResult:

  1. native_search — deterministic grep + read-files (stand-in for an agent's own tools)
  2. broad — the whole repo, source-first, truncated to a cap
  3. pasrselect_context at a fixed budget
  4. pasr_fallbackpasr, then one budget widening if confidence is low

A model answers each task from only that arm's context (UNKNOWN if absent); a second model judges the answer against the task's expected identifiers; critical_source_hit is still required. Metrics: task success, model input tokens (incl. a flat per-tool-call overhead), round trips, critical-source miss rate, fallback rate. Then a paired non-inferiority test of pasr / pasr_fallback vs the baseline_arm at the plan's margin_task_success (point estimate + 10k-resample bootstrap CI).

Bake-off — an offline, no-API retrieval comparison at a shared budget: grep, repomap (aider-style signatures), embed_lex (a no-setup semantic floor), pasr, pasr_hash, pasr_map. Scored on critical-file hit ∧ keyword coverage, split by task kind.

No GPU. Arms run on CPU; the only model use is one answer + one judge call per (task, arm) — ~400 Anthropic calls for the 50-task plan. Full Sonnet ≈ $12–15; a cheap --model with a strong --judge-model ≈ $4–6.

Install & run

pip install ./eval               # the pasr-bench distribution (deps: pasr-mcp)
pip install "./eval[llm,plots]"  # + anthropic (real agent) + matplotlib (report.png)

pasr-bench plans                             # the packaged plan(s)
pasr-bench run --agent keyword               # offline smoke: full matrix + report + validation
pasr-bench bakeoff --budget 6000             # offline retrieval bake-off

export ANTHROPIC_API_KEY=sk-ant-...
pasr-bench run --agent claude --max-tasks 4  # cheap trial (~$0.4)
pasr-bench run --agent claude \
  --model claude-haiku-4-5 --judge-model claude-sonnet-5 \
  --checkout-dir .eval-checkouts             # budget-safe full run (~$4–6)

Each finished (task, arm) row is appended to matrix.jsonl and flushed, so a crash keeps every completed row; --resume <run_dir> reloads the partial matrix and finishes into the same delivery. --checkout-dir DIR reuses clones. PASR_EVAL_BROAD_CAP=30000 shrinks the broad arm. A run writes <out>/<plan>_<utc>/ with matrix.jsonl, report.{json,md,png}, validation.json, resolved_commits.json.

python eval/run_eval.py … and python eval/bakeoff.py … still work as thin shims for the two sub-commands.

Bring your own retriever

The protocol is retriever-agnostic. To measure a different context tool against the same 50 tasks and the same baselines:

  1. Add an arm in pasr_eval/arms.py: extend ARMS and add a branch in _build(...) that returns (context, sources, tool_calls, round_trips, fallback) for your retriever. Everything downstream — grading, metrics, non-inferiority, the validator — is arm-agnostic.
  2. For a bake-off arm, add a function in pasr_eval/bakeoff.py and list it in that file's ARMS.
  3. Keep the plan (pasr_eval/plans/pilot.json) fixed so numbers stay comparable, or register a new plan and cite it.

The validator (validate_matrix) rejects synthetic rows, query→answer leaks, and an unmatched task×arm matrix, so a submitted result is checkable.

Files

Path What
pasr_eval/spec.py RepoSpec / TaskSpec / EvalPlan, load_plan; the leak + kind guards
pasr_eval/arms.py the four real-agent arms → ArmResult
pasr_eval/bakeoff.py the six offline bake-off arms
pasr_eval/agents.py AgentRunner protocol, KeywordAgent (offline proxy)
pasr_eval/llm_agent.py LlmAgent — answer + judge via the Anthropic API ([llm] extra)
pasr_eval/metrics.py grade, aggregate, paired bootstrap CI, non-inferiority, full_report
pasr_eval/runner.py resolve_repos, run_plan (skip= / on_row=), write_matrix
pasr_eval/validate.py validate_matrix — no synthetic rows, no leaks, matched matrix
pasr_eval/run.py end-to-end orchestrator: clone → streamed matrix → report → validate
pasr_eval/plans/pilot.json the registered plan — 10 pinned repos, 50 tasks
RESULTS.md pre-registration + n=15 pilot + keyword-50 + the n=50 real-agent headline

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pasr_bench-0.2.0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pasr_bench-0.2.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file pasr_bench-0.2.0.tar.gz.

File metadata

  • Download URL: pasr_bench-0.2.0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for pasr_bench-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7a41ab094df4e7ca46225496865ce10397c066c4542f696b486d8e21779f9103
MD5 fd478c092412dc5b80c43e69b409193a
BLAKE2b-256 2d7ffffb162594bbfa23b77eae957401421df8942d7bd11b2572797ccf552fc2

See more details on using hashes here.

File details

Details for the file pasr_bench-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pasr_bench-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for pasr_bench-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15a6d4cb135758fc7dbac12e7f13fe4199215e6495e851a8b53383c81410d95a
MD5 788b9594b10557b784c559d7b50cb7ef
BLAKE2b-256 c83260cd69fda789c909136bbff345c88d7b872c8981b428c7695ae06c62c24d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page