]> git.sesse.net Git - stockfish/commitdiff
Retire pawn span
authorStefano80 <stefano.cardanobile@gmail.com>
Mon, 15 Aug 2016 10:24:48 +0000 (12:24 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 18 Aug 2016 08:16:56 +0000 (10:16 +0200)
Retire pawn span and replace with pawn count in evaluate_scale_factor.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 26482 W: 4929 L: 4818 D: 16735

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 61938 W: 8400 L: 8335 D: 45203

Bench: 7662861

src/evaluate.cpp
src/pawns.cpp
src/pawns.h

index d3ddfd510bad2e51a92ce991386bbcb135de2738..664847adcf091686569ed58583f2fa2e50bc8f21 100644 (file)
@@ -758,9 +758,9 @@ namespace {
         // Endings where weaker side can place his king in front of the opponent's
         // pawns are drawish.
         else if (    abs(eg) <= BishopValueEg
-                 &&  ei.pi->pawn_span(strongSide) <= 1
+                 &&  pos.count<PAWN>(strongSide) <= 2
                  && !pos.pawn_passed(~strongSide, pos.square<KING>(~strongSide)))
-            sf = ei.pi->pawn_span(strongSide) ? ScaleFactor(51) : ScaleFactor(37);
+            sf = ScaleFactor(37 + 7 * pos.count<PAWN>(strongSide));
     }
 
     return sf;
index 23d00bdecd5eb6206f11e20a31b768342481f02d..41127d1f4a57e64192869876f9cc55edc8dce5c6 100644 (file)
@@ -173,8 +173,6 @@ namespace {
     }
 
     b = e->semiopenFiles[Us] ^ 0xFF;
-    e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0;
-
     return score;
   }
 
index c2f5fc0d34ba51138df1d575b7eacddfcf712edd..24843e30618074dd8cf1f990dc834ff6ab17e86b 100644 (file)
@@ -37,7 +37,6 @@ struct Entry {
   Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
   Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
   Bitboard pawn_attacks_span(Color c) const { return pawnAttacksSpan[c]; }
-  int pawn_span(Color c) const { return pawnSpan[c]; }
   int pawn_asymmetry() const { return asymmetry; }
 
   int semiopen_file(Color c, File f) const {
@@ -73,7 +72,6 @@ struct Entry {
   Score kingSafety[COLOR_NB];
   int castlingRights[COLOR_NB];
   int semiopenFiles[COLOR_NB];
-  int pawnSpan[COLOR_NB];
   int pawnsOnSquares[COLOR_NB][COLOR_NB]; // [color][light/dark squares]
   int asymmetry;
 };