1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Remove pureStaticEval #2069

Remove pureStaticEval variable and keep only one
static evaluation (ss->staticEval).

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 64617 W: 14348 L: 14312 D: 35957 Elo -0.24
http://tests.stockfishchess.org/tests/view/5c9e1ad70ebc5925cfffc106

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 82200 W: 13703 L: 13680 D: 54817 Elo -0.24
http://tests.stockfishchess.org/tests/view/5c9e4efd0ebc5925cfffc68b

Bench : 3506898
This commit is contained in:
Moez Jellouli 2019-03-29 14:05:02 +01:00 committed by Marco Costalba
parent aa0166fba6
commit 0f63b35120

View file

@ -533,7 +533,7 @@ namespace {
Key posKey; Key posKey;
Move ttMove, move, excludedMove, bestMove; Move ttMove, move, excludedMove, bestMove;
Depth extension, newDepth; Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue, pureStaticEval; Value bestValue, value, ttValue, eval, maxValue;
bool ttHit, ttPv, inCheck, givesCheck, improving; bool ttHit, ttPv, inCheck, givesCheck, improving;
bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture; bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture;
Piece movedPiece; Piece movedPiece;
@ -697,16 +697,16 @@ namespace {
// Step 6. Static evaluation of the position // Step 6. Static evaluation of the position
if (inCheck) if (inCheck)
{ {
ss->staticEval = eval = pureStaticEval = VALUE_NONE; ss->staticEval = eval = VALUE_NONE;
improving = false; improving = false;
goto moves_loop; // Skip early pruning when in check goto moves_loop; // Skip early pruning when in check
} }
else if (ttHit) else if (ttHit)
{ {
// Never assume anything on values stored in TT // Never assume anything on values stored in TT
ss->staticEval = eval = pureStaticEval = tte->eval(); ss->staticEval = eval = tte->eval();
if (eval == VALUE_NONE) if (eval == VALUE_NONE)
ss->staticEval = eval = pureStaticEval = evaluate(pos); ss->staticEval = eval = evaluate(pos);
// Can ttValue be used as a better position evaluation? // Can ttValue be used as a better position evaluation?
if ( ttValue != VALUE_NONE if ( ttValue != VALUE_NONE
@ -719,13 +719,12 @@ namespace {
{ {
int bonus = -(ss-1)->statScore / 512; int bonus = -(ss-1)->statScore / 512;
pureStaticEval = evaluate(pos); ss->staticEval = eval = evaluate(pos) + bonus;
ss->staticEval = eval = pureStaticEval + bonus;
} }
else else
ss->staticEval = eval = pureStaticEval = -(ss-1)->staticEval + 2 * Eval::Tempo; ss->staticEval = eval = -(ss-1)->staticEval + 2 * Eval::Tempo;
tte->save(posKey, VALUE_NONE, ttPv, BOUND_NONE, DEPTH_NONE, MOVE_NONE, pureStaticEval); tte->save(posKey, VALUE_NONE, ttPv, BOUND_NONE, DEPTH_NONE, MOVE_NONE, eval);
} }
// Step 7. Razoring (~2 Elo) // Step 7. Razoring (~2 Elo)
@ -749,7 +748,7 @@ namespace {
&& (ss-1)->currentMove != MOVE_NULL && (ss-1)->currentMove != MOVE_NULL
&& (ss-1)->statScore < 23200 && (ss-1)->statScore < 23200
&& eval >= beta && eval >= beta
&& pureStaticEval >= beta - 36 * depth / ONE_PLY + 225 && ss->staticEval >= beta - 36 * depth / ONE_PLY + 225
&& !excludedMove && !excludedMove
&& pos.non_pawn_material(us) && pos.non_pawn_material(us)
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor)) && (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
@ -1189,7 +1188,7 @@ moves_loop: // When in check, search starts from here
tte->save(posKey, value_to_tt(bestValue, ss->ply), ttPv, tte->save(posKey, value_to_tt(bestValue, ss->ply), ttPv,
bestValue >= beta ? BOUND_LOWER : bestValue >= beta ? BOUND_LOWER :
PvNode && bestMove ? BOUND_EXACT : BOUND_UPPER, PvNode && bestMove ? BOUND_EXACT : BOUND_UPPER,
depth, bestMove, pureStaticEval); depth, bestMove, ss->staticEval);
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);