Avoid pawn hash collissions with shogi pawns
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 20 Oct 2018 14:17:44 +0000 (16:17 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 20 Oct 2018 14:17:44 +0000 (16:17 +0200)
shogi
ELO: 16.52 +-33.3 (95%) LOS: 83.5%
Total: 400 W: 200 L: 181 D: 19

euroshogi
ELO: 16.52 +-32.5 (95%) LOS: 84.1%
Total: 400 W: 191 L: 172 D: 37

minishogi
ELO: -13.90 +-26.2 (95%) LOS: 14.8%
Total: 400 W: 110 L: 126 D: 164

No functional change for non-shogi variants.

src/pawns.cpp

index d2d9a6b..924e9c6 100644 (file)
@@ -184,7 +184,7 @@ Entry* probe(const Position& pos) {
   Key key = pos.pawn_key();
   Entry* e = pos.this_thread()->pawnsTable[key];
 
-  if (e->key == key)
+  if (e->key == key && !pos.pieces(SHOGI_PAWN))
       return e;
 
   e->key = key;