1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00
Joost VandeVondele 2018-04-18 19:17:16 +02:00 committed by Stéphane Nicolet
parent 108f0da4d7
commit 0143c6f0c2

View file

@ -978,29 +978,29 @@ moves_loop: // When in check, search starts from here
{ {
Depth r = reduction<PvNode>(improving, depth, moveCount); Depth r = reduction<PvNode>(improving, depth, moveCount);
if (captureOrPromotion) if (captureOrPromotion) // (~5 Elo)
r -= r ? ONE_PLY : DEPTH_ZERO; r -= r ? ONE_PLY : DEPTH_ZERO;
else else
{ {
// Decrease reduction if opponent's move count is high // Decrease reduction if opponent's move count is high (~5 Elo)
if ((ss-1)->moveCount > 15) if ((ss-1)->moveCount > 15)
r -= ONE_PLY; r -= ONE_PLY;
// Decrease reduction for exact PV nodes // Decrease reduction for exact PV nodes (~0 Elo)
if (pvExact) if (pvExact)
r -= ONE_PLY; r -= ONE_PLY;
// Increase reduction if ttMove is a capture // Increase reduction if ttMove is a capture (~0 Elo)
if (ttCapture) if (ttCapture)
r += ONE_PLY; r += ONE_PLY;
// Increase reduction for cut nodes // Increase reduction for cut nodes (~5 Elo)
if (cutNode) if (cutNode)
r += 2 * ONE_PLY; r += 2 * ONE_PLY;
// Decrease reduction for moves that escape a capture. Filter out // Decrease reduction for moves that escape a capture. Filter out
// castling moves, because they are coded as "king captures rook" and // castling moves, because they are coded as "king captures rook" and
// hence break make_move(). // hence break make_move(). (~5 Elo)
else if ( type_of(move) == NORMAL else if ( type_of(move) == NORMAL
&& !pos.see_ge(make_move(to_sq(move), from_sq(move)))) && !pos.see_ge(make_move(to_sq(move), from_sq(move))))
r -= 2 * ONE_PLY; r -= 2 * ONE_PLY;
@ -1011,14 +1011,14 @@ moves_loop: // When in check, search starts from here
+ (*contHist[3])[movedPiece][to_sq(move)] + (*contHist[3])[movedPiece][to_sq(move)]
- 4000; - 4000;
// Decrease/increase reduction by comparing opponent's stat score // Decrease/increase reduction by comparing opponent's stat score (~10 Elo)
if (ss->statScore >= 0 && (ss-1)->statScore < 0) if (ss->statScore >= 0 && (ss-1)->statScore < 0)
r -= ONE_PLY; r -= ONE_PLY;
else if ((ss-1)->statScore >= 0 && ss->statScore < 0) else if ((ss-1)->statScore >= 0 && ss->statScore < 0)
r += ONE_PLY; r += ONE_PLY;
// Decrease/increase reduction for moves with a good/bad history // Decrease/increase reduction for moves with a good/bad history (~30 Elo)
r = std::max(DEPTH_ZERO, (r / ONE_PLY - ss->statScore / 20000) * ONE_PLY); r = std::max(DEPTH_ZERO, (r / ONE_PLY - ss->statScore / 20000) * ONE_PLY);
} }