]> git.sesse.net Git - stockfish/commitdiff
Space Invaders
authorAlain SAVARD <support@multicim.com>
Sun, 14 Jul 2019 17:13:06 +0000 (13:13 -0400)
committerStéphane Nicolet <cassio@free.fr>
Thu, 25 Jul 2019 06:07:55 +0000 (08:07 +0200)
Try a more ambitius simplification of the space bonus

STC http://tests.stockfishchess.org/tests/view/5d2b62c90ebc5925cf0da2a4
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 51299 W: 11320 L: 11257 D: 28722

LTC http://tests.stockfishchess.org/tests/view/5d2bac270ebc5925cf0db215
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 49761 W: 8409 L: 8335 D: 33017

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

bench: 3395999

src/evaluate.cpp

index 9a67a8e429024aa8f5453281c450aacbe322028d..10dddc7de009c7c02251feb037c02e1793c83b75 100644 (file)
@@ -133,7 +133,6 @@ namespace {
   };
 
   // Assorted bonuses and penalties
   };
 
   // Assorted bonuses and penalties
-  constexpr Score AttacksOnSpaceArea = S(  4,  0);
   constexpr Score BishopPawns        = S(  3,  7);
   constexpr Score CorneredBishop     = S( 50, 50);
   constexpr Score FlankAttacks       = S(  8,  0);
   constexpr Score BishopPawns        = S(  3,  7);
   constexpr Score CorneredBishop     = S( 50, 50);
   constexpr Score FlankAttacks       = S(  8,  0);
@@ -705,12 +704,10 @@ namespace {
     behind |= shift<Down>(behind);
     behind |= shift<Down+Down>(behind);
 
     behind |= shift<Down>(behind);
     behind |= shift<Down+Down>(behind);
 
-    int bonus = popcount(safe) + popcount(behind & safe);
+    int bonus = popcount(safe) + popcount(behind & safe & ~attackedBy[Them][ALL_PIECES]);
     int weight = pos.count<ALL_PIECES>(Us) - 1;
     Score score = make_score(bonus * weight * weight / 16, 0);
 
     int weight = pos.count<ALL_PIECES>(Us) - 1;
     Score score = make_score(bonus * weight * weight / 16, 0);
 
-    score -= AttacksOnSpaceArea * popcount(attackedBy[Them][ALL_PIECES] & behind & safe);
-
     if (T)
         Trace::add(SPACE, Us, score);
 
     if (T)
         Trace::add(SPACE, Us, score);