Skip to content

Commit d9b9bec

Browse files
committed
Don't overwrite the TT Move on an upper bound
ELO | 4.53 +- 3.14 (95%) SPRT | 10.0+0.10s Threads=1 Hash=8MB LLR | 2.96 (-2.94, 2.94) [0.00, 3.00] GAMES | N: 23104 W: 5834 L: 5533 D: 11737 ELO | 3.50 +- 2.61 (95%) SPRT | 60.0+0.60s Threads=1 Hash=64MB LLR | 2.97 (-2.94, 2.94) [0.00, 3.00] GAMES | N: 32728 W: 8067 L: 7737 D: 16924 BENCH : 3,182,566
1 parent 4ef4a55 commit d9b9bec

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/search.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,9 @@ int search(Thread *thread, PVariation *pv, int alpha, int beta, int depth, bool
784784
// the Root entry from the first line of play we examined. We also don't store into the
785785
// Transposition Table while attempting to veryify singularities
786786
if (!ns->excluded && (!RootNode || !thread->multiPV)) {
787-
ttBound = best >= beta ? BOUND_LOWER
788-
: best > oldAlpha ? BOUND_EXACT : BOUND_UPPER;
787+
ttBound = best >= beta ? BOUND_LOWER
788+
: best > oldAlpha ? BOUND_EXACT : BOUND_UPPER;
789+
bestMove = ttBound == BOUND_UPPER ? NONE_MOVE : bestMove;
789790
tt_store(board->hash, thread->height, bestMove, best, eval, depth, ttBound);
790791
}
791792

src/transposition.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,15 @@ void tt_store(uint64_t hash, int height, uint16_t move, int value, int eval, int
154154
&& depth < replace->depth - 2)
155155
return;
156156

157+
// Don't overwrite a move if we don't have a new one
158+
if (move || hash16 != replace->hash16)
159+
replace->move = (uint16_t) move;
160+
157161
// Finally, copy the new data into the replaced slot
158162
replace->depth = (int8_t ) depth;
159163
replace->generation = (uint8_t ) bound | Table.generation;
160164
replace->value = (int16_t ) tt_value_to(value, height);
161165
replace->eval = (int16_t ) eval;
162-
replace->move = (uint16_t) move;
163166
replace->hash16 = (uint16_t) hash16;
164167
}
165168

src/uci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include "types.h"
2525

26-
#define VERSION_ID "14.15"
26+
#define VERSION_ID "14.16"
2727

2828
#ifndef LICENSE_OWNER
2929
#define LICENSE_OWNER "Unlicensed"

0 commit comments

Comments
 (0)