meta dict | positions list |
|---|---|
{"game":"chess","source":"https://database.lichess.org/ (CC0), months=['2013-01']","license":"CC0 (s(...TRUNCATED) | [{"id":"chess_ps_0000000","game":"chess","position":"2k3r1/ppp2p1K/6r1/8/4n1b1/PP6/3P3P/bN3B2 w - - (...TRUNCATED) |
Board Game Datasets
This directory contains board-game position datasets, produced for generating verified Q&A
about (1) interpreting a board position given its standard notation, and (2) advising a good
next move. Each game lives in its own self-contained project (own extract.py,
pyproject.toml, .venv) and produces one JSON file. Ground truth (legal moves, best move,
evaluation) always comes from a real rules library / game engine — never guessed by an LLM.
This is the board-game sibling of dataset_hierarchical (static knowledge trees); the overall
shape — self-contained per-domain uv projects regenerated via uv run extract.py, one
unified JSON schema, ground truth baked in at generation time — is intentionally the same.
Unified format
Unlike a knowledge tree, a board position has no natural containment structure — positions are
independent samples, not nodes of one tree. So each game emits one JSON file shaped as
{"meta": {...}, "positions": [...]} — dataset-level provenance in meta, then a flat list of
position records:
{
"meta": {
"game": "...", // game key, e.g. "chess"
"source": "...", // where the underlying games/positions came from
"license": "...", // license of the source data
"notation_format": { "position": "...", "move": "..." }, // notation used in this file
"engine": { "name": "...", "version": "...", "protocol": "..." },
"generation_method": "..." // how positions were sampled and analyzed
},
"positions": [
{
"id": "...", // unique string id, e.g. "chess_0001234"
"game": "...", // same as meta.game, repeated per record
"label": "...", // short human caption
"description": "...", // optional free text (game/event context, when known)
"category": "...", // position phase: "opening" / "midgame" / "endgame"
"position": "...", // the position, in this game's own notation (see meta.notation_format)
"side_to_move": "...", // whose turn
"ply": 0, // half-moves played to reach this position
"legal_moves": ["..."], // full legal move list, in this game's own move notation
"engine": { // always engine-computed, never LLM-guessed
"name": "...", "version": "...", "depth": 0,
"best_move": "...",
"eval": { "type": "cp" /* or "mate" */, "value": 0 },
"top_moves": [ { "move": "...", "eval": { "type": "...", "value": 0 } } ]
},
"source": { ... } // provenance for this specific position (e.g. source game id)
}
]
}
legal_moves and engine are baked in once at generation time — nothing downstream needs to
re-invoke an engine or re-derive legality. Since 8 different games (with 8 different notations)
are in scope across this project, meta.notation_format documents per-file which notation
position/move strings use, rather than assuming one shared notation like the hierarchical
project's single shared tree shape.
Datasets
chess
Source: real games from the Lichess open database (CC0),
month 2013-01 by default (the smallest monthly archive, kept small on purpose). Every included
game's full move trajectory is walked — every ply becomes one record, paired with the move
actually played next (played_move, ground truth from the source PGN) — rather than sampling a
few positions per game. Only real games are used, no self-play. Games are also checked against
their own PGN Variant header and skipped unless it's standard chess (guards against antichess,
Chess960, Crazyhouse, etc. slipping in, even though the Lichess standard archive should already
exclude them). Stockfish is used purely to analyze each position (best move, eval, top moves)
for comparison against what was actually played — it never generates the games or the
played_move field.
Notation: FEN for position,
UCI (e.g. e2e4) for moves. Library: chess
(python-chess). Engine: Stockfish (GPLv3).
Engine setup: nothing to install manually. On first run, extract.py downloads and caches
the official Stockfish Linux binary (pinned to release sf_18,
stockfish-ubuntu-x86-64-avx2.tar from the
official GitHub releases) into
chess/.engine/ (gitignored). Override with --stockfish-path <path> or the $STOCKFISH_PATH
env var to use your own binary instead — nothing is fetched over the network if either is set.
{
"id": "chess_0000000",
"game": "chess",
"label": "Midgame position, ply 70, White to move",
"description": "Lichess game 7rzcutsf, ply 70",
"category": "midgame",
"position": "3r4/1pr2pk1/2B3p1/p1Q5/2P1P3/2K2P2/PP6/7R w - - 1 36",
"side_to_move": "white",
"ply": 70,
"played_move": "c6d7",
"legal_moves": ["c6e8", "c6d7", "..."],
"engine": {
"name": "Stockfish", "version": "18", "depth": 18,
"best_move": "c5e5",
"eval": { "type": "mate", "value": 5 },
"top_moves": [ { "move": "c5e5", "eval": { "type": "mate", "value": 5 } } ]
},
"source": { "origin": "lichess", "game_id": "7rzcutsf" }
}
Regenerate with cd chess/ && uv run extract.py (flags: --num-games, --lichess-month,
--max-games-scanned, --stockfish-path, --depth, --multipv; see extract.py --help).
Note --num-games counts accepted (real, standard-variant) games, and since every ply of each
gets analyzed, it multiplies Stockfish calls much faster than the old position-sampling
approach — keep it small for a quick test run.
Piece/square coverage sampler
A second, independent script, chess/extract_piece_squares.py, builds a different kind of
dataset: coverage of where pieces sit on the board, rather than full games. For every
combination of piece type (6) x color (2) x board square (8x8) — 768 buckets — it gathers up to
N real positions (randomly-sampled plies, same real-games-only / standard-variant-only rules as
extract.py) where that piece occupies that square. No engine analysis is done at this stage —
this script is pure position gathering, deferred analysis is a separate concern.
Some buckets are structurally impossible (a pawn can never be on rank 1 or 8) or vanishingly rare
(a bishop on the "wrong" square color, only reachable via underpromotion), so the script doesn't
try to force these to fill. It stops once every bucket reaches N or it hits --max-months /
--max-games-scanned, whichever comes first, walking forward through consecutive monthly Lichess
archives as needed (rare combinations usually need more than one month's worth of games). Buckets
that fell short are reported in meta.buckets_short of the output.
Output: piece_square_samples.json, a flat list of position records (same "position" FEN
convention as extract.py), each tagged with the piece_type/color/square bucket it fills.
The same FEN can legitimately appear multiple times if one board fills several buckets at once.
{
"id": "chess_ps_0000042",
"game": "chess",
"position": "...fen...",
"ply": 24,
"category": "midgame",
"piece_type": "knight",
"color": "white",
"square": "e5",
"moves": ["e2e4", "e7e5", "..."],
"source": { "origin": "lichess", "game_id": "..." }
}
moves is the exact UCI move sequence from the game's start up to ply, so position can be
reproduced by replaying it — no need to re-fetch and re-search the source Lichess PGN archive.
Regenerate with cd chess/ && uv run extract_piece_squares.py (flags: --samples-per-bucket/-n,
--start-month, --max-months, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract_piece_squares.py --help).
go
Source: real games from the KGS Game Records Archive
(rated games between strong players — 7d+ amateur, or both players 6d+), monthly archives hosted
at dl.u-go.net. License note: unlike Lichess's CC0 for chess, this archive has no explicit
open-reuse license — the host states only that they were given informal "permission to use these
files" from KGS's founder, with no stated redistribution terms for downstream users. This is
carried through honestly into meta.license on every file this project generates from it; treat
the go/ dataset's provenance accordingly.
Board fixed at 19x19, Chinese rules (suicide illegal, positional superko, area scoring). Only
even (no-handicap), 19x19, RU[Chinese] games are accepted — mirrors chess's PGN Variant
filter. go/goban.py is a small hand-rolled rules engine (no external dependency, since no
rules-only Python library exists for Go) that is the ground-truth authority for position notation
and move legality: a real game's move is only accepted after goban.py itself confirms it's
legal, and the whole game is dropped if any move fails that check (rare — some KGS games use
ko/scoring conventions goban.py doesn't exactly mirror) rather than emitting a partial or
inconsistent trajectory. Every accepted game's full trajectory is walked, one record per ply, the
same way chess/extract.py walks real Lichess games. KataGo analyzes each position purely for
comparison (best move, eval, top moves) and is always forced back onto the real move afterward
(undo + play, see gtp_engine.Engine.analyze_and_force) — it never gets to choose the game's
actual moves, so played_move here is a genuine human move, directly comparable against
engine.best_move the same way chess's dataset compares Stockfish against what a human played.
Notation: no formal standard exists for Go, so position uses a custom coord-list convention —
size:19;turn:<b|w>;black:<comma-sep coords>;white:<comma-sep coords> — documented in
goban.py:position_string. Moves use GTP-style vertices (e.g. Q16; pass for a pass). Library:
sgfmill (MIT) for reading real SGF game records; goban.py
(hand-rolled) for rules. Engine: KataGo (MIT), analysis
only — it never generates the games or the played_move field.
Engine setup: nothing to install manually. On first run, extract.py downloads and caches the
official KataGo Linux Eigen/AVX2 binary (pinned to release v1.18.1) plus a small (~3.6MB) public
network from KataGo's g170 training run archive — deliberately lightweight to keep CPU analysis
fast, nowhere near KataGo's modern full-strength nets — into go/.engine/ (gitignored). Override
with --katago-path/--katago-model or $KATAGO_PATH/$KATAGO_MODEL to use your own binary or a
stronger network instead — nothing is fetched over the network if both are set. KGS game archives
are downloaded to a temp directory per run and discarded once parsed — nothing is cached to disk.
{
"id": "go_0000042",
"game": "go",
"label": "Midgame position, ply 50, Black to move",
"description": "KGS game 2017-02-01-9, ply 50",
"category": "midgame",
"position": "size:19;turn:b;black:B7,B8,...;white:A10,B1,...",
"side_to_move": "black",
"ply": 50,
"played_move": "A2",
"legal_moves": ["A1", "C1", "...", "pass"],
"engine": {
"name": "KataGo", "version": "1.18.1", "visits": 150,
"best_move": "C3",
"eval": { "type": "score", "value": 4.2, "winrate": 0.612 },
"top_moves": [ { "move": "C3", "eval": { "type": "score", "value": 4.2, "winrate": 0.612 } } ]
},
"source": { "origin": "kgs", "game_id": "2017-02-01-9", "komi": 6.5 }
}
Note played_move (the human's real move) and engine.best_move (KataGo's own top choice)
genuinely disagree fairly often, same comparison value chess's dataset has — a validation run at
low visits (20) found real moves matched the engine's top pick only ~39% of the time.
Unlike chess (two separate scripts), go/extract.py is a single CLI with two subcommands — they
share all their KGS-streaming/replay machinery, so there was no reason to split them into
separate files:
Regenerate the full-trajectory dataset above with cd go/ && uv run extract.py trajectories
(flags: --num-games, --kgs-month, --max-months, --max-games-scanned, --max-visits,
--interval-cs, --num-threads, --top-moves, --katago-path, --katago-model, --seed; see
extract.py trajectories --help). --kgs-month defaults to 2017-02, the smallest available
monthly archive (525 games — kept small on purpose, same reasoning as chess's default month).
--max-visits drives analysis runtime directly — keep it small for a quick test run.
Stone/point coverage sampler
extract.py piece-squares mirrors chess's sampler exactly, including no engine dependency at
all: for every (color, point) combination (2 x 361 = 722 buckets — no combination is structurally
impossible the way a chess pawn on rank 1/8 is) it gathers up to N real KGS-game positions where
that point holds that color's stone, walking forward through consecutive monthly archives as
needed. No engine analysis is done at this stage, same pure-position-gathering design as chess's
version. Each record carries a moves field (full GTP sequence from the game's start), so
positions are reproducible by replaying them with goban.Board alone.
Output: piece_square_samples.json, same shape as chess's version, tagged with the color/square
bucket each record fills.
Regenerate with cd go/ && uv run extract.py piece-squares (flags: --samples-per-bucket/-n,
--kgs-month, --max-months, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract.py piece-squares --help).
othello
Source: real games from the WTHOR database
(French Othello Federation) — competitive tournament games since 1985, distributed as yearly
binary archives (WTH_####.WTB, format spec).
License note: same caveat as go's KGS source — free to download, but no explicit open-reuse
license is stated, unlike Lichess's CC0 for chess. Carried through honestly into meta.license.
Board fixed at 8x8. rust_reversi.Board (MIT) is the
ground-truth authority for position/legality — a real rules-only library exists for Othello (no
hand-rolling needed here, unlike go's goban.py), the same role python-chess plays for chess.
WTHOR's move list only records actual disc placements — forced passes are never stored — so
replay must independently detect "no legal move" and skip the turn; rust_reversi.Board.is_pass()
does this before each move is applied. A game is dropped outright if any of its moves ever fails
to replay as legal (should essentially never happen for real WTHOR data, but kept as a safety net,
same spirit as chess/go).
Notation: OBF (Othello Board Format) — a real, if informal, standard used by Edax and Othello
problem sets, not a from-scratch invention like go's coord-list: a 64-character board string
(row-major a1..h8, X=black O=white -=empty) followed by the side-to-move letter. Moves are
plain algebraic squares (e.g. d3). Library: rust-reversi
(MIT). Engine: Edax (GPLv3), analysis only — it never
generates the games or the played_move field. Unlike go's KataGo, Edax needs no incremental
"undo + force move" dance: its setboard command accepts an arbitrary position directly, so each
position is analyzed statelessly in one shot, the same shape chess's FEN-based analysis has.
Engine setup: nothing to install manually. On first run, extract.py downloads and caches the
official Edax Linux x86 release (pinned to v4.6, includes its evaluation weights) into
othello/.engine/ (gitignored). Override with --edax-path/$EDAX_PATH to use your own binary
instead. WTHOR archives are downloaded to a temp directory per run and discarded once parsed —
nothing is cached to disk.
{
"id": "othello_0000042",
"game": "othello",
"label": "Midgame position, ply 20, Black to move",
"description": "WTHOR game 1980_0000, ply 20",
"category": "midgame",
"position": "-OOOOO--XOOOXO-OXOOOOXOOXOXOXOOOXOXXXXOOXOXOXXOOXXXXXXX-XXXXXXXX X",
"side_to_move": "black",
"ply": 20,
"played_move": "d3",
"legal_moves": ["c3", "d3", "e3", "f3", "g3", "g4", "g5", "g6", "g7"],
"engine": {
"name": "Edax", "version": "4.6", "level": 16,
"best_move": "g5",
"eval": { "type": "discs", "value": 0 },
"top_moves": [ { "move": "g5", "eval": { "type": "discs", "value": 0 } } ]
},
"source": { "origin": "wthor", "game_id": "1980_0000", "year": 1980, "tournament_id": 12, "black_player_id": 34, "white_player_id": 56 }
}
played_move (the real human move) and engine.best_move (Edax's own top choice) disagree
often, same comparison value chess/go have — a validation run found real moves matched the
engine's top pick only ~47% of the time.
One CLI, two subcommands (mirrors go's structure):
Regenerate the full-trajectory dataset above with cd othello/ && uv run extract.py trajectories
(flags: --num-games, --wthor-year, --max-years, --max-games-scanned, --level,
--search-seconds, --edax-path, --top-moves; see extract.py trajectories --help).
--wthor-year defaults to 1980, the smallest yearly archive with a reasonable game count (160
games — kept small on purpose, same reasoning as chess/go's smallest-archive defaults).
Disc/square coverage sampler
extract.py piece-squares mirrors chess's sampler exactly, including no engine dependency at
all: for every (color, square) combination (2 x 64 = 128 buckets) it gathers up to N real
WTHOR-game positions where that square holds that color's disc, walking forward through
consecutive yearly archives as needed. No engine analysis is done at this stage. Each record
carries a moves field (full move sequence from the game's start), so positions are reproducible
by replaying them with rust_reversi.Board alone.
Output: piece_square_samples.json, same shape as chess's version, tagged with the color/square
bucket each record fills.
Regenerate with cd othello/ && uv run extract.py piece-squares (flags: --samples-per-bucket/-n,
--wthor-year, --max-years, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract.py piece-squares --help).
checkers
Source: real, rated lidraughts.org tournament games (lidraughts is
an open-source draughts server forked from the Lichess codebase), pulled via its public
/api/tournament/:id/games endpoint from 12 pinned, already-finished "standard" (international
rules, 10x10) tournaments — finished-tournament games are permanent, so these stay fetchable
indefinitely, the same "kept small and pinned on purpose" reasoning as chess/go/othello's
archive defaults. License note: same caveat as go's KGS and othello's WTHOR — lidraughts's
Terms of Service grant lidraughts a broad, sublicensable usage license over user content but
don't adopt Lichess's own CC0. Carried through honestly into meta.license.
draughts.StandardBoard (py-draughts, MIT) is the
ground-truth authority for position/legality — a real rules-only library exists here too (no
hand-rolling needed, like othello, unlike go). A real notation quirk: lidraughts records each hop
of a multi-jump capture as its own token ("12x23" then "23x32"), while py-draughts expects the
whole chain merged into one ("12x23x32") — merge_hops() bridges that gap. A rarer quirk: for a
"flying king" capturing over 2+ pieces, lidraughts and py-draughts can each pick a different
valid intermediate resting square along the same diagonal for the same logical move (identical
captured pieces, identical final square) — match_move() falls back to matching on start/final
square plus captured-piece count when the exact hop-by-hop string doesn't match. Engine:
Scan (GPLv3) 3.1, analysis only, via its Hub protocol.
py-draughts ships its own HubEngine, but it has a real bug (confirmed by manual protocol
testing): it mixes select() with buffered readline(), so once several lines arrive in one OS
read (which Scan reliably does — the whole parameter block after id, every info line during a
search), select() stops seeing the already-buffered lines as "ready" and the read loop hangs.
checkers/scan_engine.py reuses py-draughts's position-encoding/move-parsing helpers but drives
its own reliable background-thread-plus-queue I/O loop instead, the same pattern
gtp_engine.py/edax_engine.py use.
Notation: Draughts-FEN (a real, semi-standard notation, not a from-scratch invention), e.g.
[FEN "W:W31,32,...:B1,2,..."]. Moves are numbered algebraic (squares 1–50), e.g. 32-28 or
12x23x32 for a multi-capture chain.
Engine setup: nothing to install manually. On first run, extract.py downloads and caches the
official Scan Linux binary and its evaluation weights (pinned to a specific commit of the
rhalbersma/scan mirror) into checkers/.engine/ (gitignored). Override with --scan-path/
$SCAN_PATH to use your own binary instead.
{
"id": "checkers_0000042",
"game": "checkers",
"label": "Midgame position, ply 20, Black to move",
"description": "lidraughts game Chzga35R, ply 20",
"category": "midgame",
"position": "[FEN \"B:W28,33,34,35,38,40,41,42,43,44,45,46,47,48,49,50:B1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,19,21,22\"]",
"side_to_move": "black",
"ply": 20,
"played_move": "16-21",
"legal_moves": ["12-17", "12-18", "16-21", "19-23", "19-24"],
"engine": {
"name": "Scan", "version": "3.1", "time_limit_s": 1.0,
"best_move": "19-24",
"eval": { "type": "men", "value": -0.03 },
"top_moves": [ { "move": "19-24", "eval": { "type": "men", "value": -0.03 } } ]
},
"source": { "origin": "lidraughts", "game_id": "Chzga35R", "tournament_id": "3onq5G6G", "white": "stanleysxm", "black": "zhc2015" }
}
Unlike go/othello's engines, Scan's Hub protocol reports only one principal variation per search
(no multi-candidate ranking), so top_moves here always has exactly one entry, matching
best_move — a real capability difference, not a scope cut. played_move/engine.best_move
still diverge often (~47% agreement in a validation run), same comparison value as the other
games.
One CLI, two subcommands (mirrors go/othello's structure):
Regenerate the full-trajectory dataset above with cd checkers/ && uv run extract.py trajectories
(flags: --num-games, --tournament-ids, --max-games-scanned, --time-limit, --scan-path;
see extract.py trajectories --help). --tournament-ids is a comma-separated list, walked in
order like chess/go/othello walk forward through months/years if one archive isn't enough.
Piece/square coverage sampler
extract.py piece-squares mirrors chess's original sampler most closely among this project's
games so far: checkers (like chess) has more than one piece type — man vs king — so buckets are
(color, piece_type, square): 2 x 2 x 50 = 200. No engine analysis is done at this stage. Kings are
intrinsically rarer than men (a piece must survive to the far rank to promote), and this
project's pinned corpus is a handful of blitz tournaments rather than a whole month of real
games, so buckets_short runs non-trivially larger here than in chess/go/othello — documented
honestly in meta.generation_method rather than papered over.
Regenerate with cd checkers/ && uv run extract.py piece-squares (flags:
--samples-per-bucket/-n, --tournament-ids, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract.py piece-squares --help).
shogi
Source: Floodgate, a continuously-running computer
shogi tournament server archived by the University of Tokyo since 2008. Not human games —
unlike chess/go/othello/checkers, no bulk-exportable database of real human shogi games could
be found. This was surfaced to the user explicitly before building: the choice made was to use
Floodgate anyway, since it's still real, recorded competitive results between many
independently-developed engines (genuine competitive diversity, not one engine's self-play) —
over self-play, which would have been the cleaner-licensed but comparison-value-losing fallback
(matching go's original design before its KGS pivot). Every record's source.origin says
"floodgate" (not "lichess"/"kgs"/etc.) and meta.license states the human/computer
distinction plainly — this is the one dataset in this project where played_move is not a human
decision.
cshogi.Board (cshogi, MIT) is the ground-truth authority for
position/legality and also parses the real CSA game records directly (cshogi.Parser) — a real
rules-+-parsing library exists here too, no hand-rolling needed. Engine:
Fairy-Stockfish (GPLv3), the "largeboard"
build (the standard build only includes the smaller shogi-family variants — minishogi,
kyotoshogi, etc. — not full 9x9 shogi), analysis only. A real notation quirk: Fairy-Stockfish's
default shogi move notation is its own chess-derived file/rank convention (e.g. b2c1), not
shogi's native USI square notation cshogi uses (e.g. 2h7h for the identical move) — its
Protocol UCI option switches this to genuine USI framing (the usi/usiok handshake included),
set once at startup in shogi/usi_engine.py so every move string exchanged with cshogi matches
exactly, no manual coordinate translation needed.
Notation: SFEN and USI — both real, standard shogi notations, not from-scratch
inventions, e.g. position lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1, move
7g7f (board move) or P*5e (drop from hand), + suffix for a promotion.
Engine setup: nothing to install manually. On first run, extract.py downloads and caches the
official Fairy-Stockfish Linux largeboard binary (pinned to release fairy_sf_14) into
shogi/.engine/ (gitignored). Override with --engine-path/$FAIRY_SF_PATH to use your own
binary instead. Floodgate archives are downloaded to a temp directory per run and discarded once
parsed — nothing is cached to disk.
{
"id": "shogi_0000042",
"game": "shogi",
"label": "Midgame position, ply 30, Black to move",
"description": "Floodgate game wdoor+floodgate-900-0+Ayaka2007+MyMove900+20080221020005, ply 30",
"category": "midgame",
"position": "ln1g3n1/1ks1g1r1l/1ppppsbp1/p4pp1p/7P1/P1P1P1P1P/1P1PSPS2/1BKGG2R1/LN5NL b - 31",
"side_to_move": "black",
"ply": 30,
"played_move": "8h7g",
"legal_moves": ["8h7g", "8h6f", "2h4h", "..."],
"engine": {
"name": "Fairy-Stockfish", "version": "14", "variant": "shogi", "movetime_ms": 1000,
"best_move": "4g4f",
"eval": { "type": "cp", "value": 5 },
"top_moves": [ { "move": "4g4f", "eval": { "type": "cp", "value": 5 } }, "..." ]
},
"source": { "origin": "floodgate", "game_id": "wdoor+floodgate-900-0+Ayaka2007+MyMove900+20080221020005", "black_program": "Ayaka2007", "white_program": "MyMove900" }
}
Unlike checkers's Scan, Fairy-Stockfish's UCI MultiPV option gives a real ranked list of
candidate moves per position (default 5), the richest top_moves of any game in this project so
far.
One CLI, two subcommands (mirrors go/othello/checkers's structure):
Regenerate the full-trajectory dataset above with cd shogi/ && uv run extract.py trajectories
(flags: --num-games, --floodgate-year, --max-years, --max-games-scanned, --movetime-ms,
--multipv, --engine-path; see extract.py trajectories --help). --floodgate-year defaults
to 2008, the earliest available archive (kept small on purpose, same reasoning as chess/go's
smallest-archive defaults — even though 2008 alone still has 50k+ games, only --num-games of
them are ever pulled).
Piece/square coverage sampler
extract.py piece-squares mirrors chess's original sampler: shogi has 8 base piece types (6
promotable, giving 14 distinct piece_type values including promoted forms) — buckets are (color,
piece_type, square): 2 x 14 x 81 = 2268, by far the largest bucket space in this project. Pieces
currently held in hand (captured, available to drop back in) aren't on any square and so aren't
sampled by this scheme. No engine analysis is done at this stage.
Regenerate with cd shogi/ && uv run extract.py piece-squares (flags: --samples-per-bucket/-n,
--floodgate-year, --max-years, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract.py piece-squares --help).
xiangqi
Source: chasoft/community-xiangqi-games-database
on GitHub — a large, actively-maintained community archive of real professional Chinese
Xiangqi championship games, 1956–present (National Championships, Asian Cup, provincial team
events; real named grandmasters). License note — the strictest of any dataset in this
project: this repository has no declared license at all, stricter than go's KGS, othello's
WTHOR, or checkers's lidraughts (each of which at least had a ToS or informal permission grant).
The project's own README explicitly invites open community contribution and reuse ("allowing
anyone to contribute... fork this repo, contribute, and raise PRs"), but that isn't a formal
license grant. This was surfaced to the user explicitly before building (a bigger ask than the
other games' license caveats), who chose to proceed and have it documented prominently — see
meta.license in every generated record.
Games are stored one-per-file in a custom web-viewer format (DHTMLXQ, no file extension) with no
existing Python parser — reverse-engineered from the source repo's own TypeScript
(src/game.ts), then cross-verified two ways: decoding the standard-position binit string
reproduces pyffish's own standard Xiangqi start position exactly, and the decoded first move of
a sample game (h3e3, a cannon centralizing to the e-file) matches that game's own labeled
opening name ("中炮" / Central Cannon). Only games starting from the standard position are used.
Fetched via the GitHub contents API (one call per pinned tournament folder, well under the
unauthenticated rate limit) + raw.githubusercontent.com for the game files themselves — no
single downloadable archive exists here the way KGS/WTHOR/Floodgate provide, so
xiangqi/extract.py pins a handful of specific tournament folder names instead of a month/year.
pyffish (PyPI, GPLv3 — the rules-only half of the
Fairy-Stockfish project) is the ground-truth authority for position/legality; unlike the other
games' Board-object libraries, its legal_moves/get_fen are pure stateless functions (variant +
FEN + move list in, result out) — no persistent board object at all, the simplest integration
pattern in this project. Engine: Fairy-Stockfish (GPLv3), the same "largeboard" build shogi uses
— its native UCI move notation for xiangqi already matches pyffish's algebraic notation directly
(confirmed by testing), no protocol/notation translation needed unlike shogi's engine setup.
Notation: Xiangqi-FEN and plain algebraic move pairs (e.g. h3h10, no piece letter or
promotion marker — xiangqi has neither).
Engine setup: nothing to install manually — reuses the same Fairy-Stockfish largeboard binary
shogi's extract.py downloads (pinned to release fairy_sf_14), cached in xiangqi/.engine/
(gitignored). Override with --engine-path/$FAIRY_SF_PATH.
{
"id": "xiangqi_0000042",
"game": "xiangqi",
"label": "Midgame position, ply 20, Black to move",
"description": "1956年-全国象棋锦标赛: 01-初赛-保定邓裕如-(红先负)哈尔滨王嘉良, ply 20",
"category": "midgame",
"position": "r1ba1a3/4kn3/2n1b4/pNp1p1R2/4c4/6P2/P1r3c1P/2C1C4/9/2BAKAB2 b - - 0 11",
"side_to_move": "black",
"ply": 20,
"played_move": "h8h4",
"legal_moves": ["h8h4", "h8g8", "..."],
"engine": {
"name": "Fairy-Stockfish", "version": "14", "variant": "xiangqi", "movetime_ms": 1000,
"best_move": "e7e6",
"eval": { "type": "cp", "value": 12 },
"top_moves": [ { "move": "e7e6", "eval": { "type": "cp", "value": 12 } }, "..." ]
},
"source": { "origin": "chasoft-xiangqi-db", "game_id": "01-初赛-保定邓裕如-(红先负)哈尔滨王嘉良", "tournament": "1956年-全国象棋锦标赛", "red_player": "保定邓裕如", "black_player": "哈尔滨王嘉良", "date": "1956年12月16日", "result": "红胜" }
}
One CLI, two subcommands (mirrors go/othello/checkers/shogi's structure):
Regenerate the full-trajectory dataset above with cd xiangqi/ && uv run extract.py trajectories
(flags: --num-games, --tournaments, --max-games-scanned, --movetime-ms, --multipv,
--engine-path; see extract.py trajectories --help). --tournaments is a comma-separated list
of pinned tournament folder names (defaults to the three earliest championships in the archive —
kept small on purpose), walked in order like checkers walks its tournament-ID list.
Piece/square coverage sampler
extract.py piece-squares mirrors chess's original sampler: 7 piece types (rook, knight,
elephant, advisor, king, cannon, pawn — xiangqi has no promotions) x 2 colors x 90 squares = 1260
buckets. Elephants/advisors are confined to their own half of the board and a fixed diagonal
lattice of points, and the king never leaves its 3x3 palace, so most of the 1260 combinations are
structurally impossible under real play — buckets_short reflects that rarity honestly rather
than papering over it. No engine analysis is done at this stage.
Regenerate with cd xiangqi/ && uv run extract.py piece-squares (flags:
--samples-per-bucket/-n, --tournaments, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract.py piece-squares --help).
gomoku
Source: RenjuNet, the official Renju Federation game database —
real tournament games since 2001 (159,000+ as of writing), downloaded as a single XML export
(.rif, Renju Interchange Format). Contradicts this project's own original roadmap guess of "no
public corpus in scope, self-play only" — worth a real check before trusting an earlier
assumption, same lesson learned with go's KGS pivot. License note: unlike the other games'
ambiguous ToS situations, this one is explicit and restrictive — quoted verbatim from the database
file itself: "It is allowed to use this database for non-commercial purposes in the forms of
OFFLINE databases only. It is forbidden to use any contents of this database or its modifications
in any website or ONLINE system." Surfaced to and confirmed by the user before building; carried
verbatim into every record's meta.license.
RenjuNet's rule field distinguishes Renju rulesets (forbidden-move restrictions for Black —
double-three, double-four, overline) from plain Gomoku rulesets (5-or-more-in-a-row wins, no
restrictions). This project filters to Gomoku-category rules only (GOMOKU_RULE_IDS in
extract.py — e.g. "Gomoku - Swap 2", 16,000+ games alone) specifically to avoid needing Renju's
considerably more complex forbidden-move legality logic, while still using 100% real tournament
games. goban.py (hand-rolled, ~110 lines — no rules-only library exists for Gomoku) is the
ground-truth authority for position/legality. Engine:
Rapfi (GPLv3), the Piskvork-protocol engine the roadmap
originally scoped for self-play, now used for analysis only, driven via rapfi_engine.py's own
reliable I/O loop (same background-thread-plus-queue pattern as the other 5 engine drivers).
Notation: no formal standard exists for Gomoku position notation, so it uses the same custom
coord-list convention go/othello established (size:15;turn:<b|w>;black:<coords>;white:<coords>);
moves are RenjuNet's own real algebraic notation directly (columns a-o, no letter skipped, unlike
go's a-t convention — rows 1-15).
Engine setup: nothing to install manually. On first run, extract.py downloads and caches the
official Rapfi Linux AVX2 binary plus its freestyle-rules NNUE weights (pinned to release
250615) into gomoku/.engine/ (gitignored). Override with --engine-path/$RAPFI_PATH. The
RenjuNet database itself (~44MB) is downloaded once into gomoku/.cache/ (also gitignored) and
reused across runs rather than re-fetched every time.
{
"id": "gomoku_0000042",
"game": "gomoku",
"label": "Midgame position, ply 14, White to move",
"description": "World Championship 2005, AT: game 8500, ply 14",
"category": "midgame",
"position": "size:15;turn:w;black:h7,h8,h9,i8;white:g8,h10,i7,i9",
"side_to_move": "white",
"ply": 14,
"played_move": "j6",
"legal_moves": ["a1", "a2", "...", "o15"],
"engine": {
"name": "Rapfi", "protocol": "Piskvork", "timeout_ms": 1000,
"best_move": "g7",
"eval": { "type": "score", "value": 210 },
"top_moves": [ { "move": "g7", "eval": { "type": "score", "value": 210 } } ]
},
"source": { "origin": "renjunet", "game_id": "8500", "tournament": "World Championship 2005, AT", "black_player": "...", "white_player": "..." }
}
Unlike go/othello/shogi/xiangqi's engines, the base Piskvork protocol reports only one principal
variation per search, so top_moves here always has exactly one entry, same limitation as
checkers's Scan. A forced win/loss (+M15/-M15, mate-in-N stones) is folded into a large
+/-score value with the real mate-in-N kept in eval.mate — the same pattern shogi/xiangqi use
for a forced mate.
One CLI, two subcommands (mirrors go/othello/checkers/shogi/xiangqi's structure): unlike the other
games, RenjuNet is a single downloadable file rather than month/year/tournament archives, so there
is no --tournaments/--max-years-style walk-forward flag here — games are taken in file order.
Regenerate the full-trajectory dataset above with cd gomoku/ && uv run extract.py trajectories
(flags: --num-games, --timeout-ms, --engine-path; see extract.py trajectories --help).
Stone/point coverage sampler
extract.py piece-squares mirrors chess's/go's sampler: gomoku (like go/othello) has only one
stone type per color, so buckets are (color, point): 2 x 225 = 450. No engine analysis is done at
this stage. No (color, point) combination is structurally impossible the way a chess pawn on rank
1/8 is, so buckets_short (if non-empty) reflects games scanned running out, not an inherent
limit.
Regenerate with cd gomoku/ && uv run extract.py piece-squares (flags:
--samples-per-bucket/-n, --max-games-scanned, --min-samples-per-game,
--max-samples-per-game, --seed; see extract.py piece-squares --help).
hex
Source: Little Golem, a real online abstract-strategy game server (active since 2002) — real human games, fetched via one real ladder tournament's game listing (2000+ games; a per-player game-history approach was tried first but real players' lists turned out either dominated by short technical-loss games or too slow to load — the tournament listing was both richer and faster). License note: no license/terms were found stated anywhere on the site; treat provenance accordingly, same caveat weight as xiangqi's source.
goban.py (hand-rolled — no rules-only library exists for Hex) is the ground-truth authority for
position notation; legality is trivial (every empty cell is always legal, no captures or complex
movement). Unlike every other game in this project, it does not compute a win/connection
condition at all: brute-forcing every combination of coordinate-letter order and hex-grid diagonal
direction against a real, known-outcome Little Golem game never once produced a result consistent
with that game's declared winner — rather than risk silently-wrong game-ending logic from an
unresolved ambiguity, this project just doesn't compute it. This turned out not to matter:
Hex needs no win detection to stay correct, since legality never depends on it and a real game's
own move-list end is a perfectly good trajectory boundary on its own.
"Engine": no prebuilt MoHex/Wolve binary exists (Benzene/MoHex is from-source-only, needing Boost
- Berkeley-DB dev packages — new system-level dependencies for uncertain payoff), so this project
uses the roadmap's own planned fallback: a hand-rolled shortest-connection-path ("resistance")
heuristic (
hex_engine.py) with a small centrality tiebreak (without it, the heuristic systematically preferred edge cells over the board center on a sparse board — a real, checked-in weakness, not a hidden one: central play is well-known-strong in Hex specifically because it sits on many potential shortest paths at once, a property a 1-ply-only heuristic can't otherwise see). Explicitly lower-confidence than every other game's real search engine, labeled as such in every record'smeta.engine/generation_method— this is the one dataset in this project without a credible independent engine behind itsengine.best_move/evalfields, only real humanplayed_moves. No subprocess or download at all: pure Python, unlike every other game here.
Notation: no formal standard exists for Hex position notation, so it uses the same custom coord-list convention go/othello/gomoku established; moves are Little Golem's own real two-letter algebraic notation directly (column letter, row letter, both a-k for the 11x11 board).
{
"id": "hex_0000042",
"game": "hex",
"label": "Midgame position, ply 8, Black to move",
"description": "Little Golem game 2179013, ply 8",
"category": "midgame",
"position": "size:11;turn:b;black:ef,gh,hd;white:de,ff,hg",
"side_to_move": "black",
"ply": 8,
"played_move": "fe",
"legal_moves": ["aa", "ab", "...", "kk"],
"engine": {
"name": "hex_engine (hand-rolled heuristic, lower confidence)",
"best_move": "fe",
"eval": { "type": "path-diff", "value": 1.98 },
"top_moves": [ { "move": "fe", "eval": { "type": "path-diff", "value": 1.98 } }, "..." ]
},
"source": { "origin": "littlegolem", "game_id": "2179013", "black_player": "...", "white_player": "...", "result": "B" }
}
One CLI, two subcommands (mirrors go/othello/checkers/shogi/xiangqi's structure):
Regenerate the full-trajectory dataset above with cd hex/ && uv run extract.py trajectories
(flags: --num-games, --tournament-ids, --max-games-scanned, --top-moves; see
extract.py trajectories --help). --tournament-ids is a comma-separated list, walked in order
like checkers walks its tournament-ID list.
Stone/point coverage sampler
extract.py piece-squares mirrors chess's/go's sampler: hex (like go/othello/gomoku) has only
one stone type per color, so buckets are (color, point): 2 x 121 = 242. No analysis is done at
this stage. Each record's moves field entries are '<b|w>:<move>' (e.g. 'b:fc'), not bare
move strings — carrying color explicitly, since replay never assumes strict alternation.
Regenerate with cd hex/ && uv run extract.py piece-squares (flags: --samples-per-bucket/-n,
--tournament-ids, --max-games-scanned, --min-samples-per-game, --max-samples-per-game,
--seed; see extract.py piece-squares --help).
Roadmap
All 8 originally-shortlisted games are implemented: chess, go, othello, checkers, shogi, xiangqi,
gomoku, hex. A qa_generation/ project (mirroring dataset_hierarchical/qa_generation) is next
up — best designed now that a real variety of games exists to build the shared
position-index/template layer against, rather than guessed ahead of time.
- Downloads last month
- 41