Skip to content

Commit 2c82529

Browse files
committed
Tweak again chain pawn bonus
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
1 parent f86d2ae commit 2c82529

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/pawns.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ namespace {
5353

5454
// Pawn chain membership bonus by file
5555
const Score ChainMember[FILE_NB][RANK_NB] = {
56-
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) },
57-
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
58-
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
59-
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
60-
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
61-
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
62-
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
63-
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) }
64-
};
56+
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(28, 28), S(52, 104), S(118, 236) },
57+
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
58+
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
59+
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(33, 33), S(59, 118), S(127, 254) },
60+
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(33, 33), S(59, 118), S(127, 254) },
61+
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
62+
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) },
63+
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(28, 28), S(52, 104), S(118, 236) }};
6564

6665
// Candidate passed pawn bonus by rank
6766
const Score CandidatePassed[RANK_NB] = {
@@ -98,7 +97,6 @@ namespace {
9897
Bitboard b;
9998
Square s;
10099
File f;
101-
Rank r;
102100
bool passed, isolated, doubled, opposed, chain, backward, candidate;
103101
Score value = SCORE_ZERO;
104102
const Square* pl = pos.list<PAWN>(Us);
@@ -119,7 +117,6 @@ namespace {
119117
assert(pos.piece_on(s) == make_piece(Us, PAWN));
120118

121119
f = file_of(s);
122-
r = relative_rank(Us, s);
123120

124121
// This file cannot be semi-open
125122
e->semiopenFiles[Us] &= ~(1 << f);
@@ -184,11 +181,11 @@ namespace {
184181
value -= Backward[opposed][f];
185182

186183
if (chain)
187-
value += opposed ? ChainMember[f][r] / 2 : ChainMember[f][r];
184+
value += ChainMember[f][relative_rank(Us, s)];
188185

189186
if (candidate)
190187
{
191-
value += CandidatePassed[r];
188+
value += CandidatePassed[relative_rank(Us, s)];
192189

193190
if (!doubled)
194191
e->candidatePawns[Us] |= s;

0 commit comments

Comments
 (0)