]> git.sesse.net Git - stockfish/commitdiff
Reintroduce king infiltration
authorVizvezdenec <Vizvezdenec@gmail.com>
Tue, 4 Feb 2020 17:41:58 +0000 (20:41 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 5 Feb 2020 12:42:24 +0000 (13:42 +0100)
This patch reintroduces the recently simplified king infiltration bonus
in initiative calculation, doubling its effect, and compensating more.

passed STC
http://tests.stockfishchess.org/tests/view/5e3476f630ae32da08941d5c
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 75323 W: 14434 L: 14140 D: 46749
Ptnml(0-2): 1231, 8729, 17528, 8826, 1331

passed LTC
http://tests.stockfishchess.org/tests/view/5e377353e70d848499f638c1
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 171466 W: 22223 L: 21561 D: 127682
Ptnml(0-2): 1204, 15951, 50831, 16397, 1312

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

Brench: 4869669

src/evaluate.cpp

index 17597648bf36393fa2067ccbaf2ee071c33e51d2..df7ff5ea33776e61eb7fb75fa9365d58bc4c1128 100644 (file)
@@ -708,14 +708,18 @@ namespace {
                            &&  outflanking < 0
                            && !pawnsOnBothFlanks;
 
+    bool infiltration = rank_of(pos.square<KING>(WHITE)) > RANK_4
+                     || rank_of(pos.square<KING>(BLACK)) < RANK_5;
+
     // Compute the initiative bonus for the attacking side
     int complexity =   9 * pe->passed_count()
                     + 11 * pos.count<PAWN>()
                     +  9 * outflanking
                     + 21 * pawnsOnBothFlanks
+                    + 24 * infiltration
                     + 51 * !pos.non_pawn_material()
                     - 43 * almostUnwinnable
-                    - 95 ;
+                    -110 ;
 
     // Give more importance to non-material score
     Value mg = mg_value(score);