1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Refactor ttPv reduction conditions

closes https://github.com/official-stockfish/Stockfish/pull/4999

No functional change
This commit is contained in:
Viren6 2024-01-19 04:51:02 +00:00 committed by Disservin
parent 856e60d12f
commit aa15a9179b

View file

@ -1148,25 +1148,24 @@ moves_loop: // When in check, search starts here
thisThread->nodes.fetch_add(1, std::memory_order_relaxed); thisThread->nodes.fetch_add(1, std::memory_order_relaxed);
pos.do_move(move, st, givesCheck); 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) if (ss->ttPv)
r -= !(tte->bound() == BOUND_UPPER && PvNode) + (cutNode && tte->depth() >= depth) r -= 1 + (ttValue > alpha) + (ttValue > beta && tte->depth() >= depth);
+ (ttValue > alpha) + (ttValue > beta && tte->depth() >= depth);
// Decrease reduction if opponent's move count is high (~1 Elo) // Decrease reduction if opponent's move count is high (~1 Elo)
if ((ss - 1)->moveCount > 7) if ((ss - 1)->moveCount > 7)
r--; r--;
// Increase reduction for cut nodes (~3 Elo) // Increase reduction for cut nodes (~4 Elo)
if (cutNode) if (cutNode)
r += 2; r += 2 - (tte->depth() >= depth && ss->ttPv);
// Increase reduction if ttMove is a capture (~3 Elo) // Increase reduction if ttMove is a capture (~3 Elo)
if (ttCapture) if (ttCapture)
r++; r++;
// Decrease reduction for PvNodes (~2 Elo) // Decrease reduction for PvNodes (~3 Elo)
if (PvNode) if (PvNode && tte->bound() != BOUND_UPPER)
r--; r--;
// Decrease reduction if a quiet ttMove has been singularly extended (~1 Elo) // Decrease reduction if a quiet ttMove has been singularly extended (~1 Elo)