From a93cdacb82bd916e110d71611754bb9ef9be1e67 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 3 Nov 2011 17:37:34 +0100 Subject: [PATCH] Fix under-promotion hash mixup The hash table was invalidated on under-promotion by adding the promotion 'deficit' to the J hash key. But for some fairy-pieces (in particular Spartan G vs W) this difference apparently caused false hits in the null-move search, leading to misqualification of positions as stalemate. Presumably because the J key is also modified by stm, and different stm and promo-deficit could cancel each other. In stead we now modify the Z hash key with the promo-deficit. --- fairymax.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fairymax.c b/fairymax.c index e43bd46..c68ca20 100644 --- a/fairymax.c +++ b/fairymax.c @@ -222,7 +222,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ {if(v+I&&x==K&y==L>==GT) /* if move found */ {Q=-e-i;O=F;LL=L;prom=gt; if(b[y]-u&15)prom=b[y]-=PromPiece, /* under-promotion, correct */ - J+=PromPiece; /* piece & invalidate hash */ + Z+=PromPiece; /* piece & invalidate hash */ a->D=99;a->V=0; /* lock game in hash as draw*/ R-=i/FAC; /*** total captd material ***/ Fifty = t|p<3?0:Fifty+1; -- 1.7.0.4