Skip to content

Commit

Permalink
Give RH its own cap
Browse files Browse the repository at this point in the history
Bench: 4893421
  • Loading branch information
PGG106 committed Sep 20, 2024
1 parent 24a2484 commit 54c499e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ void updateHHScore(const Position* pos, SearchData* sd, const Move move, int bon
}

void updateRHScore(const Position *pos, SearchData *sd, const Move move, int bonus) {
// Scale bonus to fix it in a [-HH_MAX;HH_MAX] range
const int scaledBonus = bonus - GetRHScore(pos, sd, move) * std::abs(bonus) / HH_MAX;
// Scale bonus to fix it in a [-RH_MAX;RH_MAX] range
const int scaledBonus = bonus - GetRHScore(pos, sd, move) * std::abs(bonus) / RH_MAX;
// Update move score
sd->rootHistory[pos->side][FromTo(move)] += scaledBonus;
}
Expand Down
1 change: 1 addition & 0 deletions src/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ struct SearchStack;
struct MoveList;

constexpr int HH_MAX = 8192;
constexpr int RH_MAX = 8192;
constexpr int CH_MAX = 16384;
constexpr int CAPTHIST_MAX = 16384;
constexpr int CORRHIST_WEIGHT_SCALE = 1024;
Expand Down

0 comments on commit 54c499e

Please sign in to comment.