From 1c9e266ae25f7f6067806d139e5971ce8513d2f6 Mon Sep 17 00:00:00 2001 From: tslil Date: Tue, 8 Sep 2026 11:55:28 +0100 Subject: ~25% speedup in selfplay due to: incremental zobrist hashing, smarter road checking, re-using the input computed for the NN --- include/zobrist.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/zobrist.h') diff --git a/include/zobrist.h b/include/zobrist.h index 5fd5ace..27053a6 100644 --- a/include/zobrist.h +++ b/include/zobrist.h @@ -19,8 +19,14 @@ #include #include +#define PLY_PARITY_MAGIC 0x9E3779B97F4A7C15ULL + void zobrist_free(void); int zobrist_init(const uint8_t board_size); +// hash for whole state uint64_t zobrist_compute(tak_state_p state); + +// hash contribution from a single board cell at location l +uint64_t zobrist_cell(tak_state_p state, const uint8_t l); -- cgit v1.3.1