Double PSQT for slow leapers
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 7 Jun 2020 16:25:47 +0000 (18:25 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 7 Jun 2020 16:25:47 +0000 (18:25 +0200)
makruk STC
LLR: 2.99 (-2.94,2.94) [0.00,10.00]
Total: 634 W: 87 L: 28 D: 519
http://www.variantfishtest.org:6543/tests/view/5edbeaa16e23db36d55f2d62

makruk LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 769 W: 89 L: 31 D: 649
http://www.variantfishtest.org:6543/tests/view/5edca7656e23db36d55f2d8d

shatranj STC
LLR: 2.99 (-2.94,2.94) [0.00,10.00]
Total: 2884 W: 317 L: 245 D: 2322
http://www.variantfishtest.org:6543/tests/view/5edbeac86e23db36d55f2d67

knightmate STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 470 W: 171 L: 95 D: 204
http://www.variantfishtest.org:6543/tests/view/5edc0c366e23db36d55f2d7e

src/psqt.cpp

index f904238..f7ebd45 100644 (file)
@@ -151,6 +151,8 @@ void init(const Variant* v) {
       const PieceInfo* pi = pieceMap.find(pt)->second;
       bool isSlider = pi->sliderQuiet.size() || pi->sliderCapture.size() || pi->hopperQuiet.size() || pi->hopperCapture.size();
       bool isPawn = !isSlider && pi->stepsQuiet.size() && !std::any_of(pi->stepsQuiet.begin(), pi->stepsQuiet.end(), [](Direction d) { return d < SOUTH / 2; });
+      bool isSlowLeaper = !isSlider && !std::any_of(pi->stepsQuiet.begin(), pi->stepsQuiet.end(), [](Direction d) { return dist(d) > 1; });
+
       if (isSlider)
       {
           constexpr int lc = 5;
@@ -204,7 +206,7 @@ void init(const Variant* v) {
                                   : pt == HORSE ? Bonus[KNIGHT][std::min(r, RANK_8)][std::min(f, FILE_D)]
                                   : isSlider    ? make_score(5, 5) * (2 * f + std::max(std::min(r, Rank(v->maxRank - r)), RANK_1) - v->maxFile - 1)
                                   : isPawn      ? make_score(5, 5) * (2 * f - v->maxFile)
-                                                : make_score(10, 10) * (f + std::max(std::min(r, Rank(v->maxRank - r)), RANK_1) - v->maxFile / 2));
+                                                : make_score(10, 10) * (1 + isSlowLeaper) * (f + std::max(std::min(r, Rank(v->maxRank - r)), RANK_1) - v->maxFile / 2));
           if (pt == SOLDIER && r < v->soldierPromotionRank)
               psq[pc][s] -= score * (v->soldierPromotionRank - r) / (4 + f);
           psq[~pc][rank_of(s) <= v->maxRank ? relative_square(BLACK, s, v->maxRank) : s] = -psq[pc][s];