Make minimum LMR depth a macro, foreasy tuning
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 14 Jan 2017 18:07:55 +0000 (19:07 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 14 Jan 2017 18:07:55 +0000 (19:07 +0100)
dropper.c

index 64b0bab..5f5e3ea 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -9,6 +9,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#define LMR 2
+
 #define ON  1
 #define OFF 0
 #define INVALID 0
@@ -1088,7 +1090,7 @@ if(PATH)printf("%d:%d   Hash Probe %016llx\n",ply,depth,f.hashKey);
        }
 if(PATH)printf("      Hit, d=%d, checker = %x\n",entry->depth,f.checker);
        if((entry->flags & H_LOWER || entry->score <= alpha) && (entry->flags & H_UPPER || entry->score >= beta)) { // compatible bound
-           d += (score >= beta & entry->depth >= 3)*reduction; // fail highs need to satisfy reduced depth only, so we fake higher depth than actually found
+           d += (score >= beta & entry->depth >= LMR)*reduction; // fail highs need to satisfy reduced depth only, so we fake higher depth than actually found
            if(score > alpha && d >= depth || d >= maxDepth) { // sufficient depth
                ff->depth = d + 1; return entry->score; // depth was sufficient, take hash cutoff
            }
@@ -1120,8 +1122,8 @@ if(hashMove && board[hashMove>>8&255] == 0) {char s[100];sprintf(s,"bad hash mov
     if(f.checker != CK_NONE) {
        depth++, maxDepth++, reduction = originalReduction = 0 /*, killers[ply][2] = -1*/; // extend check evasions
        if(earlyGen && f.checkDist && maxDepth <= 1) ipMask = SafeIP(&f);
-    } else if(depth > 3) {
-       if(depth - reduction < 3) reduction = depth - 3; // never reduce to below 3 ply
+    } else if(depth > LMR) {
+       if(depth - reduction < LMR) reduction = depth - LMR; // never reduce to below 'LMR' ply
        depth -= reduction;
     } else reduction = originalReduction = 0;
 if(PATH)printf("%d:%d   {%d,%d} max=%d eval=%d check=%02x,%d,%d\n",ply,depth,alpha,beta,maxDepth,curEval,f.checker,f.checkDir,f.checkDist);