diff options
| author | tslil <tslil@posteo.de> | 2026-09-16 20:10:33 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-09-16 21:02:53 +0100 |
| commit | 1898add0142b70b3fef5af78a6f3d7399a3f2cd5 (patch) | |
| tree | ef62b4d6b6f78a426248f7636a83b77cce5edaa4 /include/negamax.c | |
| parent | 7f1566fb21dfe8c99bc770885cc2cc4e478e16b4 (diff) | |
A little subtle, but in non-self-play games sharing tt entries is incorrect. We must therefore key additionally on the evaulation function itself.
Diffstat (limited to 'include/negamax.c')
| -rw-r--r-- | include/negamax.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |
