#include <stdlib.h>
#include <string.h>
+#define LMR 2
+
#define ON 1
#define OFF 0
#define INVALID 0
}
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
}
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);