49 const std::array<std::array<int, 64>, 64> *
history_;
94 const std::array<std::array<int, 64>, 64> *history,
95 const std::array<std::array<int, 64>, 16> *captureHist,
96 std::array<Move, MAX_MOVES> &captures,
97 std::array<int, MAX_MOVES> &captureScores,
98 std::array<Move, MAX_MOVES> &quiets,
99 std::array<int, MAX_MOVES> &quietScores,
100 std::array<Move, MAX_MOVES> &badCaptures,
101 int ply,
int threadId = 0,
Move countermove =
Move(0))
130 int &nextIdx,
int count);
Search interface and shared data structures.
chess::Move Move
Alias for chess::Move.
Definition Types.h:15
chess::Movelist Movelist
Alias for chess::Movelist.
Definition Types.h:16
chess::Board Board
Alias for chess::Board.
Definition Types.h:14
int nextQueenPromo_
Index of the next queen promotion to return.
Definition MovePicker.h:67
std::array< Move, MAX_MOVES > & quiets_
External buffer for quiet moves.
Definition MovePicker.h:41
int threadId_
Thread ID for diversified move ordering in Lazy SMP.
Definition MovePicker.h:53
void generateAndScoreQuiets(const Board &board, const Negamax *search)
Definition MovePicker.cpp:286
bool quietsGenerated_
True if quiet moves have been scored and sorted.
Definition MovePicker.h:65
bool capturesGenerated_
True if capture moves have been scored and sorted.
Definition MovePicker.h:63
std::array< int, MAX_MOVES > & quietScores_
External buffer for quiet scores.
Definition MovePicker.h:42
std::array< Move, MAX_MOVES > & captures_
External buffer for capture moves.
Definition MovePicker.h:34
int scoreMove(const Move &move, const Board &board, const Negamax *search, bool isCapture)
Definition MovePicker.cpp:17
int ply_
Current distance from root.
Definition MovePicker.h:52
void generateAndScoreKillers(const Board &board, const Negamax *search)
Definition MovePicker.cpp:278
Move ttMove_
Best move retrieved from the Transposition Table (searched first).
Definition MovePicker.h:45
const Movelist & allMoves_
Reference to all legal moves generated for the current node.
Definition MovePicker.h:28
int captureCount_
Number of captures populated.
Definition MovePicker.h:36
int nextQuiet_
Index of the next quiet move to return.
Definition MovePicker.h:57
bool killersGenerated_
True if killer moves have been extracted.
Definition MovePicker.h:64
int nextKiller_
Index of the next killer to return.
Definition MovePicker.h:56
void generateAndScoreCaptures(const Board &board, const Negamax *search)
Definition MovePicker.cpp:220
int quietCount_
Number of quiets populated.
Definition MovePicker.h:43
Move countermove_
Countermove heuristic response to the opponent's previous move.
Definition MovePicker.h:46
int nextBadCapture_
Index of the next bad capture to return.
Definition MovePicker.h:61
Move nextMove(const Board &board, const Negamax *search, bool inCheck)
Returns the next best move according to the current phase.
Definition MovePicker.cpp:90
int killerCount_
Number of valid killer moves found.
Definition MovePicker.h:39
const std::array< std::array< Move, 2 >, SearchConstants::MAX_PLY > * killers_
Pointer to global killer heuristic table.
Definition MovePicker.h:48
const std::array< std::array< int, 64 >, 16 > * captureHist_
Pointer to global capture history table.
Definition MovePicker.h:50
int phase_
Current phase: 0: Promos, 1: TT, 2: Captures, 3: Killers, 4: Countermove, 5: Quiets,...
Definition MovePicker.h:71
std::array< Move, MAX_MOVES > & badCaptures_
External buffer for captures that fail SEE.
Definition MovePicker.h:59
int badCaptureCount_
Number of bad captures found.
Definition MovePicker.h:60
const std::array< std::array< int, 64 >, 64 > * history_
Pointer to global history heuristic table.
Definition MovePicker.h:49
std::array< int, MAX_MOVES > & captureScores_
External buffer for capture scores.
Definition MovePicker.h:35
MovePicker(const Movelist &moves, Move ttMove, const std::array< std::array< Move, 2 >, SearchConstants::MAX_PLY > *killers, const std::array< std::array< int, 64 >, 64 > *history, const std::array< std::array< int, 64 >, 16 > *captureHist, std::array< Move, MAX_MOVES > &captures, std::array< int, MAX_MOVES > &captureScores, std::array< Move, MAX_MOVES > &quiets, std::array< int, MAX_MOVES > &quietScores, std::array< Move, MAX_MOVES > &badCaptures, int ply, int threadId=0, Move countermove=Move(0))
Constructs a MovePicker for a specific search node.
Definition MovePicker.h:91
int queenPromoCount_
Number of queen promotions found.
Definition MovePicker.h:68
std::array< Move, 2 > killerMoves_
Local cache of killer moves for this ply.
Definition MovePicker.h:38
bool countermoveReturned_
True if the countermove has already been returned.
Definition MovePicker.h:70
int nextCapture_
Index of the next capture to return.
Definition MovePicker.h:55
static constexpr int MAX_MOVES
Maximum allowed moves, aligned to power of 2 for safety.
Definition MovePicker.h:32
Move selectBestMove(std::array< Move, N > &list, std::array< int, N > &scores, int &nextIdx, int count)
Definition MovePicker.cpp:297
Implementation of the main Alpha-Beta search algorithm.
Definition Negamax.h:33
constexpr int MAX_PLY
Maximum supported plies from root.
Definition Types.h:49