// Step 6. Static evaluation of the position
if (inCheck) {
ss->staticEval = eval = VALUE_NONE;
improving = false;
goto moves_loop; // Skip early pruning when in check
}
else if (ttHit) {
// Never assume anything about values stored in TT
ss->staticEval = eval = tte->eval();
if (eval == VALUE_NONE)
ss->staticEval = eval = evaluate(pos);
if (eval == VALUE_DRAW)
eval = value_draw(thisThread);
// Can ttValue be used as a better position evaluation?
if ( ttValue != VALUE_NONE && (tte->bound() & (ttValue > eval ? BOUND_LOWER:BOUND_UPPER)))
eval = ttValue;
}
else{
if ((ss-1)->currentMove != MOVE_NULL) {
int bonus = -(ss-1)->statScore / 512;
ss->staticEval = eval = evaluate(pos) + bonus;
}
else
ss->staticEval = eval = -(ss-1)->staticEval + 2 * Eval::Tempo;
tte->save(posKey, VALUE_NONE, ttPv, BOUND_NONE, DEPTH_NONE, MOVE_NONE, eval);
}
I am looking for an explanation of the very little "bonus" added only if evaluate is called and ttHit is false.
Why here ? why only here (and not also when ttHit with VALUE_NONE ?
Joost Buijs wrote: ↑Sat Nov 02, 2019 10:23 am
I think the explanation is: 'because it tested 0.3 Elo better'.
But there is always a real idea before the test try
The (real) idea is to give a bonus if the previous move of the opponent was historically bad,
and a penalty if the previous move of the opponent was historically good.
Deberger wrote: ↑Sun Nov 03, 2019 5:26 am
The (real) idea is to give a bonus if the previous move of the opponent was historically bad,
and a penalty if the previous move of the opponent was historically good.
Is not the bonus added recursively? It looks to me that the result is to inflate deep score. Maybe it adds confidence to score returns from deeper searches.
I think there is an aging factor for the stat scores, so that they do get refreshed. But more importantly, the bonus is only added in nodes with no ttHit. This means probably that the node is often near the leaves, and a new node. Once the hash probe finds a search result, you have both a search result and a static evaluation, and the static evaluation is modified with that if possible for use with nullmove etc.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan