Performance-test (perft) helpers for validating move generation.
perft/2 counts leaf nodes from a %Game{}; perft_fast/5 and perft_fast/6
recurse on raw (board_tuple, turn, castling, en_passant) state without allocating game
structs. perft_parallel/2 distributes root moves over all schedulers and
divide/2 returns per-root-move counts for debugging. Compare results
against the standard reference nodes (start position depth 5: 4,865,609;
Kiwipete depth 3: 97,862).
Summary
Functions
Returns per-root-move node counts for debugging.
Counts leaf nodes from the given game state.
Counts leaf nodes from raw position fields.
Distributes root nodes across schedulers.
Counts leaf nodes with an ETS-backed transposition table.
Functions
@spec divide(Echecs.Game.t(), non_neg_integer()) :: [{String.t(), non_neg_integer()}]
Returns per-root-move node counts for debugging.
@spec perft(Echecs.Game.t(), non_neg_integer()) :: non_neg_integer()
Counts leaf nodes from the given game state.
@spec perft_fast( Echecs.Board.board_tuple(), Echecs.Piece.color(), non_neg_integer(), Echecs.Board.square() | nil, non_neg_integer() ) :: non_neg_integer()
Counts leaf nodes from raw position fields.
@spec perft_parallel(Echecs.Game.t(), non_neg_integer()) :: non_neg_integer()
Distributes root nodes across schedulers.
@spec perft_with_tt(Echecs.Game.t(), non_neg_integer()) :: non_neg_integer()
Counts leaf nodes with an ETS-backed transposition table.