From c835ee88535e138a4a5870f18a1cebab96476cf7 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 7 Mar 2010 10:02:34 +0200 Subject: [PATCH] Use separated research counters in root_search() One for failing highs and one for failing lows, this should reduce average window size in case of positions that fail first high and then low (or the contrary). After ~2000 games on Joona's quad we have: Mod - Orig: 1012- 975 (+6 elo) Signed-off-by: Marco Costalba --- src/search.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index b8cf5b90..1eddff58 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -789,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) @@ -929,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 @@ -1015,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 -- 2.39.2