From 9d0d3a4a34e7c1d2b88929b0e65aa0ffaf65abf8 Mon Sep 17 00:00:00 2001 From: tslil Date: Sat, 5 Sep 2026 16:57:17 +0100 Subject: prevent overflow of the uint8_t ply counter during selfplay or match --- src/match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/match.c') diff --git a/src/match.c b/src/match.c index eff1931..94afe48 100644 --- a/src/match.c +++ b/src/match.c @@ -53,7 +53,7 @@ static inline float six_cand(tak_state_p state) { } -#define MAX_PLY 250 +#define MAX_PLY 255 static tak_state_p state; @@ -79,7 +79,7 @@ static int play_game(const nn_function current_fn, const nn_function cand_fn, reset_state(state, state->board_size); char ptn[16]; - for (uint32_t ply = 0; ply < MAX_PLY; ply++) { + for (uint32_t ply = 0; ply + negamax_search_depth < MAX_PLY; ply++) { if (ply < random_opening_length) { uint32_t n_actions; action_t *actions = actions_generate(state, &n_actions); -- cgit v1.3.1