X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=50f3a01b5c2bdf54c97ab935c4f134aee67bf95e;hp=43193f1059540e0a92e4895e78b313044ced29f8;hb=b88374b14a7baa2f8e4c37b16a2e653e7472adcc;hpb=e408fd7b10503a9114962cb5972abd9957bc67c2 diff --git a/src/search.cpp b/src/search.cpp index 43193f10..50f3a01b 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -521,7 +521,7 @@ namespace { Move ttMove, move, excludedMove, bestMove; Depth extension, newDepth; Value bestValue, value, ttValue, eval, maxValue; - bool ttHit, inCheck, givesCheck, singularExtensionNode, improving; + bool ttHit, inCheck, givesCheck, improving; bool captureOrPromotion, doFullDepthSearch, moveCountPruning, skipQuiets, ttCapture, pvExact; Piece movedPiece; int moveCount, captureCount, quietCount; @@ -820,13 +820,6 @@ moves_loop: // When in check, search starts from here MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory, &thisThread->captureHistory, contHist, countermove, ss->killers); value = bestValue; // Workaround a bogus 'uninitialized' warning under gcc - singularExtensionNode = !rootNode - && depth >= 8 * ONE_PLY - && ttMove != MOVE_NONE - && ttValue != VALUE_NONE - && !excludedMove // Recursive singular search is not allowed - && (tte->bound() & BOUND_LOWER) - && tte->depth() >= depth - 3 * ONE_PLY; skipQuiets = false; ttCapture = false; pvExact = PvNode && ttHit && tte->bound() == BOUND_EXACT; @@ -866,13 +859,18 @@ moves_loop: // When in check, search starts from here // Step 13. Extensions (~70 Elo) - // Singular extension search (~60 Elo). If all moves but one fail low on a search - // of (alpha-s, beta-s), and just one fails high on (alpha, beta), then - // that move is singular and should be extended. To verify this we do a - // reduced search on on all the other moves but the ttMove and if the + // Singular extension search (~60 Elo). If all moves but one fail low on a + // search of (alpha-s, beta-s), and just one fails high on (alpha, beta), + // then that move is singular and should be extended. To verify this we do + // a reduced search on on all the other moves but the ttMove and if the // result is lower than ttValue minus a margin then we will extend the ttMove. - if ( singularExtensionNode + if ( depth >= 8 * ONE_PLY && move == ttMove + && !rootNode + && !excludedMove // Recursive singular search is not allowed + && ttValue != VALUE_NONE + && (tte->bound() & BOUND_LOWER) + && tte->depth() >= depth - 3 * ONE_PLY && pos.legal(move)) { Value rBeta = std::max(ttValue - 2 * depth / ONE_PLY, -VALUE_MATE); @@ -1087,6 +1085,7 @@ moves_loop: // When in check, search starts from here else { assert(value >= beta); // Fail high + ss->statScore = std::max(ss->statScore, 0); break; } }