From 313f4037339142f0c3488f511c57ca7a400ea8a5 Mon Sep 17 00:00:00 2001 From: Miguel Lahoz Date: Thu, 26 Jul 2018 00:11:51 +0800 Subject: [PATCH] Tweak KingFlank when king is on edge files This tweak excludes files D and E from the KingFlank bitboard when our king is on the A or H files respectively. As far as I can tell, this affects two things: the calculation for CloseEnemies and PawnlessFlank. Aside from filtering out slightly less relevant attacks in the flank, I suspect this helps with king prophylaxis, avoiding attacks and moving towards the center when the pawns start to come off. STC LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 56755 W: 12881 L: 12489 D: 31385 http://tests.stockfishchess.org/tests/view/5b58a94c0ebc5902bdb88c72 LTC LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 130205 W: 22536 L: 21957 D: 85712 http://tests.stockfishchess.org/tests/view/5b58b7580ebc5902bdb89029 How to continue: Tweaking the two bonuses mentioned might give some gain, although as far as I can tell, CloseEnemies is very sensitive to even small changes. Closes https://github.com/official-stockfish/Stockfish/pull/1705 Bench: 5026009 --- src/evaluate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 31419146..d552bd6d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -79,9 +79,9 @@ namespace { constexpr Bitboard Center = (FileDBB | FileEBB) & (Rank4BB | Rank5BB); constexpr Bitboard KingFlank[FILE_NB] = { - QueenSide, QueenSide, QueenSide, + QueenSide ^ FileDBB, QueenSide, QueenSide, CenterFiles, CenterFiles, - KingSide, KingSide, KingSide + KingSide, KingSide, KingSide ^ FileEBB }; // Threshold for lazy and space evaluation -- 2.39.2