Merge official-stockfish/master
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 13 Jun 2019 20:26:10 +0000 (22:26 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 13 Jun 2019 20:26:10 +0000 (22:26 +0200)
bench: 3468545

1  2 
src/endgame.cpp
src/endgame.h
src/main.cpp
src/material.cpp
src/pawns.cpp
src/search.cpp

diff --cc src/endgame.cpp
@@@ -95,6 -82,33 +95,39 @@@ namespace 
  } // namespace
  
  
+ namespace Endgames {
+   std::pair<Map<Value>, Map<ScaleFactor>> maps;
+   void init() {
+       add<KPK>("KPK");
+       add<KNNK>("KNNK");
+       add<KBNK>("KBNK");
+       add<KRKP>("KRKP");
+       add<KRKB>("KRKB");
+       add<KRKN>("KRKN");
+       add<KQKP>("KQKP");
+       add<KQKR>("KQKR");
+       add<KNNKP>("KNNKP");
++      // Fairy piece endgames
++      add<KNSK>("KNSK");
++      add<KNFK>("KNFK");
++      add<KNSFKR>("KNSFKR");
++      add<KSFK>("KSFK");
++
+       add<KNPK>("KNPK");
+       add<KNPKB>("KNPKB");
+       add<KRPKR>("KRPKR");
+       add<KRPKB>("KRPKB");
+       add<KBPKB>("KBPKB");
+       add<KBPKN>("KBPKN");
+       add<KBPPKB>("KBPPKB");
+       add<KRPPKRP>("KRPPKRP");
+   }
+ }
  /// Mate with KX vs K. This function is used to evaluate positions with
  /// king and plenty of material vs a lone king. It simply gives the
  /// attacking side a bonus for driving the defending king towards the edge
diff --cc src/endgame.h
Simple merge
diff --cc src/main.cpp
@@@ -26,8 -26,7 +26,9 @@@
  #include "thread.h"
  #include "tt.h"
  #include "uci.h"
+ #include "endgame.h"
 +#include "piece.h"
 +#include "variant.h"
  #include "syzygy/tbprobe.h"
  
  namespace PSQT {
Simple merge
diff --cc src/pawns.cpp
@@@ -129,10 -126,9 +129,10 @@@ namespace 
          // Score this pawn
          if (support | phalanx)
          {
-             int v = (phalanx ? 3 : 2) * Connected[r] * (r == RANK_2 && pos.captures_to_hand() ? 3 : 1);
 -            int v =  Connected[r] * (phalanx ? 3 : 2) / (opposed ? 2 : 1)
++            int v =  Connected[r] * (phalanx ? 3 : 2)  * (r == RANK_2 && pos.captures_to_hand() ? 3 : 1) / (opposed ? 2 : 1)
+                    + 17 * popcount(support);
 -
 +            if (r >= RANK_4 && pos.count<PAWN>(Us) > popcount(pos.board_bb()) / 4)
-                 v = std::max(v, popcount(support | phalanx) * 100);
-             v = 17 * popcount(support) + (v >> (opposed + 1));
++                v = std::max(v, popcount(support | phalanx) * 100) / (opposed ? 2 : 1);
              score += make_score(v, v * (r - 2) / 4);
          }
          else if (!neighbours)
diff --cc src/search.cpp
Simple merge