From: xoto10 Date: Thu, 12 Sep 2019 03:29:23 +0000 (+0100) Subject: Bonus for rook on same file as their queen X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=36e4a86c08a4b79965d819b7893709245cad840a Bonus for rook on same file as their queen 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 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 05fa45bc..cb1ad1f4 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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))];