]> git.sesse.net Git - stockfish/commitdiff
Isolated pawns tweak
authorElbertoOne <lubvdberg@gmail.com>
Sun, 31 May 2020 14:39:03 +0000 (16:39 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 1 Jun 2020 15:27:29 +0000 (17:27 +0200)
Give opposed doubled isolated pawns only the Doubled penalty.
The other isolated pawns get the Isolated penalty and the WeakUnopposed penalty.
The popcount condition has been replaced with an opposed check,
which is non-functional, but probably gives a speed-up.

Passed STC (https://tests.stockfishchess.org/tests/view/5ed0f0f0042fa6d77c3552f5):
LLR: 2.96 (-2.94,2.94) {-0.50,1.50}
Total: 121832 W: 23562 L: 23195 D: 75075
Ptnml(0-2): 2092, 14064, 28313, 14279, 2168

LTC: (https://tests.stockfishchess.org/tests/view/5ed22e40042fa6d77c355387)
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 103368 W: 13232 L: 12768 D: 77368
Ptnml(0-2): 693, 9484, 30919, 9842, 746

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

Bench: 4085694

src/pawns.cpp

index 467137b3133ef84a4d7fef1a0f64d8de50bf761e..c1119a4102ca59a8459a1977d6c48699d1c59dff 100644 (file)
@@ -145,13 +145,13 @@ namespace {
 
         else if (!neighbours)
         {
-            score -=   Isolated
-                     + WeakUnopposed * !opposed;
-
-            if (   (ourPawns & forward_file_bb(Them, s))
-                && popcount(opposed) == 1
+            if (     opposed
+                &&  (ourPawns & forward_file_bb(Them, s))
                 && !(theirPawns & adjacent_files_bb(s)))
                 score -= Doubled;
+            else
+                score -=   Isolated
+                         + WeakUnopposed * !opposed;
         }
 
         else if (backward)