Helpmate tablebases
Exhaustively solved helpmate tablebases: for every legal position in a material class, the distance to mate under optimal cooperation and the number of distinct optimal solutions.
That second number is the useful one. It is what tells a composer whether a
position is a sound problem (count = 1) or has duals.
Generated by osick/helpmate-tablebase (MIT). These files are the data; that repository is the code that builds and reads them.
636 six-piece tablebases have never been computed, and 286 of them need only 32 GiB of RAM and about a day of CPU each. Contributions arrive as pull requests on this dataset and every merged table is credited. → How to contribute a tablebase
Coverage
| pieces | classes | status |
|---|---|---|
| 2–4 | 66 | complete |
| 5 | 220 | complete |
| 6 | 645 | 9 published, 636 outstanding |
| 7+ | — | not attempted |
295 files, 38.5 GiB. Deepest mate in the corpus: h#17.
Format
Files are <MATERIAL>.hm, flat at the repository root, each paired with a
<MATERIAL>.stats.json sidecar. Material names are canonical: White's pieces
uppercase, then v, then Black's lowercase — KQvk, KBvkqrb.
Two on-disk shapes appear here, and they are not a version ladder:
- v3, block-compressed (228 files) — the four byte planes cut into 64 KiB blocks, each zstd-compressed independently so random-access probing stays cheap. This is the format for real tables.
- v2, marker (67 files, ~480 bytes each) — a material provably containing no helpmate at all, for example anything where White is a bare king. Storing the plane would be pointless, so only the verdict is stored.
Only the current format is distributed. Uncompressed v1 tables were
published here previously and have been replaced in place; v1 is now purely a
generator intermediate and is not served. Any local copy predating that switch
is stale — the tooling detects this by size against manifest.json, discards
it, and re-fetches automatically, so no manual cleanup is needed.
Readers older than v0.7.5 cannot open v3 files and will report an unsupported format version.
manifest.json at the root is the index: every file with its size and
sha256. Fetching tools verify against it.
Using the tables
The maintained path, which resolves sub-slices and verifies checksums:
git clone https://github.com/osick/helpmate-tablebase
cd helpmate-tablebase && make install
helpmate-tables pull --tables ./tables --repo osick/helpmate-tables
helpmate probe "8/7k/5K2/8/8/8/8/6Q1 b - - 0 1" --tables ./tables
# dtm=2 (h#1) count=4
Pull a single class with --material KQvk. Note that probing a material
needs the closure of every sub-slice reachable by capture or promotion, so a
single file is rarely enough on its own — pull without --material gets
everything.
A server can also stream them on demand, fetching and caching each class the first time it is queried:
helpmate-server --hf-repo osick/helpmate-tables --cache ./cache
Or take a file directly, if you have your own reader:
from huggingface_hub import hf_hub_download
p = hf_hub_download("osick/helpmate-tables", "KQvk.hm", repo_type="dataset")
Contributing
At six pieces, 636 classes are still unsolved, and 286 of them need only 32 GiB of RAM and roughly a day of CPU each. Every merged table is credited by material and contributor.
huggingface-cli login
helpmate-tables push --tables ./tables --repo osick/helpmate-tables \
--material KBBBvkb --create-pr
That opens a single pull request holding the table and its sidecar. Claim the material in a GitHub issue first so two people do not generate the same one.
→ How to contribute a tablebase
Trust
Values are cross-checked against an independent cooperative solver that
shares only the move generator with the production generator, and every one
of the 368,452 legal KQvk positions is verified against a reference
implementation built directly on python-chess. Multithreaded generation is
required to be byte-identical to single-threaded.
Tables contributed by third parties are reviewed — structural checks, sidecar consistency, and spot checks — but not independently regenerated. The internals document states the verification story and its limits in full.
Licence
MIT, matching the generator.
- Downloads last month
- 109