From 0deb42134cb7f0ed6ec809c3de1052ab2dfe2235 Mon Sep 17 00:00:00 2001 From: tslil Date: Tue, 1 Jun 2021 15:20:48 -0400 Subject: Trying to make things faster I tried the following, but they all made things worse: - moving away from the singly-linked (tail tracking) list for actions by: + using an array zipper for a deque + using an array to poorly hold a floating deque - caching the results of generating move lists in the transposition table and then + copying the resulting list/zip/deque instead of generating it + applying the move-to-front without copying, but this made the search order worse. Presumably in this case shallower nodes were messing up the search tree with garbage moves? I think some of this is not supposed to happen, but i have just the right combination of poor evaluation function and naively ordered and cheap move generation that i'm in a local minimum here. --- include/negamax.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/negamax.c') diff --git a/include/negamax.c b/include/negamax.c index a970b83..30aed05 100644 --- a/include/negamax.c +++ b/include/negamax.c @@ -64,6 +64,8 @@ float negamax_generate(void) { } tt_free(); + action_to_ptn(negamax_best_action, negamax_ptn); + return result; } @@ -138,10 +140,6 @@ static float negamax(const uint8_t cur_depth, const uint8_t init_depth, if (node_value > best_value) { best_value = node_value; best_action = node->action; - if (cur_depth == init_depth) { - action_to_ptn(node->action, negamax_ptn); - negamax_best_action = best_action; - } } if (best_value > alpha) alpha = best_value; @@ -149,6 +147,7 @@ static float negamax(const uint8_t cur_depth, const uint8_t init_depth, } action_list_free(list); + if (cur_depth == init_depth) negamax_best_action = best_action; flag = TT_EXACT; if (best_value >= beta) flag = TT_LOWERBOUND; -- cgit v1.3.1