]> git.sesse.net Git - stockfish/commitdiff
Simplify tropism. (#1807)
author31m059 <37052095+31m059@users.noreply.github.com>
Sun, 11 Nov 2018 21:14:28 +0000 (16:14 -0500)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Sun, 11 Nov 2018 21:14:28 +0000 (22:14 +0100)
We calculate tropism as a sum of two factors. The first is the number of squares in our kingFlank and Camp that are attacked by the enemy; the second is number of these squares that are attacked twice. Prior to this commit, we excluded squares we defended with pawns from this second value, but this appears unnecessary. (Doubly-attacked squares near our king are still dangerous.) The removal of this exclusion is a possible small Elo gain at STC (estimated +1.59) and almost exactly neutral at LTC (estimated +0.04).

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 20942 W: 4550 L: 4427 D: 11965
http://tests.stockfishchess.org/tests/view/5be4e0ae0ebc595e0ae308a0

LTC:
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 56941 W: 9172 L: 9108 D: 38661
http://tests.stockfishchess.org/tests/view/5be4ec340ebc595e0ae30938

Bench: 3813986

src/evaluate.cpp

index e6938e189f4312f3eaff82f68c2645f9c0701533..97218baa19f9627cb27ce59948c255e18cef0b81 100644 (file)
@@ -421,7 +421,7 @@ namespace {
     // which are attacked twice in that flank but not defended by our pawns.
     kingFlank = KingFlank[file_of(ksq)];
     b1 = attackedBy[Them][ALL_PIECES] & kingFlank & Camp;
     // which are attacked twice in that flank but not defended by our pawns.
     kingFlank = KingFlank[file_of(ksq)];
     b1 = attackedBy[Them][ALL_PIECES] & kingFlank & Camp;
-    b2 = b1 & attackedBy2[Them] & ~attackedBy[Us][PAWN];
+    b2 = b1 & attackedBy2[Them];
 
     int tropism = popcount(b1) + popcount(b2);
 
 
     int tropism = popcount(b1) + popcount(b2);