From: H.G. Muller Date: Mon, 11 Feb 2013 13:02:05 +0000 (+0100) Subject: Fix hash-address bug X-Git-Tag: 4.8S~17 X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=commitdiff_plain;h=2f0beb1f00d5215af1834117b3b69ac82c662400 Fix hash-address bug The lowest bit of the address was clipped off by wrong use of the mask. Because of this only even entries could be used, and spoiling of the key after underpromotion to the 'nearest' alternative would lead to an enormous number of false hash hits, leading to false result claims. --- diff --git a/fairymax.c b/fairymax.c index 91fe48d..8b28a6c 100644 --- a/fairymax.c +++ b/fairymax.c @@ -151,7 +151,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ { /* e=score, z=prev.dest; J,Z=hashkeys; return score*/ int j,r,m,v,d,h,i,F,G,P,V,f=J,g=Z,C,s,flag,FF,*ps=sp,kk=S; signed char t,p,u,x,y,X,Y,H,B,gt; - struct _*a=A+(J+(k+S)*E&U-1); /* lookup pos. in hash table*/ + struct _*a=A+(J+(k+S)*E&U); /* lookup pos. in hash table*/ *sp++=0; q-=qD;m=a->V;X=a->F;Y=a->Y; /* resume at stored depth */ @@ -747,7 +747,7 @@ int main(int argc, char **argv) if(sscanf(line+7, "Ini File=%s", filename) == 1) { inifile = filename; continue; } - if(sscanf(line+7, "Clear Hash") == 1) for(i=0; iK = 0; + if(sscanf(line+7, "Clear Hash") == 1) for(i=0; i<=U; i++) A->K = 0; if(sscanf(line+7, "MultiVariation Margin=%d", &margin) == 1) continue; if(sscanf(line+7, "Variant fairy selects=%s", selectedFairy+6) == 1) continue; if(sscanf(line+7, "Cambodian Makruk rules=%d", &Cambodian) == 1) continue;