From: H.G. Muller Date: Thu, 3 Nov 2011 16:37:34 +0000 (+0100) Subject: Fix under-promotion hash mixup X-Git-Tag: 4.8S~23 X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=commitdiff_plain;h=a93cdacb82bd916e110d71611754bb9ef9be1e67;hp=6cd25f6e4f2a524bdd85f34583e47afbae746488 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. --- 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;