mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Restore old BOUND_EXACT logic in qsearch
In case a PvNode node has a static evaluation above alpha but
no available moves we want to flag the node as BOUND_EXACT,
not as BOUND_UPPER as is currently.
The behaviour was recently introduced with patch d471c49700
of 3/10/2012
Spotted by Hongzhi Cheng.
bench: 5558464
This commit is contained in:
parent
c45a4e0b48
commit
116234d6c6
1 changed files with 6 additions and 2 deletions
|
@ -1101,10 +1101,14 @@ split_point_start: // At split points actual search starts from here
|
||||||
const TTEntry* tte;
|
const TTEntry* tte;
|
||||||
Key posKey;
|
Key posKey;
|
||||||
Move ttMove, move, bestMove;
|
Move ttMove, move, bestMove;
|
||||||
Value bestValue, value, ttValue, futilityValue, futilityBase;
|
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
|
||||||
bool givesCheck, enoughMaterial, evasionPrunable, fromNull;
|
bool givesCheck, enoughMaterial, evasionPrunable, fromNull;
|
||||||
Depth ttDepth;
|
Depth ttDepth;
|
||||||
|
|
||||||
|
// To flag BOUND_EXACT a node with eval above alpha and no available moves
|
||||||
|
if (PvNode)
|
||||||
|
oldAlpha = alpha;
|
||||||
|
|
||||||
ss->currentMove = bestMove = MOVE_NONE;
|
ss->currentMove = bestMove = MOVE_NONE;
|
||||||
ss->ply = (ss-1)->ply + 1;
|
ss->ply = (ss-1)->ply + 1;
|
||||||
fromNull = (ss-1)->currentMove == MOVE_NULL;
|
fromNull = (ss-1)->currentMove == MOVE_NULL;
|
||||||
|
@ -1291,7 +1295,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
return mated_in(ss->ply); // Plies to mate from the root
|
return mated_in(ss->ply); // Plies to mate from the root
|
||||||
|
|
||||||
TT.store(posKey, value_to_tt(bestValue, ss->ply),
|
TT.store(posKey, value_to_tt(bestValue, ss->ply),
|
||||||
PvNode && bestMove != MOVE_NONE ? BOUND_EXACT : BOUND_UPPER,
|
PvNode && bestValue > oldAlpha ? BOUND_EXACT : BOUND_UPPER,
|
||||||
ttDepth, bestMove, ss->staticEval, ss->evalMargin);
|
ttDepth, bestMove, ss->staticEval, ss->evalMargin);
|
||||||
|
|
||||||
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
|
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue