Skip to content

Commit e118570

Browse files
Joona Kiiskizamar
authored andcommitted
Pawn Center Bind Bonus
Bonus for two pawns controlling the same central square STC: LLR: 3.14 (-2.94,2.94) [-1.50,4.50] Total: 15974 W: 3291 L: 3133 D: 9550 LTC: LLR: 3.24 (-2.94,2.94) [0.00,6.00] Total: 10449 W: 1837 L: 1674 D: 6938 Idea from Lyudmil Tsvetkov. Bench: 7699138 Resolves #248
1 parent 170bdf4 commit e118570

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/pawns.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ namespace {
6161
// Unsupported pawn penalty
6262
const Score UnsupportedPawnPenalty = S(20, 10);
6363

64+
// Center bind bonus: Two pawns controlling the same central square
65+
const Bitboard CenterBindMask[COLOR_NB] = {
66+
(FileDBB | FileEBB) & (Rank5BB | Rank6BB | Rank7BB),
67+
(FileDBB | FileEBB) & (Rank4BB | Rank3BB | Rank2BB)
68+
};
69+
70+
const Score CenterBind = S(16, 0);
71+
6472
// Weakness of our pawn shelter in front of the king by [distance from edge][rank]
6573
const Value ShelterWeakness[][RANK_NB] = {
6674
{ V( 99), V(20), V(26), V(54), V(85), V( 92), V(108) },
@@ -195,6 +203,10 @@ namespace {
195203
b = e->semiopenFiles[Us] ^ 0xFF;
196204
e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0;
197205

206+
// Center binds: Two pawns controlling the same central square
207+
b = shift_bb<Right>(ourPawns) & shift_bb<Left>(ourPawns) & CenterBindMask[Us];
208+
score += popcount<Max15>(b) * CenterBind;
209+
198210
return score;
199211
}
200212

0 commit comments

Comments
 (0)