Skip to content

Reference games

Niclas edited this page Jul 18, 2026 · 5 revisions

Reference games (regret-games)

regret-games is a separate workspace member (publish = false) holding the reference and example games. In the regret crate it is a dev-dependency, so cargo test compiles every reference game: the first build is slow, subsequent ones are cached.

These games are kept out of the core regret crate so the solver stays fully domain-free; they exist to give the test suite games with known Nash equilibria and to show how little code implementing the Game trait takes. Import them from the regret_games crate:

use regret_games::{KuhnPoker, RockPaperScissors, LeducPoker};

2-player zero-sum (analytic Nash anchors)

These back the convergence suite because their equilibrium value is known in closed form, so exploitability_2p_zerosum can be checked against a real target.

  • KuhnPoker: Kuhn poker; game value [-1/18, 1/18] for player 0/1.
  • MatchingPennies, RockPaperScissors: symmetric zero-sum, value [0, 0].
  • LeducPoker: Leduc hold'em, the standard small poker benchmark.
  • LiarsDice: one-die-each liar's dice (dudo).
  • Goofspiel: the card-bidding game (GoofspielAction).
  • DicePoker: dice-based poker variant.
  • OshiZumo: the simultaneous-bidding sumo game.
  • ConstantSum, BiasedCoin: small parametric games useful for calibration.

N-player

Exploitability is a quality signal here; it does not prove Nash. See Analytics.

  • KuhnN: Kuhn poker generalized to N players.
  • MajorityGame, OddOneOut: simultaneous binary-Choice (Yes/No) games.

General-sum

  • PrisonersDilemma: the canonical non-zero-sum game; use nash_conv, not the zero-sum exploitability metric.

Writing a new reference game

Implement Game, then add a targeted validate_game / validate_game_with check (see Implementing a game) plus a convergence assertion against the known Nash value where one exists in closed form (nash_value). The Mini game embedded in src/deep/mod.rs's tests is intentionally self-contained so the deep tests never link a second copy of regret.

Clone this wiki locally