From: Fabian Fichter Date: Thu, 13 Jun 2019 20:26:10 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=087b3f19cc36a0a402510b933d68a167e6e1cf71;p=fairystockfish.git Merge official-stockfish/master bench: 3468545 --- 087b3f19cc36a0a402510b933d68a167e6e1cf71 diff --cc src/endgame.cpp index 63652ef,7c4efa3..55edc33 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@@ -95,6 -82,33 +95,39 @@@ namespace } // namespace + namespace Endgames { + + std::pair, Map> maps; + + void init() { + + add("KPK"); + add("KNNK"); + add("KBNK"); + add("KRKP"); + add("KRKB"); + add("KRKN"); + add("KQKP"); + add("KQKR"); + add("KNNKP"); + ++ // Fairy piece endgames ++ add("KNSK"); ++ add("KNFK"); ++ add("KNSFKR"); ++ add("KSFK"); ++ + add("KNPK"); + add("KNPKB"); + add("KRPKR"); + add("KRPKB"); + add("KBPKB"); + add("KBPKN"); + add("KBPPKB"); + add("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/main.cpp index f5f7ff7,57656f6..5f3b109 --- a/src/main.cpp +++ b/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 { diff --cc src/pawns.cpp index c8c41f2,291d40b..a3a7c9f --- a/src/pawns.cpp +++ b/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(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)