constexpr uint64_t TtHitAverageResolution = 1024;
// Razor and futility margins
- constexpr int RazorMargin = 531;
+ constexpr int RazorMargin = 527;
Value futility_margin(Depth d, bool improving) {
- return Value(217 * (d - improving));
+ return Value(227 * (d - improving));
}
// Reductions lookup table, initialized at startup
Depth reduction(bool i, Depth d, int mn) {
int r = Reductions[d] * Reductions[mn];
- return (r + 511) / 1024 + (!i && r > 1007);
+ return (r + 570) / 1024 + (!i && r > 1018);
}
constexpr int futility_move_count(bool improving, Depth depth) {
- return (4 + depth * depth) / (2 - improving);
+ return (3 + depth * depth) / (2 - improving);
}
// History and stats update bonus, based on depth
int stat_bonus(Depth d) {
- return d > 15 ? -8 : 19 * d * d + 155 * d - 132;
+ return d > 15 ? 27 : 17 * d * d + 133 * d - 134;
}
// Add a small random component to draw evaluations to avoid 3fold-blindness
if (rootDepth >= 4)
{
Value prev = rootMoves[pvIdx].previousScore;
- delta = Value(21);
+ delta = Value(19);
alpha = std::max(prev - delta,-VALUE_INFINITE);
beta = std::min(prev + delta, VALUE_INFINITE);
// Adjust contempt based on root move's previousScore (dynamic contempt)
- int dct = ct + (102 - ct / 2) * prev / (abs(prev) + 157);
+ int dct = ct + (110 - ct / 2) * prev / (abs(prev) + 140);
contempt = (us == WHITE ? make_score(dct, dct / 2)
: -make_score(dct, dct / 2));
&& !Threads.stop
&& !mainThread->stopOnPonderhit)
{
- double fallingEval = (332 + 6 * (mainThread->bestPreviousScore - bestValue)
- + 6 * (mainThread->iterValue[iterIdx] - bestValue)) / 704.0;
+ double fallingEval = (296 + 6 * (mainThread->bestPreviousScore - bestValue)
+ + 6 * (mainThread->iterValue[iterIdx] - bestValue)) / 725.0;
fallingEval = Utility::clamp(fallingEval, 0.5, 1.5);
// If the bestMove is stable over several iterations, reduce time accordingly
- timeReduction = lastBestMoveDepth + 9 < completedDepth ? 1.94 : 0.91;
- double reduction = (1.41 + mainThread->previousTimeReduction) / (2.27 * timeReduction);
+ timeReduction = lastBestMoveDepth + 10 < completedDepth ? 1.92 : 0.95;
+ double reduction = (1.47 + mainThread->previousTimeReduction) / (2.22 * timeReduction);
// Use part of the gained time from a previous stable move for the current move
for (Thread* th : Threads)
}
else if ( Threads.increaseDepth
&& !mainThread->ponder
- && Time.elapsed() > totalTime * 0.6)
+ && Time.elapsed() > totalTime * 0.56)
Threads.increaseDepth = false;
else
Threads.increaseDepth = true;
// 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)
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
assert(eval - beta >= 0);
// Null move dynamic reduction based on depth and value
- Depth R = (854 + 68 * depth) / 258 + std::min(int(eval - beta) / 192, 3);
+ Depth R = (737 + 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 - 45 * improving;
+ Value raisedBeta = beta + 176 - 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 + 235 + 172 * lmrDepth <= alpha
+ && 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 < 31400)
+ + (*contHist[5])[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)) * lmrDepth * lmrDepth)))
+ if (!pos.see_ge(move, Value(-(29 - std::min(lmrDepth, 17)) * lmrDepth * lmrDepth)))
continue;
}
else
&& lmrDepth < 6
&& !(PvNode && abs(bestValue) < 2)
&& !ss->inCheck
- && ss->staticEval + 270 + 384 * lmrDepth + PieceValue[MG][type_of(pos.piece_on(to_sq(move)))] <= alpha)
+ && ss->staticEval + 267 + 391 * lmrDepth + PieceValue[MG][type_of(pos.piece_on(to_sq(move)))] <= alpha)
continue;
// See based pruning
- if (!pos.see_ge(move, Value(-194) * depth)) // (~25 Elo)
+ if (!pos.see_ge(move, Value(-202) * 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))
{
Depth r = reduction(improving, depth, moveCount);
// Decrease reduction if the ttHit running average is large
- if (thisThread->ttHitAverage > 500 * TtHitAverageResolution * TtHitAverageWindow / 1024)
+ if (thisThread->ttHitAverage > 473 * TtHitAverageResolution * TtHitAverageWindow / 1024)
r--;
// Reduction if other threads are searching this position.
r++;
// Decrease reduction if opponent's move count is high (~5 Elo)
- if ((ss-1)->moveCount > 14)
+ if ((ss-1)->moveCount > 13)
r--;
// Decrease reduction if ttMove has been singularly extended (~3 Elo)
+ (*contHist[0])[movedPiece][to_sq(move)]
+ (*contHist[1])[movedPiece][to_sq(move)]
+ (*contHist[3])[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;
+ r -= ss->statScore / 14615;
}
else
{
// Unless giving check, this capture is likely bad
if ( !givesCheck
- && ss->staticEval + PieceValue[EG][pos.captured_piece()] + 200 * depth <= alpha)
+ && ss->staticEval + PieceValue[EG][pos.captured_piece()] + 211 * depth <= alpha)
r++;
}
if (PvNode && bestValue > alpha)
alpha = bestValue;
- futilityBase = bestValue + 154;
+ futilityBase = bestValue + 141;
}
const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
thisThread->counterMoves[pos.piece_on(prevSq)][prevSq] = move;
}
- if (depth > 12 && ss->ply < MAX_LPH)
- thisThread->lowPlyHistory[ss->ply][from_to(move)] << stat_bonus(depth - 7);
+ if (depth > 11 && ss->ply < MAX_LPH)
+ thisThread->lowPlyHistory[ss->ply][from_to(move)] << stat_bonus(depth - 6);
}
// When playing with strength handicap, choose best move among a set of RootMoves