From: H.G.Muller Date: Mon, 6 Feb 2017 21:49:19 +0000 (+0100) Subject: Fix null move X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=372de7656f6253d046d65cfa074b107789ae651f;p=crazywa.git Fix null move The null-move search used a null window at alpha, instead of beta. --- diff --git a/dropper.c b/dropper.c index 36d9220..a03acda 100644 --- a/dropper.c +++ b/dropper.c @@ -1172,12 +1172,14 @@ if(hashMove && board[hashMove>>8&255] == 0) {char s[100];sprintf(s,"bad hash mov } if(maxDepth <= 0 && board[toDecode[hashMove&255]] == 0) hashMove = 0; } else if(curEval >= beta && f.checker == CK_NONE) { - int nullDepth = (depth > 3 ? depth - 3 : 0); - f.mutation = -1; // kludge to suppress testing for discovered check + int nullDepth = depth - 3; + if(nullDepth < 0) nullDepth = 0; + f.mutation = -2; // kludge to suppress testing for discovered check f.newEval = f.pstEval; f.newKey = f.hashKey; + f.epSqr = -1; f.fromSqr = f.toSqr = f.captSqr = 1; f.toPiece = board[1]; deprec[ply] = maxDepth << 16 | depth << 8; path[ply++] = 0; - score = -Search(stm, -alpha-1, -alpha, &f, nullDepth, 0, nullDepth); + score = -Search(stm, -beta, 1-beta, &f, nullDepth, 0, nullDepth); ply--; if(score >= beta) { ff->depth = f.depth + originalReduction + 3; moveSP = oldSP; return beta + 1; } }