]> git.sesse.net Git - stockfish/commitdiff
Simplification: remove pawn shelter/storm masks
authorprotonspring <mike@whiteley.org>
Tue, 27 Mar 2018 15:29:56 +0000 (17:29 +0200)
committerStéphane Nicolet <cassio@free.fr>
Tue, 27 Mar 2018 15:30:52 +0000 (17:30 +0200)
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

index 56f5d7239594b391e13ddd6b3edd80432632297f..24abec0c4f20cc09c9d1a72d403b10c0fba824f2 100644 (file)
@@ -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<Color Us>
 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;
 }