currentMove = threatMove = MOVE_NONE;
reduction = Depth(0);
eval = VALUE_NONE;
+ evalInfo = NULL;
}
void SearchStack::initKillers() {
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;
// Go with internal iterative deepening if we don't have a TT move
if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly &&
- !isCheck && evaluate(pos, ei, threadID) >= beta - IIDMargin)
+ !isCheck && ss[ply].eval >= beta - IIDMargin)
{
search(pos, ss, beta, Min(depth/2, depth-2*OnePly), ply, false, threadID);
ttMove = ss[ply].pv[ply];