mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
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
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
defmodule Chesstrainer.Endgames.Tablebase do
|
||||
@moduledoc """
|
||||
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.
|
||||
"""
|
||||
|
||||
alias Chesstrainer.Endgames.Tablebase
|
||||
@@ -12,9 +17,6 @@ defmodule Chesstrainer.Endgames.Tablebase do
|
||||
checkmate: boolean(),
|
||||
dtc: integer() | nil,
|
||||
dtm: integer() | nil,
|
||||
dtw: integer() | nil,
|
||||
dtz: integer() | nil,
|
||||
insufficient_material: boolean(),
|
||||
moves: [Tablebase.Move.t()]
|
||||
}
|
||||
|
||||
@@ -22,9 +24,6 @@ defmodule Chesstrainer.Endgames.Tablebase do
|
||||
checkmate: false,
|
||||
dtc: nil,
|
||||
dtm: nil,
|
||||
dtw: nil,
|
||||
dtz: nil,
|
||||
insufficient_material: false,
|
||||
moves: nil
|
||||
|
||||
@doc """
|
||||
|
||||
Reference in New Issue
Block a user