mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 03:59:15 +00:00
Reintroduce eval optimizaion from null search
Now that conversion to eval cache is finished we can reintroduce this optimization. bench: 5149248
This commit is contained in:
parent
98cd8239cc
commit
23bdd06442
1 changed files with 11 additions and 2 deletions
|
@ -1090,7 +1090,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
Key posKey;
|
Key posKey;
|
||||||
Move ttMove, move, bestMove;
|
Move ttMove, move, bestMove;
|
||||||
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
|
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
|
||||||
bool givesCheck, enoughMaterial, evasionPrunable;
|
bool givesCheck, enoughMaterial, evasionPrunable, fromNull;
|
||||||
Depth ttDepth;
|
Depth ttDepth;
|
||||||
|
|
||||||
// To flag BOUND_EXACT a node with eval above alpha and no available moves
|
// To flag BOUND_EXACT a node with eval above alpha and no available moves
|
||||||
|
@ -1099,6 +1099,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
// Check for an instant draw or maximum ply reached
|
// Check for an instant draw or maximum ply reached
|
||||||
if (pos.is_draw<false, false>() || ss->ply > MAX_PLY)
|
if (pos.is_draw<false, false>() || ss->ply > MAX_PLY)
|
||||||
|
@ -1136,6 +1137,13 @@ split_point_start: // At split points actual search starts from here
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (fromNull)
|
||||||
|
{
|
||||||
|
// Approximated score. Real one is slightly higher due to tempo
|
||||||
|
ss->staticEval = bestValue = -(ss-1)->staticEval;
|
||||||
|
ss->evalMargin = VALUE_ZERO;
|
||||||
|
}
|
||||||
|
else
|
||||||
ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
|
ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
|
||||||
|
|
||||||
// Stand pat. Return immediately if static value is at least beta
|
// Stand pat. Return immediately if static value is at least beta
|
||||||
|
@ -1171,6 +1179,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
// Futility pruning
|
// Futility pruning
|
||||||
if ( !PvNode
|
if ( !PvNode
|
||||||
&& !InCheck
|
&& !InCheck
|
||||||
|
&& !fromNull
|
||||||
&& !givesCheck
|
&& !givesCheck
|
||||||
&& move != ttMove
|
&& move != ttMove
|
||||||
&& enoughMaterial
|
&& enoughMaterial
|
||||||
|
|
Loading…
Add table
Reference in a new issue