]> git.sesse.net Git - stockfish/commitdiff
Tweak again chain pawn bonus
authorMarco Costalba <mcostalba@gmail.com>
Tue, 22 Oct 2013 15:47:16 +0000 (17:47 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 22 Oct 2013 15:47:16 +0000 (17:47 +0200)
This is the first chain bonus version
from Ralph that also passed both

Short TC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 23460 W: 4727 L: 4556 D: 14177

And long TC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 31858 W: 5497 L: 5240 D: 21121

And performed better against current
committed version, always at 60secs:

LLR: -2.94 (-2.94,2.94) [-3.00,3.00]
Total: 26301 W: 4477 L: 4580 D: 17244

This test was done by Leonid.

bench: 8455956

src/pawns.cpp

index b74f0659b24a371a92a6184ce5c73a50ea57ae7c..df8a68f961bf04d4c901621b3519db1568e726ed 100644 (file)
@@ -53,15 +53,14 @@ namespace {
 
   // Pawn chain membership bonus by file
   const Score ChainMember[FILE_NB][RANK_NB] = {
-    { S(0, 0), S(14, 0), S(16, 4), S(18,  9), S(56, 56), S(104, 208), S(236, 472) }, 
-    { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) }, 
-    { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) }, 
-    { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) }, 
-    { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) }, 
-    { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) }, 
-    { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) }, 
-    { S(0, 0), S(14, 0), S(16, 4), S(18,  9), S(56, 56), S(104, 208), S(236, 472) }
-  }; 
+  { S(0, 0), S(14, 0), S(16, 4), S(18,  9), S(28, 28), S(52, 104), S(118, 236) },
+  { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
+  { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
+  { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(33, 33), S(59, 118), S(127, 254) },
+  { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(33, 33), S(59, 118), S(127, 254) },
+  { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
+  { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
+  { S(0, 0), S(14, 0), S(16, 4), S(18,  9), S(28, 28), S(52, 104), S(118, 236) }};
 
   // Candidate passed pawn bonus by rank
   const Score CandidatePassed[RANK_NB] = {
@@ -98,7 +97,6 @@ namespace {
     Bitboard b;
     Square s;
     File f;
-    Rank r;
     bool passed, isolated, doubled, opposed, chain, backward, candidate;
     Score value = SCORE_ZERO;
     const Square* pl = pos.list<PAWN>(Us);
@@ -119,7 +117,6 @@ namespace {
         assert(pos.piece_on(s) == make_piece(Us, PAWN));
 
         f = file_of(s);
-        r = relative_rank(Us, s);
 
         // This file cannot be semi-open
         e->semiopenFiles[Us] &= ~(1 << f);
@@ -184,11 +181,11 @@ namespace {
             value -= Backward[opposed][f];
 
         if (chain)
-            value += opposed ? ChainMember[f][r] / 2 : ChainMember[f][r];
+            value += ChainMember[f][relative_rank(Us, s)];
 
         if (candidate)
         {
-            value += CandidatePassed[r];
+            value += CandidatePassed[relative_rank(Us, s)];
 
             if (!doubled)
                 e->candidatePawns[Us] |= s;