X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=d419cd30ede15e192142b040de9caf14d8b8005c;hb=ee0371f86e319aa24bc1d32f02d9495eea79aa72;hp=9c7190bed0cacb99e7d813df7196e205cb23bac8;hpb=946fa4762539307dcdcb30d08f13d627864e9bcf;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 9c7190be..d419cd30 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -181,6 +181,18 @@ void Search::init() { } +/// Search::reset() clears all search memory, to obtain reproducible search results + +void Search::reset () { + + TT.clear(); + History.clear(); + CounterMovesHistory.clear(); + Gains.clear(); + Countermoves.clear(); +} + + /// Search::perft() is our utility to verify move generation. All the leaf nodes /// up to the given depth are generated and counted and the sum returned. template @@ -846,7 +858,7 @@ moves_loop: // When in check and at SpNode search starts from here captureOrPromotion = pos.capture_or_promotion(move); givesCheck = type_of(move) == NORMAL && !ci.dcCandidates - ? ci.checkSq[type_of(pos.piece_on(from_sq(move)))] & to_sq(move) + ? ci.checkSquares[type_of(pos.piece_on(from_sq(move)))] & to_sq(move) : pos.gives_check(move, ci); dangerous = givesCheck @@ -1269,7 +1281,7 @@ moves_loop: // When in check and at SpNode search starts from here assert(is_ok(move)); givesCheck = type_of(move) == NORMAL && !ci.dcCandidates - ? ci.checkSq[type_of(pos.piece_on(from_sq(move)))] & to_sq(move) + ? ci.checkSquares[type_of(pos.piece_on(from_sq(move)))] & to_sq(move) : pos.gives_check(move, ci); // Futility pruning