mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 08:13:08 +00:00
Do not reset ss->eval in the beginning of the node
This avoids problems with IID clearing ss->eval and eval not being available when we return Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
6e06db93fd
commit
1322ab97c7
1 changed files with 6 additions and 4 deletions
|
@ -364,7 +364,6 @@ void SearchStack::init() {
|
|||
|
||||
currentMove = threatMove = bestMove = MOVE_NONE;
|
||||
reduction = Depth(0);
|
||||
eval = VALUE_NONE;
|
||||
}
|
||||
|
||||
// SearchStack::initKillers() initializes killers for a search stack entry
|
||||
|
@ -771,8 +770,7 @@ namespace {
|
|||
|
||||
// Step 5. Evaluate the position statically
|
||||
// At root we do this only to get reference value for child nodes
|
||||
if (!isCheck)
|
||||
ss->eval = evaluate(pos, ei);
|
||||
ss->eval = isCheck ? VALUE_NONE : evaluate(pos, ei);
|
||||
|
||||
// Step 6. Razoring (omitted at root)
|
||||
// Step 7. Static null move pruning (omitted at root)
|
||||
|
@ -1097,6 +1095,8 @@ namespace {
|
|||
refinedValue = refine_eval(tte, ss->eval, ply); // Enhance accuracy with TT value if possible
|
||||
update_gains(pos, (ss-1)->currentMove, (ss-1)->eval, ss->eval);
|
||||
}
|
||||
else
|
||||
ss->eval = VALUE_NONE;
|
||||
|
||||
// Step 6. Razoring (is omitted in PV nodes)
|
||||
if ( !PvNode
|
||||
|
@ -1450,7 +1450,6 @@ namespace {
|
|||
|
||||
TM.incrementNodeCounter(pos.thread());
|
||||
ss->bestMove = ss->currentMove = MOVE_NONE;
|
||||
ss->eval = VALUE_NONE;
|
||||
|
||||
// Check for an instant draw or maximum ply reached
|
||||
if (pos.is_draw() || ply >= PLY_MAX - 1)
|
||||
|
@ -1473,6 +1472,7 @@ namespace {
|
|||
if (isCheck)
|
||||
{
|
||||
bestValue = futilityBase = -VALUE_INFINITE;
|
||||
ss->eval = VALUE_NONE;
|
||||
deepChecks = enoughMaterial = false;
|
||||
}
|
||||
else
|
||||
|
@ -2753,6 +2753,8 @@ namespace {
|
|||
|
||||
// Find a quick score for the move
|
||||
init_ss_array(ss, PLY_MAX_PLUS_2);
|
||||
ss[0].eval = VALUE_NONE;
|
||||
ss[0].currentMove = cur->move;
|
||||
pos.do_move(cur->move, st);
|
||||
moves[count].move = cur->move;
|
||||
moves[count].score = -qsearch<PV>(pos, ss+1, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1);
|
||||
|
|
Loading…
Add table
Reference in a new issue