1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Document lookup tables

No functional change

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2010-02-07 10:53:15 +02:00 committed by Marco Costalba
parent 6e1cb6e45b
commit 8261f61964

View file

@ -150,6 +150,23 @@ namespace {
// Depth limit for razoring
const Depth RazorDepth = 4 * OnePly;
/// Lookup tables initialized at startup
// Reduction lookup tables and their getter functions
int8_t PVReductionMatrix[64][64]; // [depth][moveNumber]
int8_t NonPVReductionMatrix[64][64]; // [depth][moveNumber]
inline Depth pv_reduction(Depth d, int mn) { return (Depth) PVReductionMatrix[Min(d / 2, 63)][Min(mn, 63)]; }
inline Depth nonpv_reduction(Depth d, int mn) { return (Depth) NonPVReductionMatrix[Min(d / 2, 63)][Min(mn, 63)]; }
// Futility lookup tables and their getter functions
const Value FutilityMarginQS = Value(0x80);
int32_t FutilityMarginsMatrix[14][64]; // [depth][moveNumber]
int FutilityMoveCountArray[32]; // [depth]
inline Value futility_margin(Depth d, int mn) { return (Value) (d < 14? FutilityMarginsMatrix[Max(d, 0)][Min(mn, 63)] : 2*VALUE_INFINITE); }
inline int futility_move_count(Depth d) { return (d < 32? FutilityMoveCountArray[d] : 512); }
/// Variables initialized by UCI options
// Depth limit for use of dynamic threat detection
@ -195,22 +212,6 @@ namespace {
bool UseLogFile;
std::ofstream LogFile;
// Futility lookup tables and their getter functions
const Value FutilityMarginQS = Value(0x80);
int32_t FutilityMarginsMatrix[14][64]; // [depth][moveNumber]
int FutilityMoveCountArray[32]; // [depth]
inline Value futility_margin(Depth d, int mn) { return (Value) (d < 14? FutilityMarginsMatrix[Max(d, 0)][Min(mn, 63)] : 2*VALUE_INFINITE); }
inline int futility_move_count(Depth d) { return (d < 32? FutilityMoveCountArray[d] : 512); }
// Reduction lookup tables and their getter functions
// Initialized at startup
int8_t PVReductionMatrix[64][64]; // [depth][moveNumber]
int8_t NonPVReductionMatrix[64][64]; // [depth][moveNumber]
inline Depth pv_reduction(Depth d, int mn) { return (Depth) PVReductionMatrix[Min(d / 2, 63)][Min(mn, 63)]; }
inline Depth nonpv_reduction(Depth d, int mn) { return (Depth) NonPVReductionMatrix[Min(d / 2, 63)][Min(mn, 63)]; }
// MP related variables
int ActiveThreads = 1;
Depth MinimumSplitDepth;