X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=76653ff99bf5fed6963d13b88a47ea202c17f4a2;hp=1214cbdcbd2b02f32d7b132ef02cd5ce4f400264;hb=0e1ad3ad33c65be8cfb2702b3df5500ef9d2f87f;hpb=0fc9a01933ce33fda3732c1d5bbde5a8908d0019 diff --git a/src/search.cpp b/src/search.cpp index 1214cbdc..76653ff9 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -494,7 +494,7 @@ namespace { Move movesSearched[64]; StateInfo st; const TTEntry *tte; - SplitPoint* sp; + SplitPoint* splitPoint; Key posKey; Move ttMove, move, excludedMove, bestMove, threatMove; Depth ext, newDepth; @@ -511,15 +511,15 @@ namespace { if (SpNode) { - sp = ss->sp; - bestMove = sp->bestMove; - threatMove = sp->threatMove; - bestValue = sp->bestValue; + splitPoint = ss->splitPoint; + bestMove = splitPoint->bestMove; + threatMove = splitPoint->threatMove; + bestValue = splitPoint->bestValue; tte = NULL; ttMove = excludedMove = MOVE_NONE; ttValue = VALUE_NONE; - assert(sp->bestValue > -VALUE_INFINITE && sp->moveCount > 0); + assert(splitPoint->bestValue > -VALUE_INFINITE && splitPoint->moveCount > 0); goto split_point_start; } @@ -794,8 +794,8 @@ split_point_start: // At split points actual search starts from here if (!pos.pl_move_is_legal(move, ci.pinned)) continue; - moveCount = ++sp->moveCount; - sp->mutex.unlock(); + moveCount = ++splitPoint->moveCount; + splitPoint->mutex.unlock(); } else moveCount++; @@ -869,7 +869,7 @@ split_point_start: // At split points actual search starts from here && (!threatMove || !refutes(pos, move, threatMove))) { if (SpNode) - sp->mutex.lock(); + splitPoint->mutex.lock(); continue; } @@ -884,7 +884,7 @@ split_point_start: // At split points actual search starts from here if (!PvNode && futilityValue < beta) { if (SpNode) - sp->mutex.lock(); + splitPoint->mutex.lock(); continue; } @@ -894,7 +894,7 @@ split_point_start: // At split points actual search starts from here && pos.see_sign(move) < 0) { if (SpNode) - sp->mutex.lock(); + splitPoint->mutex.lock(); continue; } @@ -928,7 +928,7 @@ split_point_start: // At split points actual search starts from here ss->reduction = reduction(depth, moveCount); Depth d = std::max(newDepth - ss->reduction, ONE_PLY); if (SpNode) - alpha = sp->alpha; + alpha = splitPoint->alpha; value = -search(pos, ss+1, -(alpha+1), -alpha, d); @@ -942,7 +942,7 @@ split_point_start: // At split points actual search starts from here if (doFullDepthSearch) { if (SpNode) - alpha = sp->alpha; + alpha = splitPoint->alpha; value = newDepth < ONE_PLY ? givesCheck ? -qsearch(pos, ss+1, -(alpha+1), -alpha, DEPTH_ZERO) @@ -966,9 +966,9 @@ split_point_start: // At split points actual search starts from here // Step 18. Check for new best move if (SpNode) { - sp->mutex.lock(); - bestValue = sp->bestValue; - alpha = sp->alpha; + splitPoint->mutex.lock(); + bestValue = splitPoint->bestValue; + alpha = splitPoint->alpha; } // Finished searching the move. If Signals.stop is true, the search @@ -1003,20 +1003,20 @@ split_point_start: // At split points actual search starts from here if (value > bestValue) { - bestValue = SpNode ? sp->bestValue = value : value; + bestValue = SpNode ? splitPoint->bestValue = value : value; if (value > alpha) { - bestMove = SpNode ? sp->bestMove = move : move; + bestMove = SpNode ? splitPoint->bestMove = move : move; if (PvNode && value < beta) // Update alpha! Always alpha < beta - alpha = SpNode ? sp->alpha = value : value; + alpha = SpNode ? splitPoint->alpha = value : value; else { assert(value >= beta); // Fail high if (SpNode) - sp->cutoff = true; + splitPoint->cutoff = true; break; } @@ -1669,7 +1669,7 @@ void Thread::idle_loop() { Position pos(*sp->pos, this); memcpy(ss, sp->ss - 1, 4 * sizeof(Stack)); - (ss+1)->sp = sp; + (ss+1)->splitPoint = sp; sp->mutex.lock();