Skip to content

Commit

Permalink
Adjust best value after a pruned quiet move
Browse files Browse the repository at this point in the history
Logic somewhat similar to how we adjust best value after pruned captures
in qsearch, but in search this patch does it after pruned quiet moves
and also to not full scale of futility value but to smth in between
best value and futility value.

Passed STC:
https://tests.stockfishchess.org/tests/view/6601cf900ec64f0526c55c30
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 59936 W: 15722 L: 15369 D: 28845
Ptnml(0-2): 182, 7097, 15112, 7340, 237

Passed LTC:
https://tests.stockfishchess.org/tests/view/66029b2d0ec64f0526c566f1
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 118362 W: 29953 L: 29460 D: 58949
Ptnml(0-2): 68, 13159, 32249, 13622, 83

closes #5141

bench 1772608
  • Loading branch information
Vizvezdenec authored and vondele committed Mar 29, 2024
1 parent e636f73 commit 0ef5d05
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,12 +995,17 @@ Value Search::Worker::search(

lmrDepth += history / 5637;

Value futilityValue =
ss->staticEval + (bestValue < ss->staticEval - 59 ? 141 : 58) + 125 * lmrDepth;

// Futility pruning: parent node (~13 Elo)
if (!ss->inCheck && lmrDepth < 15
&& ss->staticEval + (bestValue < ss->staticEval - 59 ? 141 : 58)
+ 125 * lmrDepth
<= alpha)
if (!ss->inCheck && lmrDepth < 15 && futilityValue <= alpha)
{
if (bestValue <= futilityValue && abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY
&& futilityValue < VALUE_TB_WIN_IN_MAX_PLY)
bestValue = (bestValue + futilityValue * 3) / 4;
continue;
}

lmrDepth = std::max(lmrDepth, 0);

Expand Down

0 comments on commit 0ef5d05

Please sign in to comment.