// Step 4. Static evaluation of the position
if (ss->inCheck)
- {
bestValue = futilityBase = -VALUE_INFINITE;
- }
else
{
if (ss->ttHit)
bestValue = ttValue;
}
else
- {
// In case of null move search use previous static eval with a different sign
ss->staticEval = bestValue = (ss-1)->currentMove != MOVE_NULL ? evaluate(pos)
: -(ss-1)->staticEval;
- }
// Stand pat. Return immediately if static value is at least beta
if (bestValue >= beta)
bestValue = std::max(bestValue, futilityBase);
continue;
}
- }
-
- // We prune after the second quiet check evasion move, where being 'in check' is
- // implicitly checked through the counter, and being a 'quiet move' apart from
- // being a tt move is assumed after an increment because captures are pushed ahead.
- if (quietCheckEvasions > 1)
- break;
-
- // Continuation history based pruning (~3 Elo)
- if ( !capture
- && (*contHist[0])[pos.moved_piece(move)][to_sq(move)] < 0
- && (*contHist[1])[pos.moved_piece(move)][to_sq(move)] < 0)
- continue;
+ }
- // Do not search moves with bad enough SEE values (~5 Elo)
- if (!pos.see_ge(move, Value(-95)))
- continue;
+ // We prune after the second quiet check evasion move, where being 'in check' is
+ // implicitly checked through the counter, and being a 'quiet move' apart from
+ // being a tt move is assumed after an increment because captures are pushed ahead.
+ if (quietCheckEvasions > 1)
+ break;
+
+ // Continuation history based pruning (~3 Elo)
+ if ( !capture
+ && (*contHist[0])[pos.moved_piece(move)][to_sq(move)] < 0
+ && (*contHist[1])[pos.moved_piece(move)][to_sq(move)] < 0)
+ continue;
+
+ // Do not search moves with bad enough SEE values (~5 Elo)
+ if (!pos.see_ge(move, Value(-95)))
+ continue;
}
// Speculative prefetch as early as possible