X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=5aeb9a87b71059e2097e5890bc5ea9ea19977862;hb=d9c7cad6302ddeff9f8a32a3fe66359c556a868e;hp=f1ab80f29294e20401fb93e9736b3b2b679668de;hpb=9763c69fa5683accd7e81786977be4b195370a7b;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index f1ab80f2..5aeb9a87 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -484,7 +484,6 @@ namespace { assert(PvNode || (alpha == beta - 1)); assert(depth > DEPTH_ZERO); - Move quietsSearched[64]; StateInfo st; const TTEntry *tte; SplitPoint* splitPoint; @@ -494,7 +493,7 @@ namespace { Value bestValue, value, ttValue, eval, nullValue, futilityValue; bool inCheck, givesCheck, pvMove, singularExtensionNode, improving; bool captureOrPromotion, dangerous, doFullDepthSearch; - int moveCount, quietCount; + int moveCount; // Step 1. Initialize node Thread* thisThread = pos.this_thread(); @@ -515,7 +514,7 @@ namespace { goto moves_loop; } - moveCount = quietCount = 0; + moveCount = 0; bestValue = -VALUE_INFINITE; ss->currentMove = threatMove = (ss+1)->excludedMove = bestMove = MOVE_NONE; ss->ply = (ss-1)->ply + 1; @@ -901,8 +900,6 @@ moves_loop: // When in check and at SpNode search starts from here pvMove = PvNode && moveCount == 1; ss->currentMove = move; - if (!SpNode && !captureOrPromotion && quietCount < 64) - quietsSearched[quietCount++] = move; // Step 14. Make the move pos.do_move(move, st, ci, givesCheck); @@ -1077,11 +1074,10 @@ moves_loop: // When in check and at SpNode search starts from here // played non-capture moves. Value bonus = Value(int(depth) * int(depth)); History.update(pos.moved_piece(bestMove), to_sq(bestMove), bonus); - for (int i = 0; i < quietCount - 1; ++i) - { - Move m = quietsSearched[i]; - History.update(pos.moved_piece(m), to_sq(m), -bonus); - } + + if (bestMove != ttMove) + for (const ExtMove* em = mp.stage_moves(); em->move != bestMove; ++em) + History.update(pos.moved_piece(em->move), to_sq(em->move), -bonus); if (is_ok((ss-1)->currentMove)) Countermoves.update(pos.piece_on(prevMoveSq), prevMoveSq, bestMove);