Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ Value Search::Worker::search(
ss->ttHit = ttHit;
ttData.move = rootNode ? rootMoves[pvIdx].pv[0] : ttHit ? ttData.move : Move::none();
ttData.value = ttHit ? value_from_tt(ttData.value, ss->ply, pos.rule50_count()) : VALUE_NONE;
ss->ttPv = excludedMove ? ss->ttPv : PvNode || (ttHit && ttData.is_pv);
ss->ttPv = excludedMove ? ss->ttPv : PvNode || ttData.is_pv;
ttCapture = ttData.move && pos.capture_stage(ttData.move);

// Step 5. Static evaluation of the position
Expand Down Expand Up @@ -1531,7 +1531,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
Key posKey;
Move move, bestMove;
Value bestValue, value, futilityBase;
bool pvHit, givesCheck, capture;
bool givesCheck, capture;
int moveCount;

// Step 1. Initialize node
Expand Down Expand Up @@ -1562,7 +1562,6 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
ss->ttHit = ttHit;
ttData.move = ttHit ? ttData.move : Move::none();
ttData.value = ttHit ? value_from_tt(ttData.value, ss->ply, pos.rule50_count()) : VALUE_NONE;
pvHit = ttHit && ttData.is_pv;

// At non-PV nodes we check for an early TT cutoff
if (!PvNode && ttData.depth >= DEPTH_QS
Expand Down Expand Up @@ -1737,7 +1736,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)

// Save gathered info in transposition table. The static evaluation
// is saved as it was before adjustment by correction history.
ttWriter.write(posKey, value_to_tt(bestValue, ss->ply), pvHit,
ttWriter.write(posKey, value_to_tt(bestValue, ss->ply), ttData.is_pv,
bestValue >= beta ? BOUND_LOWER : BOUND_UPPER, DEPTH_QS, bestMove,
unadjustedStaticEval, tt.generation());

Expand Down
Loading