Skip to content

Commit

Permalink
Allow RQ through pieces. Bench: 3415326 (#2153)
Browse files Browse the repository at this point in the history
We evaluate defended and unsafe squares for a passed pawn push based on friendly and enemy rooks and queens on the passed pawn's file. Prior to this patch, we further required that these rooks and queens be able to directly attack the passed pawn. However, this restriction appears unnecessary and worth almost exactly 0 Elo at LTC.

The simplified code allows rooks and queens to attack/defend the passed pawn through other pieces of either color.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 29019 W: 6488 L: 6381 D: 16150
http://tests.stockfishchess.org/tests/view/5cdcf7270ebc5925cf05d30c

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 54224 W: 9200 L: 9133 D: 35891
http://tests.stockfishchess.org/tests/view/5cddc6210ebc5925cf05eca3

Bench: 3415326
  • Loading branch information
31m059 authored and mcostalba committed May 17, 2019
1 parent 2985a6b commit bf6b647
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluate.cpp
Expand Up @@ -649,7 +649,7 @@ namespace {
// in the pawn's path attacked or occupied by the enemy.
defendedSquares = unsafeSquares = squaresToQueen = forward_file_bb(Us, s);

bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN) & pos.attacks_from<ROOK>(s);
bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN);

if (!(pos.pieces(Us) & bb))
defendedSquares &= attackedBy[Us][ALL_PIECES];
Expand Down

0 comments on commit bf6b647

Please sign in to comment.