From 29070bd01a5a8e37658866ead1fbdeacc60ce9a6 Mon Sep 17 00:00:00 2001 From: protonspring Date: Tue, 27 Mar 2018 17:29:56 +0200 Subject: [PATCH 1/1] Simplification: remove pawn shelter/storm masks Encode the pawn shelter/storm masks into the danger score This highly specialized rule directly contradicts the VERY high danger score for blocked pawns. Reducing the danger score for blocked pawns and removing this rule is apparently an effective compromise. STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 36597 W: 7522 L: 7429 D: 21646 http://tests.stockfishchess.org/tests/view/5ab935f30ebc5902932cc016 LTC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 100690 W: 15373 L: 15372 D: 69945 http://tests.stockfishchess.org/tests/view/5ab9501f0ebc5902932cc042 Closes https://github.com/official-stockfish/Stockfish/pull/1514 Bench: 5980822 --- src/pawns.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/pawns.cpp b/src/pawns.cpp index 56f5d723..24abec0c 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -68,10 +68,10 @@ namespace { { V( 1), V( 64), V( 143), V(26), V(13) }, { V( 1), V( 47), V( 110), V(44), V(24) }, { V( 0), V( 72), V( 127), V(50), V(31) } }, - { { V( 0), V( 0), V( 79), V(23), V( 1) }, // BlockedByPawn - { V( 0), V( 0), V( 148), V(27), V( 2) }, - { V( 0), V( 0), V( 161), V(16), V( 1) }, - { V( 0), V( 0), V( 171), V(22), V(15) } }, + { { V( 0), V( 0), V( 19), V(23), V( 1) }, // BlockedByPawn + { V( 0), V( 0), V( 88), V(27), V( 2) }, + { V( 0), V( 0), V( 101), V(16), V( 1) }, + { V( 0), V( 0), V( 111), V(22), V(15) } }, { { V(22), V( 45), V( 104), V(62), V( 6) }, // Unblocked { V(31), V( 30), V( 99), V(39), V(19) }, { V(23), V( 29), V( 96), V(41), V(15) }, @@ -237,12 +237,6 @@ template Value Entry::shelter_storm(const Position& pos, Square ksq) { constexpr Color Them = (Us == WHITE ? BLACK : WHITE); - constexpr Bitboard ShelterMask = - Us == WHITE ? make_bitboard(SQ_A2, SQ_B3, SQ_C2, SQ_F2, SQ_G3, SQ_H2) - : make_bitboard(SQ_A7, SQ_B6, SQ_C7, SQ_F7, SQ_G6, SQ_H7); - constexpr Bitboard StormMask = - Us == WHITE ? make_bitboard(SQ_A3, SQ_C3, SQ_F3, SQ_H3) - : make_bitboard(SQ_A6, SQ_C6, SQ_F6, SQ_H6); enum { BlockedByKing, Unopposed, BlockedByPawn, Unblocked }; @@ -271,9 +265,6 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) { [d][rkThem]; } - if (popcount((ourPawns & ShelterMask) | (theirPawns & StormMask)) == 5) - safety += Value(300); - return safety; } -- 2.39.2