engine/search.h

Search algorithms and transposition table.

Typedefs

using SearchInfoHook = std::function<void(const SearchIteration&)>

Functions

void clearTranspositionTable()
int readHashEntry(int alpha, int beta, int depth)
void recordHash(int score, int depth, int hashFlag, int move)
int scoreMove(int move, int hashMove)
void scoreMoveList(moves *moveList, int *moveScores)
void pickMove(moves *moveList, int *moveScores, int index)
int staticExchangeEvaluation(int move)
void setUseSEE(bool enabled)
bool getUseSEE()
void setUseSEEOrdering(bool enabled)
bool getUseSEEOrdering()
void setUseSEEPruning(bool enabled)
bool getUseSEEPruning()
void setUsePVS(bool enabled)
bool getUsePVS()
void setUseNullMovePruning(bool enabled)
bool getUseNullMovePruning()
void setUseLMR(bool enabled)
bool getUseLMR()
void setUseFutilityPruning(bool enabled)
bool getUseFutilityPruning()
void setUseSingularExtensions(bool enabled)
bool getUseSingularExtensions()
void setUseProbCut(bool enabled)
bool getUseProbCut()
void setUseInternalIterativeDeepening(bool enabled)
bool getUseInternalIterativeDeepening()
void setUseAspirationWindows(bool enabled)
bool getUseAspirationWindows()
void setUseHistoryOrdering(bool enabled)
bool getUseHistoryOrdering()
void setUseContinuationHistory(bool enabled)
bool getUseContinuationHistory()
void setHashMegabytes(int megabytes)
int getHashMegabytes()
int getMaxHashMegabytes()
int getActiveHashEntries()
void sortMoves(moves *moveList)
void enablePvScoring(moves *moveList)
int isRepeating()
int repetitionCount()
bool isMateScore(int score)
std::optional<int> mateDistanceIn(int score)
void setSearchInfoHook(SearchInfoHook hook)
int quiescence(int alpha, int beta)
int negamax(int alpha, int beta, int depth)
void searchPosition(int depth)
void printMoveScores(moves *moveList)

Variables

tt transpositionTable[hashSize]
int killerMoves[2][maxPly]
int historyMoves[12][64]
int pvLength[maxPly]
int pvTable[maxPly][maxPly]
int followPV
int scorePV
int bestMove
int mvvLVA[12][12]
int skillLevel
struct SearchIteration
#include <search.h>

Public Members

int depth = 0
int scoreCp = 0
long nodes = 0
long long timeMs = 0
const int *pv = nullptr
int pvLength = 0