Skip to content

Commit 07caca2

Browse files
snicoletvondele
authored andcommitted
Anchored bishops
Reduce the "bad bishop" penalty when the bishop is protected by one of our pawns, as it may indicate that the bishop has found a safe spot outside the pawn chain. STC: LLR: 2.94 (-2.94,2.94) {-0.50,1.50} Total: 176942 W: 34142 L: 33696 D: 109104 Ptnml(0-2): 3129, 20422, 40919, 20876, 3125 http://tests.stockfishchess.org/tests/view/5e6f61aae42a5c3b3ca2e62d LTC: LLR: 2.95 (-2.94,2.94) {0.25,1.75} Total: 42252 W: 5615 L: 5322 D: 31315 Ptnml(0-2): 308, 3881, 12500, 4084, 353 http://tests.stockfishchess.org/tests/view/5e701382e42a5c3b3ca2e661 closes #2587 Bench: 4963440
1 parent ddcbacd commit 07caca2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/evaluate.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,12 @@ namespace {
308308
if (Pt == BISHOP)
309309
{
310310
// Penalty according to number of pawns on the same color square as the
311-
// bishop, bigger when the center files are blocked with pawns.
311+
// bishop, bigger when the center files are blocked with pawns and smaller
312+
// when the bishop is outside the pawn chain.
312313
Bitboard blocked = pos.pieces(Us, PAWN) & shift<Down>(pos.pieces());
313314

314315
score -= BishopPawns * pos.pawns_on_same_color_squares(Us, s)
315-
* (1 + popcount(blocked & CenterFiles));
316+
* (!bool(attackedBy[Us][PAWN] & s) + popcount(blocked & CenterFiles));
316317

317318
// Bonus for bishop on a long diagonal which can "see" both center squares
318319
if (more_than_one(attacks_bb<BISHOP>(s, pos.pieces(PAWN)) & Center))

0 commit comments

Comments
 (0)