Skip to content

Commit

Permalink
Bench: 17174108
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Oct 23, 2023
1 parent cfdf4d6 commit a37e0a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "types.h"


#define QuietEntry(move) (&thread->history[thread->pos.stm][fromSq(move)][toSq(move)])
#define QuietEntry(move) (&thread->history[kingSq(pos->stm)][pos->stm][fromSq(move)][toSq(move)])
#define NoisyEntry(move) (&thread->captureHistory[piece(move)][toSq(move)][PieceTypeOf(capturing(move))])
#define ContEntry(offset, move) (&(*(ss-offset)->continuation)[piece(move)][toSq(move)])

Expand All @@ -52,6 +52,8 @@ INLINE void UpdateContHistories(Stack *ss, Move move, int bonus) {
// Updates history heuristics when a quiet move is the best move
INLINE void UpdateQuietHistory(Thread *thread, Stack *ss, Move bestMove, int bonus, Depth depth, Move quiets[], int qCount) {

Position *pos = &thread->pos;

// Update killers
if (ss->killers[0] != bestMove) {
ss->killers[1] = ss->killers[0];
Expand Down Expand Up @@ -90,6 +92,7 @@ INLINE void UpdateHistory(Thread *thread, Stack *ss, Move bestMove, Depth depth,
}

INLINE int GetQuietHistory(const Thread *thread, Stack *ss, Move move) {
const Position *pos = &thread->pos;
return *QuietEntry(move)
+ *ContEntry(1, move)
+ *ContEntry(2, move)
Expand Down
2 changes: 1 addition & 1 deletion src/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define MULTI_PV_MAX 64


typedef int16_t ButterflyHistory[COLOR_NB][64][64];
typedef int16_t ButterflyHistory[64][COLOR_NB][64][64];
typedef int16_t CaptureToHistory[PIECE_NB][64][TYPE_NB];
typedef int16_t PieceToHistory[PIECE_NB][64];
typedef PieceToHistory ContinuationHistory[PIECE_NB][64];
Expand Down

0 comments on commit a37e0a6

Please sign in to comment.