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
24 changes: 23 additions & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,29 @@ Value Worker::search(
&& (tt_data->bound() == Bound::Exact
|| (tt_data->bound() == Bound::Lower && tt_data->score >= beta)
|| (tt_data->bound() == Bound::Upper && tt_data->score <= alpha))) {
return tt_data->score;
if (depth <= 7) {
return tt_data->score;
}

if (tt_data->move == Move::none()) {
return tt_data->score;
}

MoveGen movegen{pos};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to reuse this later in search.


if (movegen.is_legal(tt_data->move)) {
Position pos_after = pos.move(tt_data->move, m_td.push_psqt_state());
auto tt_data_after = m_searcher.tt.probe(pos_after, ply);
m_td.pop_psqt_state();

if (!tt_data_after) {
return tt_data->score;
}

if ((tt_data->score >= beta) == (tt_data_after->score <= -beta)) {
return tt_data->score;
}
}
}

// Update ttpv
Expand Down
Loading