Skip to content

Commit

Permalink
Refactor ttPv reduction conditions
Browse files Browse the repository at this point in the history
closes #4999

No functional change
  • Loading branch information
Viren6 authored and Disservin committed Jan 21, 2024
1 parent 856e60d commit aa15a91
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/search.cpp
Expand Up @@ -1148,25 +1148,24 @@ Value Search::Worker::search(
thisThread->nodes.fetch_add(1, std::memory_order_relaxed);
pos.do_move(move, st, givesCheck);

// Decrease reduction if position is or has been on the PV (~7 Elo)
// Decrease reduction if position is or has been on the PV (~5 Elo)
if (ss->ttPv)
r -= !(tte->bound() == BOUND_UPPER && PvNode) + (cutNode && tte->depth() >= depth)
+ (ttValue > alpha) + (ttValue > beta && tte->depth() >= depth);
r -= 1 + (ttValue > alpha) + (ttValue > beta && tte->depth() >= depth);

// Decrease reduction if opponent's move count is high (~1 Elo)
if ((ss - 1)->moveCount > 7)
r--;

// Increase reduction for cut nodes (~3 Elo)
// Increase reduction for cut nodes (~4 Elo)
if (cutNode)
r += 2;
r += 2 - (tte->depth() >= depth && ss->ttPv);

// Increase reduction if ttMove is a capture (~3 Elo)
if (ttCapture)
r++;

// Decrease reduction for PvNodes (~2 Elo)
if (PvNode)
// Decrease reduction for PvNodes (~3 Elo)
if (PvNode && tte->bound() != BOUND_UPPER)
r--;

// Decrease reduction if a quiet ttMove has been singularly extended (~1 Elo)
Expand Down

0 comments on commit aa15a91

Please sign in to comment.