mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Wire Fathom into the local tablebase backend (#30)
Add Backend.Fathom: probes positions with five or fewer pieces via the Fathom NIF, maps WDL/DTZ to the trainer structs (flipping per-move perspective), generates SAN, sorts moves best-first, and falls back to Lichess on any failure. The local directory is configured with TABLEBASE_PATH; local answers are no longer cached. Add Tablebase.normalize_wdl/1 and flip/1, plus tests for the WDL mapping, SAN, checkmate, fallback, and a cache-free end-to-end local probe.
This commit is contained in:
@@ -20,6 +20,13 @@ if System.get_env("PHX_SERVER") do
|
||||
config :chesstrainer, ChesstrainerWeb.Endpoint, server: true
|
||||
end
|
||||
|
||||
# Local Syzygy tablebases: set TABLEBASE_PATH to the directory holding the
|
||||
# .rtbw/.rtbz files. When unset, the local backend stays disabled and lookups
|
||||
# fall back to Lichess.
|
||||
if tablebase_path = System.get_env("TABLEBASE_PATH") do
|
||||
config :chesstrainer, :tablebase_path, tablebase_path
|
||||
end
|
||||
|
||||
# Tablebase cache: size and the UTC time of the daily backup. Environment
|
||||
# variables win over the defaults in config/config.exs so deployments can tune
|
||||
# the cache without a rebuild. Invalid values are reported and ignored rather
|
||||
|
||||
Reference in New Issue
Block a user