]> git.sesse.net Git - stockfish/commitdiff
Remove a popcount for HinderPassedPawn
authorStéphane Nicolet <cassio@free.fr>
Fri, 27 Jul 2018 07:39:06 +0000 (09:39 +0200)
committerStéphane Nicolet <cassio@free.fr>
Fri, 27 Jul 2018 13:23:57 +0000 (15:23 +0200)
Remove a popcount for HinderPassedPawn, and compensate by doubling
 the bonus from S(4,0) to to S(8,0).

Maybe it was pure luck, but we got the idea of this Elo gaining patch by
seing the simplification attempt by Mike Whiteley in pull request #1703.
This suggests that whenever we have a passed evaluation simplification,
we should consider the possibility that the master bonus has become
slightly out of tune with time, and we should try a few Elo gaining [0..4]
tests by hand-tuning the master bonus.

STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 19136 W: 4388 L: 4147 D: 10601
http://tests.stockfishchess.org/tests/view/5b59be6f0ebc5902bdb8ac06

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 99382 W: 17324 L: 16843 D: 65215
http://tests.stockfishchess.org/tests/view/5b59d2410ebc5902bdb8afa8

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

Bench: 4688817

src/evaluate.cpp

index d552bd6ddd5867d656f1a34ef4347c29779f9a7a..5f4a1ab1fb3c6d697b1e4a0a96791660e5d7f553 100644 (file)
@@ -159,7 +159,7 @@ namespace {
   constexpr Score CloseEnemies       = S(  6,  0);
   constexpr Score CorneredBishop     = S( 50, 50);
   constexpr Score Hanging            = S( 52, 30);
   constexpr Score CloseEnemies       = S(  6,  0);
   constexpr Score CorneredBishop     = S( 50, 50);
   constexpr Score Hanging            = S( 52, 30);
-  constexpr Score HinderPassedPawn   = S(  4,  0);
+  constexpr Score HinderPassedPawn   = S(  8,  0);
   constexpr Score KingProtector      = S(  6,  6);
   constexpr Score KnightOnQueen      = S( 21, 11);
   constexpr Score LongDiagonalBishop = S( 22,  0);
   constexpr Score KingProtector      = S(  6,  6);
   constexpr Score KnightOnQueen      = S( 21, 11);
   constexpr Score LongDiagonalBishop = S( 22,  0);
@@ -637,7 +637,7 @@ namespace {
         assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up)));
 
         bb = forward_file_bb(Us, s) & pos.pieces(Them);
         assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up)));
 
         bb = forward_file_bb(Us, s) & pos.pieces(Them);
-        score -= HinderPassedPawn * popcount(bb);
+        score -= HinderPassedPawn * bool(bb);
 
         int r = relative_rank(Us, s);
         int w = PassedDanger[r];
 
         int r = relative_rank(Us, s);
         int w = PassedDanger[r];