Skip to content

SPEC-026: Chess opponents

  • Status: Implemented
  • Milestone: v0.15 "Small models and chess opponents"
  • Owners: lead maintainer

1. Purpose

Today a model can play chess against scripted/random, which any model beats, or against another model, which costs money and is never the same twice. Scripted opponents of fixed strength, built on the chess analyst (SPEC-022 STR-013), give fixed baselines: a model can be rated against them with no key, and two models can be compared through the same opponents.

2. Terms

Keywords MUST, SHOULD and MAY follow RFC 2119. - Level: an opponent's strength: how many half-moves its search looks ahead. - Ladder: a series of games against each level, used to place a model between levels.

3. Requirements

  • OPP-001 A built-in agent scripted/chess MUST play the chess world. Its config takes level (1, 2 or 3; default 1) and margin (0 to 2 pawns; default 0.3). Other values MUST be config errors that name the field. On an observation without a chess position it MUST fail with an agent error that says it plays only the chess world.
  • OPP-002 At each move it MUST value every legal move with the chess analyst at depth: level, and play one of the moves whose value is within margin of the best, chosen with its seeded random generator. So it is deterministic from its seed and costs nothing (ADP-013), but does not play the same game every time.
  • OPP-003 Its model MUST be level-<n>, so reports show each level as its own competitor (scripted/chess:level-2). It MUST send no messages, even in a game with talk: true, and its reasoning MUST give the move's value, for example "best value 0.4 (level 2)".
  • OPP-004 Higher levels MUST be stronger. In the conformance games (fixed seeds, both colours, at_limit: material), level 1 MUST score more than 75% against scripted/random (max_moves: 40) and level 2 more than 50% against level 1 (max_moves: 30). Level 3 MUST find a mate in two (three half-moves) that level 2 cannot see, in fixed positions. The chess guide MUST give each level's measured score against the level below.
  • OPP-005 examples/chess/ladder.yaml MUST be an experiment (SPEC-019) that plays one model against levels 1 to 3, as each colour, with several seeds. Its report's head-to-head table (RPT-012) then shows the model's score against each level. The chess guide MUST explain how to read it, and say what each level typically misses (level 1 sees only one half-move and the captures after it).
  • OPP-006 The chess guide MUST give the typical time per move for each level, and say that level 3 is about ten times slower than level 2.

4. Acceptance criteria

Requirement Test ID Notes
OPP-001..003 OPP-001..OPP-003 config errors, wrong world, same game for one seed and different games for two, chosen moves within the margin, model name, no messages
OPP-004 OPP-004 the strength games, and mate-in-two positions for level 3
OPP-005..006 OPP-005, OPP-006 the ladder experiment checks and plans; the guide's sections

5. Examples

agentplay: 1
name: chess-vs-level-2
world: {use: chess, config: {max_moves: 40, at_limit: material}}
agents:
  - {id: white, use: ollama, config: {model: "qwen2.5:7b", constrain: true}}
  - {id: black, use: scripted/chess, config: {level: 2}}
agentplaykit experiment run examples/chess/ladder.yaml
agentplaykit report runs/ladder

The head-to-head table then shows, for example, that the model scores 0.71 against level 1, 0.33 against level 2 and 0.08 against level 3: it plays between levels 1 and 2.

6. Open questions

  • A chess benchmark suite (SPEC-020) could use these levels as anchors.
  • A level 4 (depth 4) would be about ten times slower than level 3.

7. Change log

  • 2026-12-03: Initial draft.
  • 2026-12-03: Accepted by the lead maintainer, without a chess suite or a level 4 for now.
  • 2026-12-03: On building: level 3 against level 2 needs long games to show its edge (it scored 0.81 in 16 games of 40 moves, but 0.5 in 4 games of 20), too slow for every test run. OPP-004 tests level 3 on mate-in-two positions instead, and the guide gives the measured scores. Level 3 is about ten times slower than level 2, not four (OPP-006).
  • 2026-12-04: Implemented in v0.15.0; every requirement has a test.

Changes to other specs on acceptance

  • SPEC-009, ADP-004: the scripted/chess bot (ADP-013 applies).
  • SPEC-024: the chess guide's opponents section.