Benchmarks¶
A benchmark suite gives an agent one score that means the same thing for everyone, every
time. A suite is a fixed set of tasks: worlds, opponents, seeds and limits that never
change within a version. Run any agent on it and you get:
- a score for each task;
- one combined score, with a 95% range;
- a submission.json that anyone can check against the run logs;
- a leaderboard page that compares submissions.
The rules are in SPEC-020, and the reasoning behind the scores is in ADR-0012.
Score an agent¶
AgentPlay ships one suite, agentplay-basics. Score a local model with it:
agentplaykit bench run agentplay-basics --agent '{use: ollama, config: {model: "qwen2.5:3b"}}'
--agent takes:
- the same agent you would write in a scenario, without id, as an inline mapping;
- a reference such as scripted/random or my_bot.py:Bot;
- a YAML file that holds the mapping, which is handy for long configs and wrappers:
# qwen.yaml
use: ollama
config: {model: "qwen2.5:3b", json_mode: true}
wrap: [format_hints]
agentplaykit bench run agentplay-basics --agent qwen.yaml --workers 2 --budget 1.00
| Option | What it does |
|---|---|
--name NAME |
The agent's name on the board and its folder (default: the model, or the agent's use) |
--workers N |
Games played at once, in separate processes, as for experiments |
--budget USD |
Stop starting games once this much has been spent |
--out DIR |
Where results go (default runs) |
Results go to runs/<suite>-<version>/<name>/: one log per game, experiment.json, and
submission.json. A run that stops part-way (Ctrl+C, a budget, a crash) picks up where it left
off when you run the same command again.
The terminal shows each task and the combined score. For the random player
(--agent scripted/random), which is also the baseline of most tasks:
agentplay-basics 1.0.0 · scripted-random: score 0.00 (-0.13 to 0.13)
ttt-x-vs-random 0.00 (-0.75 to 0.75) raw 0.60
ttt-o-vs-random 0.00 (-0.50 to 0.50) raw 0.40
ttt-x-vs-minimax 0.00 (0.00 to 0.00) raw 0.00
...
Read the score¶
Every task has a baseline, which scores 0, and a reference, which scores 1. In
agentplay-basics the baseline is usually a random player and the reference is perfect play:
| Normalised score | Meaning |
|---|---|
| 0 | as good as the baseline |
| 1 | as good as the reference |
| 0.5 | halfway between them |
| below 0 | worse than the baseline: "below the baseline" |
| above 1 | better than the reference: "above the reference" |
Scores are never clipped. The combined score is the weighted mean of the task scores. The raw score, such as the share of games won, is shown next to each task score.
The range is a 95% interval from a bootstrap over the task's seeds: AgentPlay replays the scoring 1000 times on resampled seeds. With 10 seeds per task, ranges are wide. When two agents' ranges overlap, the board marks them "not clearly different". Read that as a tie.
Partial submissions. Some tasks need something you may not have, such as sandbox-hello,
which needs Docker. A task is also skipped when a game fails (aborted or world_error) or the
budget runs out. A submission with skipped tasks is marked partial: it shows its task scores,
but gets no combined score, because the combined score must cover the same tasks for everyone.
Fix the cause and run the same command again; finished games are kept.
The agentplay-basics suite¶
| Task | World | The tested agent plays | Scored by | Baseline (0) | Reference (1) |
|---|---|---|---|---|---|
ttt-x-vs-random |
tic-tac-toe | x against random |
win rate | random | minimax |
ttt-o-vs-random |
tic-tac-toe | o against random |
win rate | random | minimax |
ttt-x-vs-minimax |
tic-tac-toe | x against perfect play |
outcome score (a draw is 0.5) | random | minimax |
ttt-o-vs-minimax |
tic-tac-toe | o against perfect play |
outcome score | random | minimax |
rps-vs-biased |
rock-paper-scissors, 9 rounds | against a bot that favours rock | win rate | random | always paper |
treasure |
treasure hunt on a 4x4 grid | the seeker | found within 8 moves | random | 1.0 |
guess |
guess a number from 1 to 100 | the guesser | 1 / guesses | 0.0 | bisection |
negotiation |
split items with private values | a against a scripted negotiator |
value won | random | the negotiator |
sandbox-hello |
a real task in a container (needs Docker) | the agent | every check passed | 0.0 | 1.0 |
Each task plays 10 seeds, except sandbox-hello, which plays 3. Every baseline and reference is
a scripted agent or a fixed number, so the suite costs nothing to score apart from your own
agent.
The repository ships two submissions in benchmarks/agentplay-basics-1.0.0/:
- scripted-random scores 0;
- reference, the suite's scripted reference player, scores 1.
Put them on your board as reference points.
Check a submission¶
agentplaykit bench verify runs/agentplay-basics-1.0.0/qwen2.5-3b/submission.json
verify recomputes every score from the logs and their evaluation files, using the bootstrap
seed recorded in the submission. It fails if any number differs, or if a log or evaluation file
was changed after the run (each one's sha256 is recorded). Run it on any submission you receive
before you put it on a board.
Build a leaderboard¶
agentplaykit bench board runs/agentplay-basics-1.0.0/*/submission.json benchmarks/agentplay-basics-1.0.0/*/submission.json --out board
This writes:
- board/board.html: one static page that ranks agents by combined score with their ranges,
and shows task scores, cost, tokens, models and dates;
- board/board.json: the same data;
- a replay page for every game, under board/replays/.
Every task score on the page links to the replays of its games. The page follows the viewer's rules: no network access, and data shown only as text.
Submissions are ranked together only when they used exactly the same suite name, version and content hash. Submissions of other versions get their own table.
Publish it on GitHub Pages¶
The board is plain files, so any static host works. With GitHub Pages:
- Copy the
boardfolder into your repository, for example asdocs/board/, or push it to agh-pagesbranch. - In the repository's Settings → Pages, publish from that branch and folder.
- Open
https://<user>.github.io/<repo>/board/board.html.
Publish it on a Hugging Face Space¶
- Create a new Space on huggingface.co and choose the Static SDK.
- Upload the contents of the
boardfolder, and renameboard.htmltoindex.html, or add anindex.htmlthat links to it. - The Space's
README.mdneedssdk: staticin its front matter. Hugging Face adds this when you choose the Static SDK.
Add the submission.json files and their logs too, so visitors can run bench verify themselves.
Make your own suite¶
A suite is a folder with suite.yaml, the scenarios it uses, any world, agent or evaluator files
those need, and suite.lock:
suite: my-suite
version: 1.0.0
description: What this suite measures.
tasks:
- id: ttt-x-vs-random
scenario: ttt-x.yaml # a normal scenario file, relative to suite.yaml
role: x # the agent slot the tested agent takes
opponents: {o: scripted/random} # optional: who plays the other slots
seeds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
metric: win_rate
baseline: scripted/random # an agent, or a number such as 0.0
reference: scripted/minimax
weight: 1 # optional
requires: [docker] # optional: docker or gpu
Metrics. Each game scores one value, and the task's raw score is the mean over its seeds:
- win_rate: 1 when the tested agent is among the winners;
- pass_rate: 1 when every evaluator that gives a pass or fail passed (at least one must);
- evaluator:<name>.<field>: that evaluator's score, passed (1 or 0), or a field of its
details, and 0 when it is missing.
Lock it before anyone runs it:
agentplaykit bench lock path/to/my-suite
lock does three things:
- hashes every file in the folder;
- records each task's world name and version;
- plays every baseline and reference that is an agent on the task's seeds, and stores their raw
scores in suite.lock.
It refuses a task whose baseline and reference score the same, because such a task cannot tell agents apart.
A version never changes. If any file in the folder changes, or a world's version moves on,
bench run refuses to run the suite and says a new version is needed. To change a task, a
seed, an opponent, a limit or a world:
1. raise version in suite.yaml;
2. run bench lock again.
Results from different versions are never ranked together.
Fairness: the seeds are public¶
A suite's seeds are public: anyone can read suite.yaml and play the exact games in advance. A
model tuned or trained on them can overfit: it scores well on these games without being
better in general. Treat scores as a fair comparison between agents that were not built for this
suite. Held-out seeds, kept secret and run only by a maintainer, are an open question in
SPEC-020.