Skip to content

Commit

Permalink
Merge pull request official-stockfish#522 from IIvec/master
Browse files Browse the repository at this point in the history
New master
  • Loading branch information
IIvec authored Sep 30, 2017
2 parents e788377 + 07b5a28 commit 0295b37
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,6 @@ void MainThread::search() {
Thread::search(); // Let's start searching!
}

// When playing in 'nodes as time' mode, subtract the searched nodes from
// the available ones before exiting.
if (Limits.npmsec)
Time.availableNodes += Limits.inc[us] - Threads.nodes_searched();

// When we reach the maximum depth, we can arrive here without a raise of
// Threads.stop. However, if we are pondering or in an infinite search,
// the UCI protocol states that we shouldn't print the best move before the
Expand All @@ -284,6 +279,11 @@ void MainThread::search() {
if (th != this)
th->wait_for_search_finished();

// When playing in 'nodes as time' mode, subtract the searched nodes from
// the available ones before exiting.
if (Limits.npmsec)
Time.availableNodes += Limits.inc[us] - Threads.nodes_searched();

// Check if there are threads with a better score than main thread
Thread* bestThread = this;
if ( !this->easyMovePlayed
Expand Down Expand Up @@ -544,7 +544,7 @@ namespace {
Depth extension, newDepth;
Value bestValue, value, ttValue, eval;
bool ttHit, inCheck, givesCheck, singularExtensionNode, improving;
bool captureOrPromotion, doFullDepthSearch, moveCountPruning, skipQuiets, ttCapture;
bool captureOrPromotion, doFullDepthSearch, moveCountPruning, skipQuiets, ttCapture, pvExact;
Piece movedPiece;
int moveCount, quietCount;

Expand Down Expand Up @@ -829,6 +829,7 @@ namespace {
&& tte->depth() >= depth - 3 * ONE_PLY;
skipQuiets = false;
ttCapture = false;
pvExact = PvNode && ttHit && tte->bound() == BOUND_EXACT;

// Step 11. Loop through moves
// Loop through all pseudo-legal moves until no moves remain or a beta cutoff occurs
Expand Down Expand Up @@ -975,6 +976,10 @@ namespace {
if ((ss-1)->moveCount > 15)
r -= ONE_PLY;

// Decrease reduction for exact PV nodes
if (pvExact)
r -= ONE_PLY;

// Increase reduction if ttMove is a capture
if (ttCapture)
r += ONE_PLY;
Expand Down

0 comments on commit 0295b37

Please sign in to comment.