Skip to content

Commit

Permalink
Fix LMR history
Browse files Browse the repository at this point in the history
Bench: 12235279
  • Loading branch information
SzilBalazs committed Aug 29, 2023
1 parent cef57cd commit dcdae1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/search/search_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ namespace search {
int made_moves = 0;
while (!move_list.empty()) {
chess::Move move = ss->move = move_list.next_move();
Score main_history = move.is_quiet() ? history.main_history[board.get_stm()][move.get_from()][move.get_to()] : 0;

if (skip_quiets && move.is_quiet() && !move.is_promo()) continue;

Expand Down Expand Up @@ -406,7 +407,7 @@ namespace search {

R -= pv_node;
R += !improving;
R -= std::clamp(history.main_history[board.get_stm()][move.get_from()][move.get_to()] / 4096, -2, 2);
R -= std::clamp(main_history / 4096, -2, 2);

Depth D = std::clamp(new_depth - R, 1, depth - 1);
score = -search<NON_PV_NODE>(D, -alpha - 1, -alpha, ss + 1);
Expand Down

0 comments on commit dcdae1d

Please sign in to comment.