X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.cpp;h=9ff447beb6e0a873cc0b5252927175d0a476bb29;hb=9f5b31c21df72f60ab02417940ae573621ee7b90;hp=57a5517614e67c5f9f37febb857b9d2a0b3840d5;hpb=68d61b80c60a81055a2ffb2e251a237b979e9b31;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 57a55176..9ff447be 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -341,7 +341,7 @@ namespace { Move easyMove = EasyMove.get(pos.key()); EasyMove.clear(); - std::memset(ss-2, 0, 5 * sizeof(Stack)); + std::memset(stack, 0, 5 * sizeof(Stack)); depth = DEPTH_ZERO; BestMoveChanges = 0; @@ -531,7 +531,7 @@ namespace { Depth extension, newDepth, predictedDepth; Value bestValue, value, ttValue, eval, nullValue, futilityValue; bool ttHit, inCheck, givesCheck, singularExtensionNode, improving; - bool captureOrPromotion, dangerous, doFullDepthSearch; + bool captureOrPromotion, doFullDepthSearch; int moveCount, quietCount; // Step 1. Initialize node @@ -847,10 +847,6 @@ moves_loop: // When in check and at SpNode search starts from here ? ci.checkSquares[type_of(pos.piece_on(from_sq(move)))] & to_sq(move) : pos.gives_check(move, ci); - dangerous = givesCheck - || type_of(move) != NORMAL - || pos.advanced_pawn_push(move); - // Step 12. Extend checks if (givesCheck && pos.see_sign(move) >= VALUE_ZERO) extension = ONE_PLY; @@ -883,7 +879,8 @@ moves_loop: // When in check and at SpNode search starts from here if ( !RootNode && !captureOrPromotion && !inCheck - && !dangerous + && !givesCheck + && !pos.advanced_pawn_push(move) && bestValue > VALUE_MATED_IN_MAX_PLY) { // Move count based pruning @@ -1627,8 +1624,13 @@ void Thread::idle_loop() { assert(searching); + spinlock.acquire(); + searching = false; activePosition = nullptr; + + spinlock.release(); + sp->slavesMask.reset(idx); sp->allSlavesSearching = false; sp->nodes += pos.nodes_searched();