Skip to content

Commit

Permalink
Clamp HH bonus
Browse files Browse the repository at this point in the history
Bench: 12497427
  • Loading branch information
SzilBalazs committed Aug 28, 2023
1 parent f041255 commit e4d82fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/search/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ namespace search {
}

void update_butterfly_history(chess::Move move, int bonus) {
bonus = std::clamp(bonus, -1000, 1000);
int scaled = bonus - butterfly[move.get_from()][move.get_to()] * std::abs(bonus) / 32768;
butterfly[move.get_from()][move.get_to()] += scaled;
}
Expand Down

0 comments on commit e4d82fd

Please sign in to comment.