]> git.sesse.net Git - stockfish/commitdiff
Use queens of either color in RookOnQueenFile
author31m059 <37052095+31m059@users.noreply.github.com>
Fri, 13 Sep 2019 19:46:05 +0000 (15:46 -0400)
committerStéphane Nicolet <cassio@free.fr>
Sat, 14 Sep 2019 05:47:05 +0000 (07:47 +0200)
The recently-added RookOnQueenFile evaluation term (36e4a86) provided a bonus
for placing our rook on the same file as an enemy queen.

Here, we relax a condition in this bonus, broadening its effect to any queen.
It is also strategically desirable to place the rook on the same file as a friendly
queen, so the restriction on the queen's color is removed.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 66856 W: 14847 L: 14815 D: 37194
http://tests.stockfishchess.org/tests/view/5d7b3c6a0ebc5902d385bcf5

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 86786 W: 14264 L: 14248 D: 58274
http://tests.stockfishchess.org/tests/view/5d7b4e9b0ebc5902d385c178

Closes https://github.com/official-stockfish/Stockfish/pull/2302

Bench: 3703909

src/evaluate.cpp

index 73e2144cc2d248faaf1fad03e08e43f6f3cb5870..ad76fc8d727b145e5815cafcc44e5f1e094cbc47 100644 (file)
@@ -347,8 +347,8 @@ namespace {
             if (relative_rank(Us, s) >= RANK_5)
                 score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]);
 
             if (relative_rank(Us, s) >= RANK_5)
                 score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]);
 
-            // Bonus for rook on same file as their queen
-            if (file_bb(s) & pos.pieces(Them, QUEEN))
+            // Bonus for rook on the same file as a queen
+            if (file_bb(s) & pos.pieces(QUEEN))
                 score += RookOnQueenFile;
 
             // Bonus for rook on an open or semi-open file
                 score += RookOnQueenFile;
 
             // Bonus for rook on an open or semi-open file