io-chess
UCI chess engine
Loading...
Searching...
No Matches
SearchConstants Namespace Reference

Global constants related to search and evaluation boundaries. More...

Variables

constexpr int INFINITE = 32000
 Absolute maximum score.
constexpr int MATE_SCORE = 31500
 Base score for checkmate.
constexpr int MATE_IN_MAX = MATE_SCORE - 300
 Threshold to detect mating sequences.
constexpr int TB_WIN_SCORE = 31000
 Base score for a tablebase win.
constexpr int TB_WIN_IN_MAX = TB_WIN_SCORE - 800
 Threshold to detect tablebase wins.
constexpr int DRAW_SCORE = 0
 Score for a draw position.
constexpr int CONTEMPT_FACTOR = 5
 Make draws slightly negative to encourage winning.
constexpr uint8_t TT_EXACT = 0
 Transposition table entry is an exact score.
constexpr uint8_t TT_ALPHA = 1
 Transposition table entry is an upper bound (failed low).
constexpr uint8_t TT_BETA = 2
 Transposition table entry is a lower bound (failed high).
constexpr int DEFAULT_DEPTH = 100
 Default maximum depth for search.
constexpr int MAX_PLY = 128
 Maximum supported plies from root.
constexpr int LMR_MIN_DEPTH = 3
 Minimum depth to consider Late Move Reductions (LMR).
constexpr int NULL_MOVE_MIN_DEPTH = 4
 Minimum depth to consider Null Move Pruning.
constexpr int MAX_EXTENSIONS = 8
 Maximum number of search extensions per path.
constexpr int16_t INVALID_EVAL = 32001
 Special value indicating an uncomputed or invalid static evaluation.

Detailed Description

Global constants related to search and evaluation boundaries.

NOTE: All score constants must fit in int16_t (max 32767) for TT storage. After value_to_tt adds ply (up to MAX_PLY=128), max stored value is ~31628. Hierarchy: INFINITE > MATE_SCORE > MATE_IN_MAX > TB_WIN_SCORE > TB_WIN_IN_MAX > WDL eval (≤30000)

Variable Documentation

◆ CONTEMPT_FACTOR

int SearchConstants::CONTEMPT_FACTOR = 5
constexpr

Make draws slightly negative to encourage winning.

◆ DEFAULT_DEPTH

int SearchConstants::DEFAULT_DEPTH = 100
constexpr

Default maximum depth for search.

◆ DRAW_SCORE

int SearchConstants::DRAW_SCORE = 0
constexpr

Score for a draw position.

◆ INFINITE

int SearchConstants::INFINITE = 32000
constexpr

Absolute maximum score.

◆ INVALID_EVAL

int16_t SearchConstants::INVALID_EVAL = 32001
constexpr

Special value indicating an uncomputed or invalid static evaluation.

◆ LMR_MIN_DEPTH

int SearchConstants::LMR_MIN_DEPTH = 3
constexpr

Minimum depth to consider Late Move Reductions (LMR).

◆ MATE_IN_MAX

int SearchConstants::MATE_IN_MAX = MATE_SCORE - 300
constexpr

Threshold to detect mating sequences.

◆ MATE_SCORE

int SearchConstants::MATE_SCORE = 31500
constexpr

Base score for checkmate.

◆ MAX_EXTENSIONS

int SearchConstants::MAX_EXTENSIONS = 8
constexpr

Maximum number of search extensions per path.

◆ MAX_PLY

int SearchConstants::MAX_PLY = 128
constexpr

Maximum supported plies from root.

◆ NULL_MOVE_MIN_DEPTH

int SearchConstants::NULL_MOVE_MIN_DEPTH = 4
constexpr

Minimum depth to consider Null Move Pruning.

◆ TB_WIN_IN_MAX

int SearchConstants::TB_WIN_IN_MAX = TB_WIN_SCORE - 800
constexpr

Threshold to detect tablebase wins.

◆ TB_WIN_SCORE

int SearchConstants::TB_WIN_SCORE = 31000
constexpr

Base score for a tablebase win.

◆ TT_ALPHA

uint8_t SearchConstants::TT_ALPHA = 1
constexpr

Transposition table entry is an upper bound (failed low).

◆ TT_BETA

uint8_t SearchConstants::TT_BETA = 2
constexpr

Transposition table entry is a lower bound (failed high).

◆ TT_EXACT

uint8_t SearchConstants::TT_EXACT = 0
constexpr

Transposition table entry is an exact score.