mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +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:
@@ -177,7 +177,9 @@ defmodule ChesstrainerWeb.EndgameLive.PlayTest do
|
||||
|
||||
describe "tablebase availability" do
|
||||
test "blocks the attempt when the tablebase is cooling down", %{conn: conn} do
|
||||
endgame = endgame_fixture()
|
||||
# Six pieces routes to Lichess, so the cooldown applies (five or fewer
|
||||
# would be answered locally).
|
||||
endgame = endgame_fixture(fen: "8/8/5p2/1P1K1k2/8/2r5/8/7R w - - 0 1")
|
||||
TablebaseCache.delete(FEN.position_key(endgame.fen))
|
||||
Ratelimiters.lichess_add_cooldown()
|
||||
on_exit(fn -> Ratelimiters.lichess_reset_cooldown() end)
|
||||
|
||||
Reference in New Issue
Block a user