]> git.sesse.net Git - stockfish/commitdiff
Bonus for rook on same file as their queen
authorxoto10 <buylow001@gmail.com>
Thu, 12 Sep 2019 03:29:23 +0000 (04:29 +0100)
committerStéphane Nicolet <cassio@free.fr>
Thu, 12 Sep 2019 08:05:35 +0000 (10:05 +0200)
This patch creates a simple bonus for a rook that is on the same file as the
opponent's queen.

STC 10+0.1 th 1 :
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 45609 W: 10120 L: 9733 D: 25756
http://tests.stockfishchess.org/tests/view/5d79895a0ebc5902d385484a

LTC 60+0.6 th 1 :
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 51651 W: 8606 L: 8288 D: 34757
http://tests.stockfishchess.org/tests/view/5d79a0850ebc5902d3854d27

Many thanks to @noobpwnftw for providing the extra cpu resources for fishtest,
which led to me doing these tests.

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

Bench: 4024461

src/evaluate.cpp

index 05fa45bc9e08f8e127ad36793b98ff292aa6ed6d..cb1ad1f420060ef6d7fa1e0b076f1a04ac3388b3 100644 (file)
@@ -140,6 +140,7 @@ namespace {
   constexpr Score PawnlessFlank      = S( 17, 95);
   constexpr Score RestrictedPiece    = S(  7,  7);
   constexpr Score RookOnPawn         = S( 10, 32);
+  constexpr Score RookOnQueenFile    = S( 11,  4);
   constexpr Score SliderOnQueen      = S( 59, 18);
   constexpr Score ThreatByKing       = S( 24, 89);
   constexpr Score ThreatByPawnPush   = S( 48, 39);
@@ -346,6 +347,10 @@ namespace {
             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))
+                score += RookOnQueenFile;
+
             // Bonus for rook on an open or semi-open file
             if (pos.is_on_semiopen_file(Us, s))
                 score += RookOnFile[bool(pos.is_on_semiopen_file(Them, s))];