Consider gating pieces in SEE
authorFabian Fichter <ianfab@users.noreply.github.com>
Tue, 24 Nov 2020 22:32:59 +0000 (23:32 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Tue, 24 Nov 2020 22:32:59 +0000 (23:32 +0100)
Consider king captures as illegal if attacked by gating piece.

seirawan STC
LLR: -1.04 (-2.94,2.94) [0.00,10.00]
Total: 9842 W: 3420 L: 3320 D: 3102
http://www.variantfishtest.org:6543/tests/view/5fb8369c6e23db221d9e9400

seirawan LTC
LLR: 2.96 (-2.94,2.94) [-10.00,5.00]
Total: 1483 W: 494 L: 453 D: 536
http://www.variantfishtest.org:6543/tests/view/5fb90fbf6e23db221d9e9407

Closes #210.

src/position.cpp

index a39fc60..815ed83 100644 (file)
@@ -1969,7 +1969,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)) ? res ^ 1 : res;
+          return (attackers & ~pieces(stm)) || (is_gating(m) && ~stm == sideToMove && (attacks_from(stm, gating_type(m), from) & to)) ? res ^ 1 : res;
   }
 
   return bool(res);