X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=1eddff5813f2d5afc45f106f53dd8c1278b4b7a2;hb=c835ee88535e138a4a5870f18a1cebab96476cf7;hp=3eba90d9678b8cd843688f5e00b3648731726fc8;hpb=4ef068a506baeec93d8ef992eef3ddb218d5f88e;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 3eba90d9..1eddff58 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -373,6 +373,7 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, // Initialize global search variables StopOnPonderhit = AbortSearch = Quit = AspirationFailLow = false; + MaxSearchTime = AbsoluteMaxSearchTime = ExtraSearchTime = 0; NodesSincePoll = 0; TM.resetNodeCounters(); SearchStartTime = get_system_time(); @@ -647,8 +648,6 @@ namespace { // Initialize iteration Iteration++; BestMoveChangesByIteration[Iteration] = 0; - if (Iteration <= 5) - ExtraSearchTime = 0; cout << "info depth " << Iteration << endl; @@ -790,15 +789,17 @@ namespace { EvalInfo ei; StateInfo st; + CheckInfo ci(pos); int64_t nodes; Move move; Depth depth, ext, newDepth; Value value, alpha, beta; bool isCheck, moveIsCheck, captureOrPromotion, dangerous; - int researchCount = 0; + int researchCountFH, researchCountFL; + + researchCountFH = researchCountFL = 0; alpha = *alphaPtr; beta = *betaPtr; - CheckInfo ci(pos); isCheck = pos.is_check(); // Step 1. Initialize node and poll (omitted at root, but I can see no good reason for this, FIXME) @@ -930,8 +931,8 @@ namespace { print_pv_info(pos, ss, alpha, beta, value); // Prepare for a research after a fail high, each time with a wider window - researchCount++; - *betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCount), VALUE_INFINITE); + researchCountFH++; + *betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCountFH), VALUE_INFINITE); } // End of fail high loop @@ -1016,8 +1017,8 @@ namespace { break; // Prepare for a research after a fail low, each time with a wider window - researchCount++; - *alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCount), -VALUE_INFINITE); + researchCountFL++; + *alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCountFL), -VALUE_INFINITE); } // Fail low loop