if ( depth >= 12
&& !stop
&& PVSize == 1
+ && bestValue > VALUE_MATED_IN_MAX_PLY
&& ( RootMoves.size() == 1
|| Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
{
&& ttMove == MOVE_NONE
&& (PvNode || (!inCheck && ss->staticEval + Value(256) >= beta)))
{
- Depth d = (PvNode ? depth - 2 * ONE_PLY : depth / 2);
+ Depth d = depth - 2 * ONE_PLY - (PvNode ? DEPTH_ZERO : depth / 4);
ss->skipNullMove = true;
search<PvNode ? PV : NonPV>(pos, ss, alpha, beta, d);
&& !captureOrPromotion
&& !inCheck
&& !dangerous
- && move != ttMove)
+ && move != ttMove
+ && bestValue > VALUE_MATED_IN_MAX_PLY)
{
// Move count based pruning
if ( depth < 16 * ONE_PLY
// but fixing this made program slightly weaker.
Depth predictedDepth = newDepth - reduction<PvNode>(depth, moveCount);
futilityValue = ss->staticEval + ss->evalMargin + futility_margin(predictedDepth, moveCount)
- + Gain[pos.piece_moved(move)][to_sq(move)];
+ + 2 * Gain[pos.piece_moved(move)][to_sq(move)];
if (futilityValue < beta)
{
+ bestValue = std::max(bestValue, futilityValue);
+
if (SpNode)
+ {
splitPoint->mutex.lock();
-
+ if (bestValue > splitPoint->bestValue)
+ splitPoint->bestValue = bestValue;
+ }
continue;
}