Fix periodic upates
authorH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Apr 2018 13:37:28 +0000 (15:37 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Apr 2018 13:37:28 +0000 (15:37 +0200)
The 'stat01' commans must report on the move that is currently being
searched. Not the one that just has been searched. So the statement
to save the root info globally has been moved to before the recursive call.

dropper.c

index fa1eb00..6efba7b 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1479,6 +1479,7 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction,
                } else { // not a repeat: search it
                    int lmr;
                  search:
+                   if(ply == 0) rootFirst = m.firstMove, rootLast = moveSP, rootCurrent = curMove, rootPly = iterDepth;
                    lmr = (curMove >= m.late) + (curMove >= m.drops);
                    f.tpGain = f.newEval + ff->pstEval;     // material gain in last two ply
                    if(ply==0 && randomize && moveNr < 10) ran = (alpha > INF-100 || alpha <-INF+100 ? 0 : (f.newKey*ranKey>>24 & 31)- 16);
@@ -1531,7 +1532,6 @@ printf("%d:%d:%d %2d. %08x %c%d%c%d %6d %6d %6d\n",ply,depth,iterDepth,curMove,m
                        alpha = bestScore - margin;
                    }
            }
-           if(ply == 0) rootFirst = m.firstMove, rootLast = moveSP, rootCurrent = curMove, rootPly = iterDepth;
        }   // move loop
 
        // stalemate correction