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,9 +3,9 @@ defmodule Chesstrainer.Endgames.Tablebase do
All endgame tablebase related functions.
The cached value carries only what the trainer reads: `category`,
`checkmate`, and `moves` drive play, while `dtm`/`dtc` are small distance
hedges. Cursed-win/blessed-loss are normalised to `:draw` at parse time, so
the raw `dtw`/`dtz`/`insufficient_material` fields are not kept here.
`checkmate`, and `moves`. Cursed-win/blessed-loss are normalised to `:draw` at
parse time, and distance fields (`dtm`/`dtc`/`dtw`) are not kept because the
local Syzygy backend cannot produce them.
"""
alias Chesstrainer.Endgames.Tablebase
@@ -15,15 +15,11 @@ defmodule Chesstrainer.Endgames.Tablebase do
@type t :: %__MODULE__{
category: result,
checkmate: boolean(),
dtc: integer() | nil,
dtm: integer() | nil,
moves: [Tablebase.Move.t()]
}
defstruct category: nil,
checkmate: false,
dtc: nil,
dtm: nil,
moves: nil
@doc """