Skip to content

Commit

Permalink
Refactor reduction rules
Browse files Browse the repository at this point in the history
Refactor reduction rules so that all ttPv/Pv related stuff is in one
rule and the scaling becomes more clear. No functional change

closes #5871

No functional change
  • Loading branch information
locutus2 authored and Disservin committed Feb 13, 2025
1 parent 3a0418c commit 7258567
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,10 +1158,8 @@ Value Search::Worker::search(

// Decrease reduction for PvNodes (*Scaler)
if (ss->ttPv)
r -= 2230 + (ttData.value > alpha) * 925 + (ttData.depth >= depth) * 971;

if (PvNode)
r -= 1013;
r -= 2230 + PvNode * 1013 + (ttData.value > alpha) * 925
+ (ttData.depth >= depth) * (971 + cutNode * 1159);

// These reduction adjustments have no proven non-linear scaling

Expand All @@ -1171,7 +1169,7 @@ Value Search::Worker::search(

// Increase reduction for cut nodes
if (cutNode)
r += 2608 - (ttData.depth >= depth && ss->ttPv) * 1159;
r += 2608;

// Increase reduction if ttMove is a capture but the current move is not a capture
if (ttCapture && !capture)
Expand Down

0 comments on commit 7258567

Please sign in to comment.