]> git.sesse.net Git - stockfish/commitdiff
File based passed pawn bonus
authorStefan Geschwentner <stgeschwentner@gmail.com>
Sat, 3 Oct 2015 10:46:53 +0000 (03:46 -0700)
committerJoona Kiiski <joona@zoox.com>
Sat, 3 Oct 2015 10:50:06 +0000 (03:50 -0700)
Add file based bonus for passed pawns. Values tuned by SPSA.

STC:
LLR: 3.33 (-2.94,2.94) [0.00,5.00]
Total: 36889 W: 6805 L: 6507 D: 23577

LTC:
LLR: 2.97 (-2.94,2.94) [0.00,5.00]
Total: 32301 W: 5101 L: 4858 D: 22342

Bench: 8073614

Resolves #436

src/evaluate.cpp

index 130b0e0aa1b345bba0e243aebdc38c96d8db3635..f66ba58c78eb5ace99e97f1b11a9cdf23cbc82f9 100644 (file)
@@ -170,6 +170,12 @@ namespace {
     { V(7), V(14), V(37), V(63), V(134), V(189) }
   };
 
+  // PassedFile[File] contains a bonus according to the file of a passed pawn.
+  const Score PassedFile[] = {
+    S( 14,  13), S( 2,  5), S(-3, -4), S(-19, -14),
+    S(-19, -14), S(-3, -4), S( 2,  5), S( 14,  13)
+  };
+
   const Score ThreatenedByHangingPawn = S(40, 60);
 
   // Assorted bonuses and penalties used by evaluation
@@ -652,7 +658,7 @@ namespace {
         if (pos.count<PAWN>(Us) < pos.count<PAWN>(Them))
             ebonus += ebonus / 4;
 
-        score += make_score(mbonus, ebonus);
+        score += make_score(mbonus, ebonus) + PassedFile[file_of(s)];
     }
 
     if (DoTrace)