From 190b2a1c8411298d69e740215fe2612ea8e92a4e Mon Sep 17 00:00:00 2001 From: dhb <1084714805@qq.com> Date: Fri, 14 Jun 2024 14:15:49 +0800 Subject: [PATCH] reset statScore at current node test r15 --- Rapfi/search/ab/search.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Rapfi/search/ab/search.cpp b/Rapfi/search/ab/search.cpp index d2ae5f81..d8515780 100644 --- a/Rapfi/search/ab/search.cpp +++ b/Rapfi/search/ab/search.cpp @@ -657,6 +657,8 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth Value bestValue = -VALUE_INFINITE, maxValue = VALUE_INFINITE, value; Pos bestMove = Pos::NONE; HistoryTracker histTracker(board, ss); + (ss + 2)->killers[0] = (ss + 2)->killers[1] = Pos::NONE; // Reset killer of grand-children + ss->statScore = 0; // Reset statScore // Update selDepth (selDepth counts from 1, ply from 0) if (PvNode && thisThread->selDepth <= ss->ply) @@ -690,12 +692,6 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth beta = std::min(mate_in(ss->ply + 1), beta); if (alpha >= beta) return alpha; - - // Initialize statScore to zero for the grandchildren of the current position. - // So statScore is shared between all grandchildren and only the first grandchild - // starts with statScore = 0. Later grandchildren start with the last calculated - // statScore of the previous grandchild. - (ss + 2)->statScore = 0; } else searchData->rootDelta = beta - alpha; @@ -800,10 +796,6 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth Value eval = VALUE_NONE; int improvement = 0; // Static eval change in the last two ply - // Reset killer of grand-children - (ss + 2)->killers[0] = Pos::NONE; - (ss + 2)->killers[1] = Pos::NONE; - if (oppo4) { // Use static evaluation from previous ply if opponent makes a four/five attack ss->staticEval = -(ss - 1)->staticEval;