diff --git a/Rapfi/search/ab/search.cpp b/Rapfi/search/ab/search.cpp index d9f78e6..5773cb1 100644 --- a/Rapfi/search/ab/search.cpp +++ b/Rapfi/search/ab/search.cpp @@ -638,12 +638,6 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth uint16_t oppo5 = board.p4Count(oppo, A_FIVE); // opponent five uint16_t oppo4 = oppo5 + board.p4Count(oppo, B_FLEX4); // opponent straight four and five - // Dive into vcf search when the depth reaches zero (~17 elo) - if (depth <= 0.0f) { - return oppo5 ? vcfdefend(board, ss, alpha, beta) - : vcfsearch(board, ss, alpha, beta); - } - int moveCount = 0, nonMatedCount = 0; Value bestValue = -VALUE_INFINITE, maxValue = VALUE_INFINITE, value; Pos bestMove = Pos::NONE; @@ -794,11 +788,7 @@ 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) { + if (oppo4 && depth > 0.0f) { // Use static evaluation from previous ply if opponent makes a four/five attack ss->staticEval = -(ss - 1)->staticEval; @@ -833,8 +823,16 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth } improvement = ss->staticEval - (ss - 2)->staticEval; + + // Return static eval when the depth reaches zero + if (depth <= 0.0f) + return ss->staticEval; } + // Reset killer of grand-children + (ss + 2)->killers[0] = Pos::NONE; + (ss + 2)->killers[1] = Pos::NONE; + // Step 7. Razoring with VCF (~68 elo) if (!PvNode && (alpha < VALUE_MATE_IN_MAX_PLY || !ttHit) // We are not searching for a short win