// Razor and futility margins
constexpr int RazorMargin = 510;
Value futility_margin(Depth d, bool improving) {
- return Value(223 * (d - improving));
+ return Value(234 * (d - improving));
}
// Reductions lookup table, initialized at startup
Depth reduction(bool i, Depth d, int mn) {
int r = Reductions[d] * Reductions[mn];
- return (r + 509) / 1024 + (!i && r > 894);
+ return (r + 503) / 1024 + (!i && r > 915);
}
constexpr int futility_move_count(bool improving, Depth depth) {
void Search::init() {
for (int i = 1; i < MAX_MOVES; ++i)
- Reductions[i] = int((22.0 + 2 * std::log(Threads.size())) * std::log(i + 0.25 * std::log(i)));
+ Reductions[i] = int((21.3 + 2 * std::log(Threads.size())) * std::log(i + 0.25 * std::log(i)));
}
beta = std::min(prev + delta, VALUE_INFINITE);
// Adjust contempt based on root move's previousScore (dynamic contempt)
- int dct = ct + (105 - ct / 2) * prev / (abs(prev) + 149);
+ int dct = ct + (113 - ct / 2) * prev / (abs(prev) + 147);
contempt = (us == WHITE ? make_score(dct, dct / 2)
: -make_score(dct, dct / 2));
&& (ss-1)->statScore < 22977
&& eval >= beta
&& eval >= ss->staticEval
- && ss->staticEval >= beta - 30 * depth - 28 * improving + 84 * ss->ttPv + 182
+ && ss->staticEval >= beta - 30 * depth - 28 * improving + 84 * ss->ttPv + 168
&& !excludedMove
&& pos.non_pawn_material(us)
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
assert(eval - beta >= 0);
// Null move dynamic reduction based on depth and value
- Depth R = (982 + 85 * depth) / 256 + std::min(int(eval - beta) / 192, 3);
+ Depth R = (1015 + 85 * depth) / 256 + std::min(int(eval - beta) / 191, 3);
ss->currentMove = MOVE_NULL;
ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0];
if (nullValue >= VALUE_TB_WIN_IN_MAX_PLY)
nullValue = beta;
- if (thisThread->nmpMinPly || (abs(beta) < VALUE_KNOWN_WIN && depth < 13))
+ if (thisThread->nmpMinPly || (abs(beta) < VALUE_KNOWN_WIN && depth < 14))
return nullValue;
assert(!thisThread->nmpMinPly); // Recursive verification is not allowed
}
}
- probCutBeta = beta + 176 - 49 * improving;
+ probCutBeta = beta + 183 - 49 * improving;
// Step 10. ProbCut (~10 Elo)
// If we have a good enough capture and a reduced search returns a value
// Futility pruning: parent node (~5 Elo)
if ( lmrDepth < 7
&& !ss->inCheck
- && ss->staticEval + 283 + 170 * lmrDepth <= alpha
+ && ss->staticEval + 266 + 170 * lmrDepth <= alpha
&& (*contHist[0])[movedPiece][to_sq(move)]
+ (*contHist[1])[movedPiece][to_sq(move)]
+ (*contHist[3])[movedPiece][to_sq(move)]
continue;
// Prune moves with negative SEE (~20 Elo)
- if (!pos.see_ge(move, Value(-(29 - std::min(lmrDepth, 18)) * lmrDepth * lmrDepth)))
+ if (!pos.see_ge(move, Value(-(30 - std::min(lmrDepth, 18)) * lmrDepth * lmrDepth)))
continue;
}
else
&& captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] < 0)
continue;
- // See based pruning
- if (!pos.see_ge(move, Value(-221) * depth)) // (~25 Elo)
+ // SEE based pruning
+ if (!pos.see_ge(move, Value(-213) * depth)) // (~25 Elo)
continue;
}
}
|| moveCountPruning
|| ss->staticEval + PieceValue[EG][pos.captured_piece()] <= alpha
|| cutNode
- || thisThread->ttHitAverage < 427 * TtHitAverageResolution * TtHitAverageWindow / 1024))
+ || thisThread->ttHitAverage < 432 * TtHitAverageResolution * TtHitAverageWindow / 1024))
{
Depth r = reduction(improving, depth, moveCount);
// Decrease reduction if the ttHit running average is large
- if (thisThread->ttHitAverage > 509 * TtHitAverageResolution * TtHitAverageWindow / 1024)
+ if (thisThread->ttHitAverage > 537 * TtHitAverageResolution * TtHitAverageWindow / 1024)
r--;
- // Reduction if other threads are searching this position
+ // Increase reduction if other threads are searching this position
if (th.marked())
r++;
if (ss->ttPv)
r -= 2;
+ // Increase reduction at root and non-PV nodes when the best move does not change frequently
+ if ((rootNode || !PvNode) && depth > 10 && thisThread->bestMoveChanges <= 2)
+ r++;
+
if (moveCountPruning && !formerPv)
r++;
- 5287;
// Decrease/increase reduction by comparing opponent's stat score (~10 Elo)
- if (ss->statScore >= -106 && (ss-1)->statScore < -104)
+ if (ss->statScore >= -105 && (ss-1)->statScore < -103)
r--;
- else if ((ss-1)->statScore >= -119 && ss->statScore < -140)
+ else if ((ss-1)->statScore >= -122 && ss->statScore < -129)
r++;
// Decrease/increase reduction for moves with a good/bad history (~30 Elo)
// Unless giving check, this capture is likely bad
if ( !givesCheck
- && ss->staticEval + PieceValue[EG][pos.captured_piece()] + 213 * depth <= alpha)
+ && ss->staticEval + PieceValue[EG][pos.captured_piece()] + 210 * depth <= alpha)
r++;
}
if (PvNode && bestValue > alpha)
alpha = bestValue;
- futilityBase = bestValue + 145;
+ futilityBase = bestValue + 155;
}
const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,