Simplify clobber-specific code
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 18 Jun 2020 20:40:50 +0000 (22:40 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 18 Jun 2020 20:40:50 +0000 (22:40 +0200)
src/position.cpp
src/search.cpp

index 9a5b739..d6a2daf 100644 (file)
@@ -1700,7 +1700,7 @@ bool Position::see_ge(Move m, Value threshold) const {
               && count<ALL_PIECES>(~sideToMove) == extinction_piece_count() + 1)))
       return extinction_value() < VALUE_ZERO;
 
-  if (must_capture())
+  if (must_capture() || count<CLOBBER_PIECE>() == count<ALL_PIECES>())
       return VALUE_ZERO >= threshold;
 
   int swap = PieceValue[MG][piece_on(to)] - threshold;
index c827aab..d303c4d 100644 (file)
@@ -965,7 +965,6 @@ namespace {
     // much above beta, we can (almost) safely prune the previous move.
     if (   !PvNode
         &&  depth >= 5
-        &&  (pos.pieces() ^ pos.pieces(CLOBBER_PIECE))
         &&  abs(beta) < VALUE_TB_WIN_IN_MAX_PLY)
     {
         Value raisedBeta = std::min(beta + (189 + 20 * !!pos.capture_the_flag_piece()) * (1 + pos.check_counting() + (pos.extinction_value() != VALUE_NONE)) - 45 * improving, VALUE_INFINITE);
@@ -1560,10 +1559,6 @@ moves_loop: // When in check, search starts from here
 
       moveCount++;
 
-      // Avoid qsearch explosion for clobber
-      if (type_of(pos.moved_piece(move)) == CLOBBER_PIECE && bestValue > VALUE_MATED_IN_MAX_PLY)
-          continue;
-
       // Futility pruning
       if (   !inCheck
           && !givesCheck