if (rootDepth >= 4)
{
Value prev = rootMoves[pvIdx].previousScore;
- delta = Value(21 * (1 + rootPos.captures_to_hand()));
- delta = Value(19);
++ delta = Value(19 * (1 + rootPos.captures_to_hand()));
alpha = std::max(prev - delta,-VALUE_INFINITE);
beta = std::min(prev + delta, VALUE_INFINITE);
// Step 9. Null move search with verification search (~40 Elo)
if ( !PvNode
&& (ss-1)->currentMove != MOVE_NULL
- && (ss-1)->statScore < 23397
+ && (ss-1)->statScore < 23824
&& eval >= beta
&& eval >= ss->staticEval
- && ss->staticEval >= beta - 32 * depth - 30 * improving + 120 * ttPv + 292
+ && ss->staticEval >= beta - 33 * depth - 33 * improving + 112 * ttPv + 311
&& !excludedMove
&& pos.non_pawn_material(us)
+ && pos.count<ALL_PIECES>(~us) != pos.count<PAWN>(~us)
+ && !pos.flip_enclosed_pieces()
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
{
assert(eval - beta >= 0);
// Null move dynamic reduction based on depth and value
- Depth R = (854 - 150 * !pos.checking_permitted() + 68 * depth) / 258 + std::min(int(eval - beta) / 192, 3);
- Depth R = (737 + 77 * depth) / 246 + std::min(int(eval - beta) / 192, 3);
++ Depth R = (737 - 150 * !pos.checking_permitted() + 77 * depth) / 246 + std::min(int(eval - beta) / 192, 3);
ss->currentMove = MOVE_NULL;
ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0];
// If we have a good enough capture and a reduced search returns a value
// much above beta, we can (almost) safely prune the previous move.
if ( !PvNode
- && depth >= 5
+ && depth > 4
&& abs(beta) < VALUE_TB_WIN_IN_MAX_PLY)
{
- Value raisedBeta = beta + (189 + 20 * !!pos.capture_the_flag_piece()) * (1 + pos.check_counting() + (pos.extinction_value() != VALUE_NONE)) - 45 * improving;
- Value raisedBeta = beta + 176 - 49 * improving;
++ Value raisedBeta = beta + (176 + 20 * !!pos.capture_the_flag_piece()) * (1 + pos.check_counting() + (pos.extinction_value() != VALUE_NONE)) - 49 * improving;
assert(raisedBeta < VALUE_INFINITE);
MovePicker mp(pos, ttMove, raisedBeta - ss->staticEval, &captureHistory);
int probCutCount = 0;
// Futility pruning: parent node (~5 Elo)
if ( lmrDepth < 6
&& !ss->inCheck
- && ss->staticEval + 284 + 188 * lmrDepth <= alpha
- && (*contHist[0])[movedPiece][to_sq(move)]
- + (*contHist[1])[movedPiece][to_sq(move)]
- + (*contHist[3])[movedPiece][to_sq(move)]
- + (*contHist[5])[movedPiece][to_sq(move)] / 2 < 28388)
+ && !( pos.extinction_value() == -VALUE_MATE
+ && pos.extinction_piece_types().find(ALL_PIECES) == pos.extinction_piece_types().end())
- && ss->staticEval + (235 + 172 * lmrDepth) * (1 + pos.check_counting()) <= alpha
++ && ss->staticEval + (284 + 188 * lmrDepth) * (1 + pos.check_counting()) <= alpha
+ && (*contHist[0])[history_slot(movedPiece)][to_sq(move)]
+ + (*contHist[1])[history_slot(movedPiece)][to_sq(move)]
+ + (*contHist[3])[history_slot(movedPiece)][to_sq(move)]
- + (*contHist[5])[history_slot(movedPiece)][to_sq(move)] / 2 < 31400)
++ + (*contHist[5])[history_slot(movedPiece)][to_sq(move)] / 2 < 28388)
continue;
// Prune moves with negative SEE (~20 Elo)
- if (!pos.see_ge(move, Value(-(32 - std::min(lmrDepth, 18) + 10 * !!pos.capture_the_flag_piece()) * lmrDepth * lmrDepth)))
- if (!pos.see_ge(move, Value(-(29 - std::min(lmrDepth, 17)) * lmrDepth * lmrDepth)))
++ if (!pos.see_ge(move, Value(-(29 - std::min(lmrDepth, 17) + 10 * !!pos.capture_the_flag_piece()) * lmrDepth * lmrDepth)))
continue;
}
- else
+ else if (!pos.must_capture())
{
// Capture history based pruning when the move doesn't give check
if ( !givesCheck
continue;
// See based pruning
- if (!pos.see_ge(move, Value(-194 - 120 * pos.captures_to_hand()) * depth)) // (~25 Elo)
- if (!pos.see_ge(move, Value(-202) * depth)) // (~25 Elo)
++ if (!pos.see_ge(move, Value(-202 - 120 * pos.captures_to_hand()) * depth)) // (~25 Elo)
continue;
}
}
|| moveCountPruning
|| ss->staticEval + PieceValue[EG][pos.captured_piece()] <= alpha
|| cutNode
- || thisThread->ttHitAverage < 375 * TtHitAverageResolution * TtHitAverageWindow / 1024)
- || thisThread->ttHitAverage < 415 * TtHitAverageResolution * TtHitAverageWindow / 1024))
++ || thisThread->ttHitAverage < 415 * TtHitAverageResolution * TtHitAverageWindow / 1024)
+ && !(pos.must_capture() && MoveList<CAPTURES>(pos).size()))
{
Depth r = reduction(improving, depth, moveCount);
// hence break make_move(). (~2 Elo)
else if ( type_of(move) == NORMAL
&& !pos.see_ge(reverse_move(move)))
- r -= 2 + ttPv;
+ r -= 2 + ttPv - (type_of(movedPiece) == PAWN);
ss->statScore = thisThread->mainHistory[us][from_to(move)]
- + (*contHist[0])[movedPiece][to_sq(move)]
- + (*contHist[1])[movedPiece][to_sq(move)]
- + (*contHist[3])[movedPiece][to_sq(move)]
+ + (*contHist[0])[history_slot(movedPiece)][to_sq(move)]
+ + (*contHist[1])[history_slot(movedPiece)][to_sq(move)]
+ + (*contHist[3])[history_slot(movedPiece)][to_sq(move)]
- - 4926;
+ - 4826;
// Decrease/increase reduction by comparing opponent's stat score (~10 Elo)
- if (ss->statScore >= -102 && (ss-1)->statScore < -114)
+ if (ss->statScore >= -100 && (ss-1)->statScore < -112)
r--;
- else if ((ss-1)->statScore >= -116 && ss->statScore < -154)
+ else if ((ss-1)->statScore >= -125 && ss->statScore < -138)
r++;
// Decrease/increase reduction for moves with a good/bad history (~30 Elo)
- r -= ss->statScore / (16434 - 4434 * pos.captures_to_hand());
- r -= ss->statScore / 14615;
++ r -= ss->statScore / (14615 - 4434 * pos.captures_to_hand());
}
else
{