Skip to content

Commit

Permalink
Simplify tropism. (#1807)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
31m059 authored and mcostalba committed Nov 11, 2018
1 parent 05aa34e commit 30a905c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluate.cpp
Expand Up @@ -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;
b2 = b1 & attackedBy2[Them] & ~attackedBy[Us][PAWN];
b2 = b1 & attackedBy2[Them];

int tropism = popcount(b1) + popcount(b2);

Expand Down

2 comments on commit 30a905c

@MichaelB7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on line 421 should be updated. Remove " ...but not defended by our pawns".

@31m059
Copy link
Author

@31m059 31m059 commented on 30a905c Nov 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelB7 Sorry I missed that, and thank you for the correction!

Please sign in to comment.