]> git.sesse.net Git - stockfish/commitdiff
Simplify minPawnDistance
authorprotonspring <mike@whiteley.org>
Fri, 17 Apr 2020 05:12:43 +0000 (23:12 -0600)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 18 Apr 2020 13:29:24 +0000 (15:29 +0200)
This is a functional simplification which fixes an awkward numerical cliff.

With master king_safety, no pawns is scored higher than pawn(s) that is/are far from the king. This may motivate SF to throw away pawns to increase king safety. With this patch, there is a consistent value for minPawnDistance where losing a pawn never increases king safety.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 45548 W: 8624 L: 8525 D: 28399
Ptnml(0-2): 592, 4937, 11587, 5096, 562
https://tests.stockfishchess.org/tests/view/5e98ced630be947a14e9ddc5

LTC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 42084 W: 5292 L: 5242 D: 31550
Ptnml(0-2): 193, 3703, 13252, 3649, 245
https://tests.stockfishchess.org/tests/view/5e98e22e30be947a14e9de07

closes https://github.com/official-stockfish/Stockfish/pull/2639

bench 4600292

src/pawns.cpp

index 75e6ad7a7dfc9f50b675c9b0eb6c8b4a10f308f4..066146e20b48d7400dab2753674615229fd36e38 100644 (file)
@@ -244,7 +244,7 @@ Score Entry::do_king_safety(const Position& pos) {
 
   // In endgame we like to bring our king near our closest pawn
   Bitboard pawns = pos.pieces(Us, PAWN);
-  int minPawnDist = pawns ? 8 : 0;
+  int minPawnDist = 6;
 
   if (pawns & PseudoAttacks[KING][ksq])
       minPawnDist = 1;