Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate promotions in tactical history on captures #403

Merged
merged 1 commit into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void UpdateHistories(Board* board, SearchData* data, Move bestMove, int depth, i
} else {
int piece = PieceType(Moving(bestMove));
int to = To(bestMove);
int captured = (IsEP(bestMove) || Promo(bestMove)) ? PAWN : PieceType(board->squares[to]);
int captured = IsEP(bestMove) ? PAWN : PieceType(board->squares[to]);

AddHistoryHeuristic(&TH(piece, to, captured), inc);
}
Expand All @@ -77,7 +77,7 @@ void UpdateHistories(Board* board, SearchData* data, Move bestMove, int depth, i
if (m != bestMove) {
int piece = PieceType(Moving(m));
int to = To(m);
int captured = (IsEP(m) || Promo(m)) ? PAWN : PieceType(board->squares[to]);
int captured = IsEP(m) ? PAWN : PieceType(board->squares[to]);

AddHistoryHeuristic(&TH(piece, to, captured), -inc);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ int GetCounterHistory(SearchData* data, Move move) {
int GetTacticalHistory(SearchData* data, Board* board, Move m) {
int piece = PieceType(Moving(m));
int to = To(m);
int captured = (IsEP(m) || Promo(m)) ? PAWN : PieceType(board->squares[to]);
int captured = IsEP(m) ? PAWN : PieceType(board->squares[to]);

return TH(piece, to, captured);
}
2 changes: 1 addition & 1 deletion src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ typedef struct {
int hh[2][2][2][64 * 64]; // history heuristic butterfly table (stm / threatened)
int ch[12][64][12][64]; // continuation move history table

int th[6][64][6]; // tactical (capture) history
int th[6][64][7]; // tactical (capture) history

int64_t tm[64 * 64];
} SearchData;
Expand Down