Skip to content

Commit

Permalink
remove vcf search
Browse files Browse the repository at this point in the history
  • Loading branch information
dhbloo committed Oct 13, 2024
1 parent ed79856 commit bf7f54a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Rule, NT>(board, ss, alpha, beta)
: vcfsearch<Rule, NT>(board, ss, alpha, beta);
}

int moveCount = 0, nonMatedCount = 0;
Value bestValue = -VALUE_INFINITE, maxValue = VALUE_INFINITE, value;
Pos bestMove = Pos::NONE;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf7f54a

Please sign in to comment.