Commit 68ff0ec
Add chess.chesstb: pure-Python prober for chesstb endgame tablebases
chesstb (https://github.com/noobpwnftw/chesstb) ships three table types per
material: 50-move-rule-aware WDL (with cursed/blessed classes), DTC
(distance-to-conversion), and a DTM50 pack that answers both the unbounded DTM
and the exact 50MR DTM at any halfmove clock.
This adds chess/chesstb.py, a faithful pure-Python re-implementation of the
reference C++ prober (no native extension; depends only on the standard
library's lzma plus a small bundled LZ4-block decoder). It covers the position
index (symmetry canonicalization, king/pawn slice managers, binomial
piece-group ranking, index-permutation layout), all three decoders, and the
probe orchestration (dropped-frame one-ply-minimax reconstruction for shrunk
files, the en-passant overlay, and DTM50 halfmove-clock layer selection).
API mirrors chess.syzygy: open_tablebase(); probe_wdl/probe_dtz/probe_dtm
return signed values; probe_dtm50 returns (wdl, plies); get_* are non-raising.
Validated bit-for-bit against the reference C++ prober across all 145 shipped
<=5-man materials and every halfmove-clock layer. A small fixture set
(data/chesstb) drives ChesstbTestCase.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8330cfd commit 68ff0ec
25 files changed
Lines changed: 2107 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments