X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=4c69a0522f90310e2eeb4fcf1d70197cab8954a9;hp=5d753e8ea7be3281332731b0617ecde637c266ee;hb=3f14ed6602936ecf98b0a26c5abc1c980a091f63;hpb=14df99130f53a2a5f57260eb830b4c0029bd4e99;ds=sidebyside diff --git a/src/search.cpp b/src/search.cpp index 5d753e8e..4c69a052 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -948,6 +948,9 @@ split_point_start: // At split points actual search starts from here { lock_grab(&(sp->lock)); bestValue = sp->bestValue; + moveCount = sp->moveCount; + + assert(bestValue > -VALUE_INFINITE && moveCount > 0); } // Step 11. Loop through moves @@ -1065,13 +1068,7 @@ split_point_start: // At split points actual search starts from here if (futilityValue < beta) { if (SpNode) - { lock_grab(&(sp->lock)); - if (futilityValue > sp->bestValue) - sp->bestValue = bestValue = futilityValue; - } - else if (futilityValue > bestValue) - bestValue = futilityValue; continue; } @@ -1220,9 +1217,17 @@ split_point_start: // At split points actual search starts from here // case of StopRequest or thread.cutoff_occurred() are set, but this is // harmless because return value is discarded anyhow in the parent nodes. // If we are in a singular extension search then return a fail low score. - if (!SpNode && !moveCount) + if (!moveCount) return excludedMove ? oldAlpha : inCheck ? value_mated_in(ss->ply) : VALUE_DRAW; + // We have pruned all the moves, so return a fail-low score + if (bestValue == -VALUE_INFINITE) + { + assert(!playedMoveCount); + + bestValue = alpha; + } + // Step 21. Update tables // If the search is not aborted, update the transposition table, // history counters, and killer moves.