mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
Reduce more if multiple moves exceed alpha
Idea of this patch is the following: in case we already have four moves that exceeded alpha in the current node, the probability of finding fifth should be reasonably low. Note that four is completely arbitrary - there could and probably should be some tweaks, both in tweaking best move count threshold for more reductions and tweaking how they work - for example making more reductions with best move count linearly. passed STC: https://tests.stockfishchess.org/tests/view/615f614783dd501a05b0aee2 LLR: 2.94 (-2.94,2.94) <-0.50,2.50> Total: 141816 W: 36056 L: 35686 D: 70074 Ptnml(0-2): 499, 15131, 39273, 15511, 494 passed LTC: https://tests.stockfishchess.org/tests/view/615fdff683dd501a05b0af35 LLR: 2.94 (-2.94,2.94) <0.50,3.50> Total: 68536 W: 17221 L: 16891 D: 34424 Ptnml(0-2): 38, 6573, 20725, 6885, 47 closes https://github.com/official-stockfish/Stockfish/pull/3736 Bench: 6131513
This commit is contained in:
parent
f21a66f70d
commit
c8459b18ba
1 changed files with 8 additions and 4 deletions
|
@ -591,13 +591,13 @@ namespace {
|
||||||
bool captureOrPromotion, doFullDepthSearch, moveCountPruning,
|
bool captureOrPromotion, doFullDepthSearch, moveCountPruning,
|
||||||
ttCapture, singularQuietLMR, noLMRExtension;
|
ttCapture, singularQuietLMR, noLMRExtension;
|
||||||
Piece movedPiece;
|
Piece movedPiece;
|
||||||
int moveCount, captureCount, quietCount;
|
int moveCount, captureCount, quietCount, bestMoveCount;
|
||||||
|
|
||||||
// Step 1. Initialize node
|
// Step 1. Initialize node
|
||||||
ss->inCheck = pos.checkers();
|
ss->inCheck = pos.checkers();
|
||||||
priorCapture = pos.captured_piece();
|
priorCapture = pos.captured_piece();
|
||||||
Color us = pos.side_to_move();
|
Color us = pos.side_to_move();
|
||||||
moveCount = captureCount = quietCount = ss->moveCount = 0;
|
moveCount = bestMoveCount = captureCount = quietCount = ss->moveCount = 0;
|
||||||
bestValue = -VALUE_INFINITE;
|
bestValue = -VALUE_INFINITE;
|
||||||
maxValue = VALUE_INFINITE;
|
maxValue = VALUE_INFINITE;
|
||||||
|
|
||||||
|
@ -1186,8 +1186,9 @@ moves_loop: // When in check, search starts here
|
||||||
{
|
{
|
||||||
Depth r = reduction(improving, depth, moveCount, rangeReduction > 2);
|
Depth r = reduction(improving, depth, moveCount, rangeReduction > 2);
|
||||||
|
|
||||||
// Decrease reduction if on the PV (~1 Elo)
|
// Decrease reduction if on the PV (~2 Elo)
|
||||||
if (PvNode)
|
if ( PvNode
|
||||||
|
&& bestMoveCount <= 3)
|
||||||
r--;
|
r--;
|
||||||
|
|
||||||
// Decrease reduction if the ttHit running average is large (~0 Elo)
|
// Decrease reduction if the ttHit running average is large (~0 Elo)
|
||||||
|
@ -1340,7 +1341,10 @@ moves_loop: // When in check, search starts here
|
||||||
update_pv(ss->pv, move, (ss+1)->pv);
|
update_pv(ss->pv, move, (ss+1)->pv);
|
||||||
|
|
||||||
if (PvNode && value < beta) // Update alpha! Always alpha < beta
|
if (PvNode && value < beta) // Update alpha! Always alpha < beta
|
||||||
|
{
|
||||||
alpha = value;
|
alpha = value;
|
||||||
|
bestMoveCount++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(value >= beta); // Fail high
|
assert(value >= beta); // Fail high
|
||||||
|
|
Loading…
Add table
Reference in a new issue