]> git.sesse.net Git - stockfish/commitdiff
Tweak KingFlank when king is on edge files
authorMiguel Lahoz <miguel_lahoz@protonmail.com>
Wed, 25 Jul 2018 16:11:51 +0000 (00:11 +0800)
committerStéphane Nicolet <cassio@free.fr>
Fri, 27 Jul 2018 08:38:20 +0000 (10:38 +0200)
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

index 31419146667d95918d2a14ff311c2214763fb29f..d552bd6ddd5867d656f1a34ef4347c29779f9a7a 100644 (file)
@@ -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