reworked corrhist handling | bench 6409786

This commit is contained in:
rektdie committed 2025-09-10 01:26:42 +02:00
1 parent 3e652df8e8
commit 32691d2d65
5 files changed
+23 -11

No files matched your search

+3 -3
View File
@@ -42,11 +42,11 @@ int16_t ContHistory::GetTwoPly(Board& board, Move& move, SearchContext* ctx, int
}
static int AdjustEval(Board &board, SearchContext* ctx, int eval) {
int pawnHist = ctx->corrhist.GetPawnHist(board);
int corrhist = ctx->corrhist.GetAllHist(board);
int mateFound = MATE_SCORE - MAX_PLY;
return std::clamp(eval + pawnHist / CORRHIST_GRAIN, -mateFound + 1, mateFound - 1);
return std::clamp(eval + corrhist / CORRHIST_GRAIN, -mateFound + 1, mateFound - 1);
}
static int ScoreMove(Board &board, Move &move, int ply, SearchContext* ctx) {
@@ -666,7 +666,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
int corrHistBonus = std::clamp(results.score - staticEval, -CORRHIST_LIMIT, CORRHIST_LIMIT);
ctx->corrhist.UpdatePawnHist(board, depth, corrHistBonus);
ctx->corrhist.UpdateAll(board, depth, corrHistBonus);
}
ctx->TT.WriteEntry(board.hashKey, depth, results.score, nodeType, results.bestMove);