SPEC-020: Benchmark suites¶
- Status: Implemented
- Milestone: v0.12 "Benchmarks"
- Owners: lead maintainer
1. Purpose¶
Give agents a score that means the same thing for everyone, every time. A benchmark suite is a named, versioned set of tasks with fixed worlds, opponents, seeds and limits. Any agent can be run on it to get one combined score with a confidence interval, plus a score per task, and the results can be published as a leaderboard. Suites are built on experiments (SPEC-019) and reports (SPEC-013), so every number traces back to run logs.
2. Terms¶
Keywords MUST, SHOULD and MAY follow RFC 2119.
- Suite: suite.yaml plus every file it uses (scenarios, worlds, checkers), under one name
and version.
- Task: one scenario in a suite, the role the tested agent plays, the opponents, the seeds,
and how the task is scored.
- Submission: the results of one agent on one suite version: logs plus submission.json.
- Baseline and reference: two fixed agents per task (for example random and perfect play),
or two fixed numbers, that set what a score of 0 and of 1 mean.
- Agent reference: a registered name or file (scripted/random, my_agent.py:Bot), or a
mapping with use and optionally config and wrap, as an agent is written in a scenario.
3. Requirements¶
Suites¶
- BEN-001 A suite file MUST have
suite(a name),version(semantic version),descriptionandtasks. Each task MUST haveid,scenario,role(the agent slot the tested agent takes),seeds(an explicit list),metric(win_rate,pass_rate, orevaluator:<name>.<field>),baselineandreference(each an agent reference or a fixed number), and MAY haveopponents(agent references for the scenario's other slots),weight(default 1) andrequires(dockerorgpu). It MUST validate againstspecs/schemas/suite.schema.json, and every task'sscenario(a path relative to the suite file),roleandopponentsMUST name files and agent slots that exist. - BEN-002 A suite's identity MUST be its name, version and a content hash over every file in
the suite's folder (the suite file and every file it uses), written to
suite.lockbyagentplaykit bench lock. The lock MUST also record each task's world name and version, and the raw score of every baseline and reference given as an agent, measured by playing it on the task's seeds. Running a suite whose files or worlds no longer match its lock MUST fail with an error that says a new version is needed. - BEN-003 Any change to a task, seed, opponent, limit or world MUST need a new version; results from different versions MUST NOT be ranked together.
Running and scoring¶
- BEN-004
bench runMUST run every task and seed of a suite for one agent, through the experiment machinery (resumable, budgeted, parallel, SPEC-019):agentplaykit bench run <suite> --agent <agent file or reference> [--workers N]. It MUST writesubmission.jsonwith the suite identity, the agent (redacted config, wrappers, model revisions), each log's hash, and the scores. - BEN-005 A task's raw score MUST be the mean of its metric over its seeds, where one run scores:
win_rate: 1 when the tested agent is among the winners, else 0;pass_rate: 1 when at least one evaluator gave a pass or fail and every such evaluator passed, else 0;evaluator:<name>.<field>: that evaluator'sscore,passed(1 or 0) ordetailsfield, and 0 when it is missing.
Its normalised score MUST be (raw - baseline) / (reference - baseline), so the baseline
scores 0 and the reference scores 1; values outside 0 to 1 are kept, not clipped, and shown as
below the baseline or above the reference. bench lock MUST refuse a task whose baseline and
reference score the same. The combined score MUST be the weighted mean of normalised task
scores.
- BEN-006 Every score MUST come with a 95% interval from a seeded bootstrap over each task's
seeds (1000 samples, a fixed seed recorded in the submission), and the suite's combined
interval MUST be computed from the same samples.
- BEN-007 A submission that skipped tasks MUST be marked partial and list them with the
reason (a missing requirement, a budget stop, or a run that failed with aborted or
world_error); partial submissions MUST NOT get a combined score, only task scores.
- BEN-008 agentplaykit bench verify <submission> MUST recompute every score from the logs
(and their evaluation files) and fail if anything differs, or if a log's or evaluation file's
hash does not match.
Built-in suite¶
- BEN-009 The framework MUST ship
agentplay-basicsversion 1.0.0: tic-tac-toe asxand asoagainst random and against minimax, rock-paper-scissors against a biased bot (scripted/biased, a new scripted agent), the treasure hunt, the guessing game, and the negotiation world (SPEC-017) against a scripted negotiator, with a sandbox task markedrequires: docker. Its baselines and references MUST be scripted agents or fixed numbers, so it can be scored with no key. The suite carries its own copies of the example worlds it uses, since a suite version never changes. - BEN-010 The framework MUST ship submissions for the suite's baseline agent
(
scripted/random) and for a scripted reference agent that plays every task's reference, so every leaderboard starts with reference points.
Leaderboards¶
- BEN-011
agentplaykit bench board <submissions...> --out DIRMUST buildboard.htmlandboard.json: agents ranked by combined score with intervals, per-task scores, cost and tokens per submission, model revisions and dates, with adjacent agents whose intervals overlap marked "not clearly different" (as RPT-015). Only submissions of the same suite version are ranked together; others are listed separately. - BEN-012 The board MUST follow the page rules of SPEC-012 (one static file, data shown only as text) and MUST link every score to the replay pages of its runs.
- BEN-013 The docs MUST explain how to publish a board on GitHub Pages or a Hugging Face Space, and that a suite's seeds are public, so a model trained on them can overfit; held-out seeds are an open question.
4. Acceptance criteria¶
| Requirement | Test ID | Notes |
|---|---|---|
| BEN-001..003 | BEN-001..BEN-003 |
schema; lock and changed-file refusal; versions kept apart |
| BEN-004..008 | BEN-004..BEN-008 |
scripted agents on a small test suite; normalisation by hand; bootstrap repeats exactly; partial submissions; verify catches an edited log |
| BEN-009..010 | BEN-009, BEN-010 |
the built-in suite runs with no key; baseline submissions score 0 and 1 where expected |
| BEN-011..013 | BEN-011..BEN-013 |
board ranking and "not clearly different"; page rules; docs |
5. Examples¶
suite: agentplay-basics
version: 1.0.0
description: Small strategy and task worlds, scored against scripted baselines.
tasks:
- id: ttt-x-vs-random
scenario: tasks/tic-tac-toe.yaml
role: x
opponents: {o: scripted/random}
seeds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
metric: win_rate
baseline: scripted/random # scores 0
reference: scripted/minimax # scores 1
- id: ttt-o-vs-minimax
scenario: tasks/tic-tac-toe.yaml
role: o
opponents: {x: scripted/minimax}
seeds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
metric: evaluator:outcome.score # a draw scores 0.5 here
baseline: 0.0
reference: 0.5
agentplaykit bench run agentplay-basics --agent '{use: ollama, config: {model: "qwen2.5:3b"}}'
agentplaykit bench verify runs/agentplay-basics-1.0.0/qwen2.5-3b/submission.json
agentplaykit bench board runs/agentplay-basics-1.0.0/*/submission.json --out board
6. Open questions¶
- Held-out seeds that only a maintainer can run, to limit overfitting.
- Signed submissions, and accepting submissions from other people.
- Pushing boards and logs to the Hugging Face Hub (a later spec).
7. Change log¶
- 2026-12-01: Initial draft.
- 2026-12-02: Accepted by the lead maintainer for v0.12, with details settled for the build:
- tasks MAY name
opponents, and an agent reference may be a mapping; - the lock hashes the whole suite folder and records world versions and the measured raw scores of agent baselines and references (BEN-002);
- the per-run value of each metric is defined, and equal baseline and reference scores are refused (BEN-005);
- failed runs make a task skipped (BEN-007);
- verify also hashes evaluation files (BEN-008);
- the biased bot is
scripted/biased, and the suite copies its example worlds (BEN-009); - the shipped submissions are for
scripted/randomand a scripted reference agent (BEN-010). - 2026-12-03: Implemented in v0.12.0; every requirement has a test.
- 2026-12-04:
bench runrefuses a human agent (SPEC-027 HUM-014).
Changes to other specs on acceptance¶
- SPEC-007, new CLI-019:
bench lock|run|verify|board. - SPEC-009, ADP-004: the
scripted/biasedbot (ADP-013 applies). - ADR-0012 on normalising against baseline and reference agents, and on bootstrap intervals for combined scores.