Skip to content

Commit

Permalink
Simplify away best move count logic
Browse files Browse the repository at this point in the history
the only place where it was used it was true with >99% probability so it seemed to not be doing much any more.

Passed STC:
https://tests.stockfishchess.org/tests/view/625f4778d00da81c22dd4c93
LLR: 2.95 (-2.94,2.94) <-2.25,0.25>
Total: 85152 W: 22487 L: 22406 D: 40259
Ptnml(0-2): 313, 9035, 23818, 9078, 332

Passed LTC:
https://tests.stockfishchess.org/tests/view/625ff1f1b03f22647441a215
LLR: 2.94 (-2.94,2.94) <-2.25,0.25>
Total: 66776 W: 17768 L: 17673 D: 31335
Ptnml(0-2): 46, 6200, 20792, 6313, 37

close official-stockfish#3993

bench 7280798
  • Loading branch information
Vizvezdenec authored and Joachim26 committed Dec 2, 2023
1 parent 9e88994 commit 4941483
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,15 +626,15 @@ namespace {
bool givesCheck, improving, didLMR, priorCapture;
bool capture, doFullDepthSearch, moveCountPruning, ttCapture;
Piece movedPiece;
int moveCount, captureCount, quietCount, bestMoveCount, improvement, complexity;
int moveCount, captureCount, quietCount, improvement, complexity;

// Step 1. Initialize node
Thread* thisThread = pos.this_thread();
thisThread->depth = depth;
ss->inCheck = pos.checkers();
priorCapture = pos.captured_piece();
Color us = pos.side_to_move();
moveCount = bestMoveCount = captureCount = quietCount = ss->moveCount = 0;
moveCount = captureCount = quietCount = ss->moveCount = 0;
bestValue = -VALUE_INFINITE;
maxValue = VALUE_INFINITE;

Expand Down Expand Up @@ -1215,11 +1215,6 @@ namespace {
{
Depth r = reduction(improving, depth, moveCount, delta, thisThread->rootDelta);

// Decrease reduction at some PvNodes (~2 Elo)
if ( PvNode
&& bestMoveCount <= 3)
r--;

// Decrease reduction if position is or has been on the PV
// and node is not likely to fail low. (~3 Elo)
if ( ss->ttPv
Expand All @@ -1243,9 +1238,9 @@ namespace {
if (PvNode && !ss->inCheck && abs(ss->staticEval - bestValue) > 250)
r--;

// Increase depth based reduction if PvNode
// Decrease reduction for PvNodes based on depth
if (PvNode)
r -= 15 / ( 3 + depth );
r -= 1 + 15 / ( 3 + depth );

ss->statScore = thisThread->mainHistory[us][from_to(move)]
+ (*contHist[0])[movedPiece][to_sq(move)]
Expand Down Expand Up @@ -1367,10 +1362,7 @@ namespace {
update_pv(ss->pv, move, (ss+1)->pv);

if (PvNode && value < beta) // Update alpha! Always alpha < beta
{
alpha = value;
bestMoveCount++;
}
else
{
assert(value >= beta); // Fail high
Expand Down

0 comments on commit 4941483

Please sign in to comment.