Skip to content

Commit

Permalink
Simplify the depth-dependent part of the best value adjustment formul…
Browse files Browse the repository at this point in the history
…a in main search

Passed STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 139648 W: 36171 L: 36061 D: 67416
Ptnml(0-2): 545, 16685, 35282, 16739, 573
https://tests.stockfishchess.org/tests/view/660d953b8ff4a059828d625d

Passed LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 222894 W: 56519 L: 56505 D: 109870
Ptnml(0-2): 112, 25145, 60971, 25055, 164
https://tests.stockfishchess.org/tests/view/660fd4afbfeb43334bf7d558

closes #5164

bench: 1479416
  • Loading branch information
FauziAkram authored and vondele committed Apr 11, 2024
1 parent d6bdcec commit 249eec6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ Value Search::Worker::search(

assert(0 <= ss->ply && ss->ply < MAX_PLY);

bestMove = Move::none();
bestMove = Move::none();
(ss + 2)->killers[0] = (ss + 2)->killers[1] = Move::none();
(ss + 2)->cutoffCnt = 0;
ss->multipleExtensions = (ss - 1)->multipleExtensions;
Expand Down Expand Up @@ -1307,7 +1307,7 @@ Value Search::Worker::search(
// Adjust best value for fail high cases at non-pv nodes
if (!PvNode && bestValue >= beta && std::abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY
&& std::abs(beta) < VALUE_TB_WIN_IN_MAX_PLY && std::abs(alpha) < VALUE_TB_WIN_IN_MAX_PLY)
bestValue = (bestValue * (depth + 2) + beta) / (depth + 3);
bestValue = (bestValue * depth + beta) / (depth + 1);

if (!moveCount)
bestValue = excludedMove ? alpha : ss->inCheck ? mated_in(ss->ply) : VALUE_DRAW;
Expand Down

0 comments on commit 249eec6

Please sign in to comment.