From: Fabian Fichter Date: Mon, 7 Dec 2020 21:01:51 +0000 (+0100) Subject: Simplify gating SEE X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=eccfbdc8e66c5207d383eb10e159aeb5fdc606a0;p=fairystockfish.git Simplify gating SEE 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 --- diff --git a/src/position.cpp b/src/position.cpp index 9be8bcf..13b9ac1 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1881,7 +1881,7 @@ bool Position::see_ge(Move m, Value threshold) const { && count(~sideToMove) == extinction_piece_count() + 1))) return extinction_value() < VALUE_ZERO; - if (must_capture() || !checking_permitted() || count() == count()) + if (must_capture() || !checking_permitted() || is_gating(m) || count() == count()) 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);