Files
chess-endgame-trainer/lib/chesstrainer/endgames/tablebase/move.ex
T
owenrees a5bb1cb670 Scale the tablebase cache to ~100k entries (#24)
* Slim the cached tablebase value to the fields the trainer reads (#20)

* Sample for LFU eviction instead of scanning the cache (#21)

* Make cache size configurable and back up daily off-peak (#22)

* Document the cache design in the glossary and an ADR (#23)

* Address cache-scaling code review findings
2026-11-02 23:02:01 +01:00

29 lines
819 B
Elixir

defmodule Chesstrainer.Endgames.Tablebase.Move do
@moduledoc """
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.
"""
@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
end