]> git.sesse.net Git - stockfish/commitdiff
Change exclusion key setup
authorlucasart <lucas.braesch@gmail.com>
Tue, 30 Aug 2016 12:27:05 +0000 (20:27 +0800)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 2 Sep 2016 06:37:01 +0000 (08:37 +0200)
Should depend on which move is excluded. This
allow us to remove the dedicated Position::exclusion_key().

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 59814 W: 11136 L: 11083 D: 37595

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 31023 W: 4187 L: 4080 D: 22756

bench 7553379

src/position.cpp
src/position.h
src/search.cpp

index bc8e92a1d77a29980bb9c274e5cbf434dbdfa7c5..aa06db08c106ae9f5c1689e2e3b110671f21a25c 100644 (file)
@@ -40,11 +40,8 @@ namespace Zobrist {
   Key enpassant[FILE_NB];
   Key castling[CASTLING_RIGHT_NB];
   Key side;
-  Key exclusion;
 }
 
-Key Position::exclusion_key() const { return st->key ^ Zobrist::exclusion; }
-
 namespace {
 
 const string PieceToChar(" PNBRQK  pnbrqk");
@@ -132,7 +129,6 @@ void Position::init() {
   }
 
   Zobrist::side = rng.rand<Key>();
-  Zobrist::exclusion  = rng.rand<Key>();
 }
 
 
index 7fce1dbb79f6415d5b4ecfca87a7723e44a83785..c974f1bd97a50e2c081b549d3210d791d00c9dbe 100644 (file)
@@ -150,7 +150,6 @@ public:
   // Accessing hash keys
   Key key() const;
   Key key_after(Move m) const;
-  Key exclusion_key() const;
   Key material_key() const;
   Key pawn_key() const;
 
index 7fafe933d5fda20eb2f9d60bb678c0cc796e4d81..c12f086240721cc9c7157032eb5864ea87103268 100644 (file)
@@ -622,7 +622,7 @@ namespace {
     // search to overwrite a previous full search TT value, so we use a different
     // position key in case of an excluded move.
     excludedMove = ss->excludedMove;
-    posKey = excludedMove ? pos.exclusion_key() : pos.key();
+    posKey = pos.key() ^ Key(excludedMove);
     tte = TT.probe(posKey, ttHit);
     ttValue = ttHit ? value_from_tt(tte->value(), ss->ply) : VALUE_NONE;
     ttMove =  rootNode ? thisThread->rootMoves[thisThread->PVIdx].pv[0]