Evaluate horde imbalance
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 23 Oct 2020 10:04:43 +0000 (12:04 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 23 Oct 2020 10:05:42 +0000 (12:05 +0200)
horde STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 570 W: 337 L: 227 D: 6
http://www.variantfishtest.org:6543/tests/view/5f91bada6e23db221d9e933c

horde LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 592 W: 347 L: 237 D: 8
http://www.variantfishtest.org:6543/tests/view/5f91cf096e23db221d9e9340

src/evaluate.cpp

index 1884e03..9ebb9fc 100644 (file)
@@ -1147,6 +1147,16 @@ namespace {
             }
             else if (pos.extinction_value() == VALUE_MATE)
                 score += make_score(pos.non_pawn_material(Us), pos.non_pawn_material(Us)) / pos.count<ALL_PIECES>(Us);
+            else if (pos.count<PAWN>(Us) == pos.count<ALL_PIECES>(Us))
+            {
+                // Pawns easy to stop/capture
+                int l = 0, m = 0, r = popcount(pos.pieces(Us, PAWN) & file_bb(FILE_A));
+                for (File f = FILE_A; f <= pos.max_file(); ++f)
+                {
+                    l = m; m = r; r = popcount(pos.pieces(Us, PAWN) & shift<EAST>(file_bb(f)));
+                    score -= make_score(30, 30) * m / (1 + l * r);
+                }
+            }
     }
 
     // Connect-n