Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify away best move count logic. #3993

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,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 @@ -1145,11 +1145,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 @@ -1173,9 +1168,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 @@ -1297,10 +1292,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