&& eval <= alpha - RazorMargin)
return qsearch<NT>(pos, ss, alpha, beta);
- improving = (ss-2)->staticEval == VALUE_NONE ? (ss->staticEval >= (ss-4)->staticEval
- || (ss-4)->staticEval == VALUE_NONE) : ss->staticEval >= (ss-2)->staticEval;
+ improving = (ss-2)->staticEval == VALUE_NONE ? (ss->staticEval > (ss-4)->staticEval
+ || (ss-4)->staticEval == VALUE_NONE) : ss->staticEval > (ss-2)->staticEval;
// Step 8. Futility pruning: child node (~50 Elo)
if ( !PvNode
&& (ss-1)->statScore < 23397
&& eval >= beta
&& eval >= ss->staticEval
- && ss->staticEval >= beta - 32 * depth + 292 - improving * 30
+ && ss->staticEval >= beta - 32 * depth - 30 * improving + 120 * ttPv + 292
&& !excludedMove
&& pos.non_pawn_material(us)
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
// Futility pruning: parent node (~5 Elo)
if ( lmrDepth < 6
&& !inCheck
- && ss->staticEval + 255 + 182 * lmrDepth <= alpha
+ && ss->staticEval + 235 + 172 * lmrDepth <= alpha
&& thisThread->mainHistory[us][from_to(move)]
+ (*contHist[0])[movedPiece][to_sq(move)]
+ (*contHist[1])[movedPiece][to_sq(move)]
- + (*contHist[3])[movedPiece][to_sq(move)] < 30000)
+ + (*contHist[3])[movedPiece][to_sq(move)] < 25000)
continue;
// Prune moves with negative SEE (~20 Elo)
continue;
}
else if (!pos.see_ge(move, Value(-194) * depth)) // (~25 Elo)
- continue;
+ continue;
}
// Step 14. Extensions (~75 Elo)
&& tte->depth() >= depth - 3
&& pos.legal(move))
{
- Value singularBeta = ttValue - 2 * depth;
+ Value singularBeta = ttValue - (((ttPv && !PvNode) + 4) * depth) / 2;
Depth halfDepth = depth / 2;
ss->excludedMove = move;
value = search<NonPV>(pos, ss, singularBeta - 1, singularBeta, halfDepth, cutNode);
// hence break make_move(). (~2 Elo)
else if ( type_of(move) == NORMAL
&& !pos.see_ge(reverse_move(move)))
- r -= 2;
+ r -= 2 + ttPv;
ss->statScore = thisThread->mainHistory[us][from_to(move)]
+ (*contHist[0])[movedPiece][to_sq(move)]
r -= ss->statScore / 16384;
}
+ // Increase reduction for captures/promotions if late move and at low depth
+ else if (depth < 8 && moveCount > 2)
+ r++;
+
Depth d = clamp(newDepth - r, 1, newDepth);
value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, d, true);