mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
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 <mcostalba@gmail.com>
This commit is contained in:
parent
7ff9678651
commit
c835ee8853
1 changed files with 8 additions and 6 deletions
|
@ -789,15 +789,17 @@ namespace {
|
||||||
|
|
||||||
EvalInfo ei;
|
EvalInfo ei;
|
||||||
StateInfo st;
|
StateInfo st;
|
||||||
|
CheckInfo ci(pos);
|
||||||
int64_t nodes;
|
int64_t nodes;
|
||||||
Move move;
|
Move move;
|
||||||
Depth depth, ext, newDepth;
|
Depth depth, ext, newDepth;
|
||||||
Value value, alpha, beta;
|
Value value, alpha, beta;
|
||||||
bool isCheck, moveIsCheck, captureOrPromotion, dangerous;
|
bool isCheck, moveIsCheck, captureOrPromotion, dangerous;
|
||||||
int researchCount = 0;
|
int researchCountFH, researchCountFL;
|
||||||
|
|
||||||
|
researchCountFH = researchCountFL = 0;
|
||||||
alpha = *alphaPtr;
|
alpha = *alphaPtr;
|
||||||
beta = *betaPtr;
|
beta = *betaPtr;
|
||||||
CheckInfo ci(pos);
|
|
||||||
isCheck = pos.is_check();
|
isCheck = pos.is_check();
|
||||||
|
|
||||||
// Step 1. Initialize node and poll (omitted at root, but I can see no good reason for this, FIXME)
|
// 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);
|
print_pv_info(pos, ss, alpha, beta, value);
|
||||||
|
|
||||||
// Prepare for a research after a fail high, each time with a wider window
|
// Prepare for a research after a fail high, each time with a wider window
|
||||||
researchCount++;
|
researchCountFH++;
|
||||||
*betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCount), VALUE_INFINITE);
|
*betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCountFH), VALUE_INFINITE);
|
||||||
|
|
||||||
} // End of fail high loop
|
} // End of fail high loop
|
||||||
|
|
||||||
|
@ -1015,8 +1017,8 @@ namespace {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Prepare for a research after a fail low, each time with a wider window
|
// Prepare for a research after a fail low, each time with a wider window
|
||||||
researchCount++;
|
researchCountFL++;
|
||||||
*alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCount), -VALUE_INFINITE);
|
*alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCountFL), -VALUE_INFINITE);
|
||||||
|
|
||||||
} // Fail low loop
|
} // Fail low loop
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue