1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 09:13:08 +00:00

Remove improvement variable

No longer used in a meaningful way.
Improve comments.

Closes https://github.com/official-stockfish/Stockfish/pull/4688

No functional change
This commit is contained in:
Michael Chaly 2023-07-16 11:52:37 +03:00 committed by Joost VandeVondele
parent 18fdc2df3c
commit 913574f421

View file

@ -548,7 +548,7 @@ namespace {
bool givesCheck, improving, priorCapture, singularQuietLMR; bool givesCheck, improving, priorCapture, singularQuietLMR;
bool capture, moveCountPruning, ttCapture; bool capture, moveCountPruning, ttCapture;
Piece movedPiece; Piece movedPiece;
int moveCount, captureCount, quietCount, improvement; int moveCount, captureCount, quietCount;
// Step 1. Initialize node // Step 1. Initialize node
Thread* thisThread = pos.this_thread(); Thread* thisThread = pos.this_thread();
@ -708,7 +708,6 @@ namespace {
// Skip early pruning when in check // Skip early pruning when in check
ss->staticEval = eval = VALUE_NONE; ss->staticEval = eval = VALUE_NONE;
improving = false; improving = false;
improvement = 0;
goto moves_loop; goto moves_loop;
} }
else if (excludedMove) else if (excludedMove)
@ -745,14 +744,14 @@ namespace {
thisThread->mainHistory[~us][from_to((ss-1)->currentMove)] << bonus; thisThread->mainHistory[~us][from_to((ss-1)->currentMove)] << bonus;
} }
// Set up the improvement variable, which is the difference between the current // Set up the improving flag, which is true if current static evaluation is
// static evaluation and the previous static evaluation at our turn (if we were // bigger than the previous static evaluation at our turn (if we were in
// in check at our previous move we look at the move prior to it). The improvement // check at our previous move we look at static evaluaion at move prior to it
// margin and the improving flag are used in various pruning heuristics. // and if we were in check at move prior to it flag is set to true) and is
improvement = (ss-2)->staticEval != VALUE_NONE ? ss->staticEval - (ss-2)->staticEval // false otherwise. The improving flag is used in various pruning heuristics.
: (ss-4)->staticEval != VALUE_NONE ? ss->staticEval - (ss-4)->staticEval improving = (ss-2)->staticEval != VALUE_NONE ? ss->staticEval > (ss-2)->staticEval
: 173; : (ss-4)->staticEval != VALUE_NONE ? ss->staticEval > (ss-4)->staticEval
improving = improvement > 0; : true;
// Step 7. Razoring (~1 Elo). // Step 7. Razoring (~1 Elo).
// If eval is really low check with qsearch if it can exceed alpha, if it can't, // If eval is really low check with qsearch if it can exceed alpha, if it can't,