]> git.sesse.net Git - stockfish/commitdiff
Remove KRPPKRPScaleFactors array
authorprotonspring <mike@whiteley.org>
Wed, 4 Mar 2020 18:32:17 +0000 (11:32 -0700)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 7 Mar 2020 10:09:38 +0000 (11:09 +0100)
Fucntional simplification that removes the KRPPKRPScaleFactors array.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 47374 W: 9159 L: 9049 D: 29166
Ptnml(0-2): 707, 5325, 11560, 5341, 754
http://tests.stockfishchess.org/tests/view/5e5ff464e42a5c3b3ca2e156

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 31268 W: 4064 L: 3995 D: 23209
Ptnml(0-2): 173, 2734, 9764, 2777, 186
http://tests.stockfishchess.org/tests/view/5e61be6ce42a5c3b3ca2e1c1

closes https://github.com/official-stockfish/Stockfish/pull/2575

Bench 5123316

src/endgame.cpp

index 748b05ffdd840c20275b3f0984ca684fdd64d9cd..53c9ec8364c4b6a010ff96fec56e1ebc6ac2a814 100644 (file)
@@ -58,9 +58,6 @@ namespace {
   inline int push_close(Square s1, Square s2) { return 140 - 20 * distance(s1, s2); }
   inline int push_away(Square s1, Square s2) { return 120 - push_close(s1, s2); }
 
   inline int push_close(Square s1, Square s2) { return 140 - 20 * distance(s1, s2); }
   inline int push_away(Square s1, Square s2) { return 120 - push_close(s1, s2); }
 
-  // Pawn Rank based scaling factors used in KRPPKRP endgame
-  constexpr int KRPPKRPScaleFactors[RANK_NB] = { 0, 9, 10, 14, 21, 44, 0, 0 };
-
 #ifndef NDEBUG
   bool verify_material(const Position& pos, Color c, Value npm, int pawnsCnt) {
     return pos.non_pawn_material(c) == npm && pos.count<PAWN>(c) == pawnsCnt;
 #ifndef NDEBUG
   bool verify_material(const Position& pos, Color c, Value npm, int pawnsCnt) {
     return pos.non_pawn_material(c) == npm && pos.count<PAWN>(c) == pawnsCnt;
@@ -587,7 +584,7 @@ ScaleFactor Endgame<KRPPKRP>::operator()(const Position& pos) const {
       && relative_rank(strongSide, bksq) > r)
   {
       assert(r > RANK_1 && r < RANK_7);
       && relative_rank(strongSide, bksq) > r)
   {
       assert(r > RANK_1 && r < RANK_7);
-      return ScaleFactor(KRPPKRPScaleFactors[r]);
+      return ScaleFactor(7 * r);
   }
   return SCALE_FACTOR_NONE;
 }
   }
   return SCALE_FACTOR_NONE;
 }