Calculate passedCount real-time #2099
authorprotonspring <mike@whiteley.org>
Tue, 16 Apr 2019 14:12:47 +0000 (08:12 -0600)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Tue, 16 Apr 2019 14:12:47 +0000 (16:12 +0200)
This is a non-functional simplification which removes the passedCount variable in pawns.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 27982 W: 6227 L: 6118 D: 15637
http://tests.stockfishchess.org/tests/view/5cb3cdd30ebc5925cf017025

Combo STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 17368 W: 3925 L: 3795 D: 9648
http://tests.stockfishchess.org/tests/view/5cb3d3510ebc5925cf01709a

Non functional test.

src/pawns.cpp
src/pawns.h

index 7e29f5065803cc7b7d801f6935dd15903db27aef..4c2ff3913d50faecad5cbc081e5e6b27428cb45a 100644 (file)
@@ -164,7 +164,6 @@ Entry* probe(const Position& pos) {
   e->key = key;
   e->scores[WHITE] = evaluate<WHITE>(pos, e);
   e->scores[BLACK] = evaluate<BLACK>(pos, e);
-  e->passedCount= popcount(e->passedPawns[WHITE] | e->passedPawns[BLACK]);
 
   return e;
 }
index 5f5411f613a5e5cc6f9644315cb89b9595fbbe5e..96ed4149216fc24527e920d86c4e0ed5ab477122 100644 (file)
@@ -38,7 +38,7 @@ struct Entry {
   Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
   Bitboard pawn_attacks_span(Color c) const { return pawnAttacksSpan[c]; }
   int weak_unopposed(Color c) const { return weakUnopposed[c]; }
-  int passed_count() const { return passedCount; }
+  int passed_count() const { return popcount(passedPawns[WHITE] | passedPawns[BLACK]); };
 
   int pawns_on_same_color_squares(Color c, Square s) const {
     return pawnsOnSquares[c][bool(DarkSquares & s)];
@@ -66,7 +66,6 @@ struct Entry {
   int weakUnopposed[COLOR_NB];
   int castlingRights[COLOR_NB];
   int pawnsOnSquares[COLOR_NB][COLOR_NB]; // [color][light/dark squares]
-  int passedCount;
 };
 
 typedef HashTable<Entry, 16384> Table;