From a4eda3056ef7f6f69ae15925255621cb32443de9 Mon Sep 17 00:00:00 2001 From: Stefan Geschwentner Date: Thu, 26 Jul 2018 01:28:37 +0200 Subject: [PATCH] Rank threats on pinned pawns Add for pinned pawns half of the standard rank based threat bonus. STC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 44010 W: 9987 L: 9635 D: 24388 http://tests.stockfishchess.org/tests/view/5b58aa780ebc5902bdb88c7a LTC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 29475 W: 5089 L: 4847 D: 19539 http://tests.stockfishchess.org/tests/view/5b58b56c0ebc5902bdb88f37 Closes https://github.com/official-stockfish/Stockfish/pull/1701 Bench: 4503866 --- src/evaluate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 7309f9f3..ac9cf90b 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -540,6 +540,9 @@ namespace { score += ThreatByMinor[type_of(pos.piece_on(s))]; if (type_of(pos.piece_on(s)) != PAWN) score += ThreatByRank * (int)relative_rank(Them, s); + + else if (pos.blockers_for_king(Them) & s) + score += ThreatByRank * (int)relative_rank(Them, s) / 2; } b = weak & attackedBy[Us][ROOK]; @@ -549,6 +552,9 @@ namespace { score += ThreatByRook[type_of(pos.piece_on(s))]; if (type_of(pos.piece_on(s)) != PAWN) score += ThreatByRank * (int)relative_rank(Them, s); + + else if (pos.blockers_for_king(Them) & s) + score += ThreatByRank * (int)relative_rank(Them, s) / 2; } if (weak & attackedBy[Us][KING]) -- 2.39.2