diff --git a/src/search.cpp b/src/search.cpp index d659fab6..403c9363 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -653,6 +653,7 @@ void SearchStack::init(int ply) { currentMove = threatMove = MOVE_NONE; reduction = Depth(0); eval = VALUE_NONE; + evalInfo = NULL; } void SearchStack::initKillers() { @@ -1375,14 +1376,15 @@ namespace { const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2); // Evaluate the position statically - if (isCheck) - ss[ply].eval = VALUE_NONE; - else + if (!isCheck) { if (tte && (tte->type() & VALUE_TYPE_EVAL)) staticValue = value_from_tt(tte->value(), ply); else + { staticValue = evaluate(pos, ei, threadID); + ss[ply].evalInfo = &ei; + } ss[ply].eval = staticValue; futilityValue = staticValue + FutilityValueMargin; diff --git a/src/search.h b/src/search.h index db9bef3c..7b114bf2 100644 --- a/src/search.h +++ b/src/search.h @@ -47,6 +47,7 @@ const int KILLER_MAX = 2; /// from nodes shallower and deeper in the tree during the search. Each /// search thread has its own array of SearchStack objects, indexed by the /// current ply. +struct EvalInfo; struct SearchStack { Move pv[PLY_MAX_PLUS_2]; @@ -56,6 +57,7 @@ struct SearchStack { Move killers[KILLER_MAX]; Depth reduction; Value eval; + EvalInfo* evalInfo; void init(int ply); void initKillers();