Simplify the Tablebase struct to the fields the grader reads (#26)

Drop dtm/dtc from Tablebase and Tablebase.Move; the local Syzygy backend cannot produce them and nothing reads them. The Lichess parser now maps only category, checkmate and moves (with per-move category, dtz, san and uci), and the struct-shape tests follow.
This commit is contained in:
2026-11-03 12:41:28 +01:00
parent ff7adcf308
commit ec657c3424
4 changed files with 12 additions and 24 deletions
+3 -7
View File
@@ -3,25 +3,21 @@ defmodule Chesstrainer.Endgames.Tablebase.Move do
Moves struct for the tablebase
Carries only the fields the trainer reads: `category` and `dtz` for grading,
`san`/`uci` for display and matching, and `dtm`/`dtc` as small distance
hedges. Terminal detection is structural (the next position's `checkmate` or
its empty `moves`), so no per-move terminal flags are kept.
and `san`/`uci` for display and matching. Terminal detection is structural
(the next position's `checkmate` or its empty `moves`), so no per-move
terminal flags are kept.
"""
@type result :: :win | :draw | :loss | :unknown
@type t :: %__MODULE__{
category: result,
dtc: integer() | nil,
dtm: integer() | nil,
dtz: integer() | nil,
san: String.t() | nil,
uci: String.t() | nil
}
defstruct category: nil,
dtc: nil,
dtm: nil,
dtz: nil,
san: nil,
uci: nil