Simplify gating SEE
authorFabian Fichter <ianfab@users.noreply.github.com>
Mon, 7 Dec 2020 21:01:51 +0000 (22:01 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Tue, 8 Dec 2020 16:43:58 +0000 (17:43 +0100)
seirawan STC
LLR: 2.99 (-2.94,2.94) [-10.00,5.00]
Total: 830 W: 327 L: 278 D: 225
http://www.variantfishtest.org:6543/tests/view/5fce987d6e23db221d9e949d

seirawan LTC
LLR: 2.99 (-2.94,2.94) [-10.00,5.00]
Total: 817 W: 287 L: 241 D: 289
http://www.variantfishtest.org:6543/tests/view/5fce9faa6e23db221d9e94a0

src/position.cpp

index 9be8bcf..13b9ac1 100644 (file)
@@ -1881,7 +1881,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() || !checking_permitted() || count<CLOBBER_PIECE>() == count<ALL_PIECES>())
+  if (must_capture() || !checking_permitted() || is_gating(m) || count<CLOBBER_PIECE>() == count<ALL_PIECES>())
       return VALUE_ZERO >= threshold;
 
   int swap = PieceValue[MG][piece_on(to)] - threshold;
@@ -1990,7 +1990,7 @@ bool Position::see_ge(Move m, Value threshold) const {
       else // KING
            // If we "capture" with the king but opponent still has attackers,
            // reverse the result.
-          return (attackers & ~pieces(stm)) || (is_gating(m) && ~stm == sideToMove && (attacks_from(stm, gating_type(m), from) & to)) ? res ^ 1 : res;
+          return (attackers & ~pieces(stm)) ? res ^ 1 : res;
   }
 
   return bool(res);