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/tt.h | |
| 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/tt.h')
| -rw-r--r-- | include/tt.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/tt.h b/include/tt.h index 60b9b66..5834860 100644 --- a/include/tt.h +++ b/include/tt.h @@ -19,7 +19,7 @@ #define TT_H #include <stdint.h> - +#include <nn.h> #include <actions.h> // =================================================================== @@ -35,6 +35,7 @@ enum TT_FLAG { TT_EXACT, TT_LOWERBOUND, TT_UPPERBOUND }; typedef struct tt_node_s { uint16_t gen; uint64_t key; + nn_function eval; enum TT_FLAG flag; uint8_t depth; float value; @@ -61,7 +62,7 @@ typedef struct tt_node_s { // entries are otherwise kept across plies on purpose (see negamax.c). int tt_init(void); -tt_entry_t *tt_seek(const uint64_t key); +tt_entry_t *tt_seek(const uint64_t key, const nn_function eval); // Store a search result for `key', returning the entry it was written to, or // NULL when the replacement policy keeps the current occupant instead. @@ -73,8 +74,8 @@ tt_entry_t *tt_seek(const uint64_t key); // - otherwise (empty slot, stale generation, or a different key): replace the // occupant unless it is a deeper search of a different position, which is // kept. -tt_entry_t *tt_store(const uint64_t key, const enum TT_FLAG flag, - const uint8_t depth, const float value, - const action_t action); +tt_entry_t *tt_store(const uint64_t key, const nn_function eval, + const enum TT_FLAG flag, const uint8_t depth, + const float value, const action_t action); #endif |
