From 1898add0142b70b3fef5af78a6f3d7399a3f2cd5 Mon Sep 17 00:00:00 2001 From: tslil Date: Wed, 16 Sep 2026 20:10:33 +0100 Subject: fix tt issue for non-self-play A little subtle, but in non-self-play games sharing tt entries is incorrect. We must therefore key additionally on the evaulation function itself. --- include/negamax.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/negamax.c') diff --git a/include/negamax.c b/include/negamax.c index f9a52e6..9c4ddbd 100644 --- a/include/negamax.c +++ b/include/negamax.c @@ -164,7 +164,7 @@ static float negamax(tak_state_p state, const uint8_t cur_depth, // the scratch buffer is per-level so that recursion does not clobber const uint32_t level = init_depth - cur_depth; - tt_entry_t *entry = tt_seek(hash); + tt_entry_t *entry = tt_seek(hash, evaluate); // The root never early-returns from the table. Within one game the new // root was only ever stored at depth D-1, so an early return could not @@ -283,7 +283,7 @@ static float negamax(tak_state_p state, const uint8_t cur_depth, else if (best_value <= orig_alpha) flag = TT_UPPERBOUND; - entry = tt_store(hash, flag, cur_depth, best_value, best_action); + entry = tt_store(hash, evaluate, flag, cur_depth, best_value, best_action); #ifdef RECORD_PV if (entry != NULL) entry->leaf = best_leaf; -- cgit v1.3.1