X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.cpp;h=638f81757d2af94d72c9b0c6739ab1d191d2c6f5;hp=16eb16348c1791f2761f36c8f2d96d1ce039c35d;hb=5b1043ee11489a1ad732847ee93ddb3fc5905726;hpb=bb968fd42a6e3c14755332f5a4c4829faaf4f9de diff --git a/src/movepick.cpp b/src/movepick.cpp index 16eb1634..638f8175 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -94,8 +94,16 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, else if (d == Depth(0)) phasePtr = QsearchWithChecksPhaseTable; else + { phasePtr = QsearchWithoutChecksPhaseTable; + // Skip TT move if is not a capture or a promotion, this avoids + // qsearch tree explosion due to a possible perpetual check or + // similar rare cases when TT table is full. + if (ttm != MOVE_NONE && !pos.move_is_capture_or_promotion(ttm)) + searchTT = ttMoves[0].move = MOVE_NONE; + } + phasePtr += !searchTT - 1; go_next_phase(); }