Don't randomize mate scores
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 15 May 2017 13:10:33 +0000 (15:10 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 15 May 2017 13:10:33 +0000 (15:10 +0200)
The randomization is supposed to be an amount in centi-Pawns, and applying
it to mate distance can prevent finding the mate.

dropper.c

index 78b97cc..e421cba 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1363,7 +1363,8 @@ if(PATH)printf("%d:%d:%d new iter moveStack[%d..%d]\n",ply,depth,iterDepth,m.fir
                    repKey[index] = (int)f.newKey & 0x1FFFFF | f.newEval << 21; repDep[index] = ply + moveNr; // remember position
                    // recursion
                    deprec[ply] = (f.checker != CK_NONE ? f.checker : 0)<<24 | maxDepth<<16 | depth<< 8 | iterDepth; path[ply++] = moveStack[curMove];
-                   score = ran - Search(stm, -beta, -alpha+ran, &f, iterDepth-1, lmr, highDepth);
+                   score = -Search(stm, -beta, -alpha+ran, &f, iterDepth-1, lmr, highDepth);
+                   if(ran && score < INF-100 && score > 100-INF) score += ran;
                    ply--;
 
                    repKey[index] = oldRepKey; repDep[index] = oldRepDep;