Skip to content

Commit

Permalink
Keepstealing (#501)
Browse files Browse the repository at this point in the history
Passed STC:
Elo | 3.50 +- 2.35 (95%)
SPRT | 8.0+0.08s Threads=1 Hash=16MB
LLR | 2.91 (-2.25, 2.89) [0.00, 3.00]
Games | N: 21930 W: 5408 L: 5187 D: 11335
Penta | [66, 2508, 5590, 2741, 60]

Passed LTC:
Elo | 6.82 +- 3.44 (95%)
SPRT | 40.0+0.40s Threads=1 Hash=64MB
LLR | 2.89 (-2.25, 2.89) [0.00, 3.00]
Games | N: 9380 W: 2261 L: 2077 D: 5042
Penta | [4, 1018, 2464, 1198, 6]

Bench: 6442362
  • Loading branch information
PGG106 authored Dec 24, 2024
1 parent b1983e4 commit e51b78e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ void updateHHScore(const Position* pos, SearchData* sd, const Move move, int bon
sd->searchHistory[pos->side][FromTo(move)] += scaledBonus;
}

void updateOppHHScore(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 - sd->searchHistory[pos->side ^ 1][FromTo(move)] * std::abs(bonus) / HH_MAX;
// Update move score
sd->searchHistory[pos->side ^ 1][FromTo(move)] += scaledBonus;
}

void updateRHScore(const Position *pos, SearchData *sd, const Move move, int bonus) {
// 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;
Expand Down
1 change: 1 addition & 0 deletions src/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ int history_bonus(const int depth);
void CleanHistories(SearchData* sd);
// Updates history heuristics for a single move
void updateHHScore(const Position* pos, SearchData* sd, const Move move, int bonus);
void updateOppHHScore(const Position* pos, SearchData* sd, const Move move, int bonus);
void updateCHScore(SearchStack* ss, const Move move, const int bonus);
void updateCapthistScore(const Position* pos, SearchData* sd, const Move move, int bonus);
void updateSingleCHScore(SearchStack* ss, const Move move, const int bonus, const int offset);
Expand Down
8 changes: 8 additions & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,14 @@ int Negamax(int alpha, int beta, int depth, const bool cutNode, ThreadData* td,
StoreTTEntry(pos->posKey, NOMOVE, SCORE_NONE, rawEval, HFNONE, 0, pvNode, ttPv);
}

// Use static evaluation difference to improve quiet move ordering (~6 Elo)
if ((ss - 1)->staticEval != SCORE_NONE && isQuiet((ss - 1)->move))
{
int bonus = std::clamp(-10 * int((ss - 1)->staticEval + ss->staticEval), -1830, 1427) + 624;
Move move = (ss - 1)->move;
updateOppHHScore(pos, sd, move, bonus);
}

const int complexity = [&] {
if (eval == 0 || rawEval == 0)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// include the tune stuff here to give it global visibility
#include "tune.h"

#define NAME "Alexandria-7.1.6"
#define NAME "Alexandria-7.1.7"

inline int reductions[2][64][64];
inline int lmp_margin[64][2];
Expand Down

0 comments on commit e51b78e

Please sign in to comment.