Skip to content

Commit

Permalink
ablation: no null move pruning
Browse files Browse the repository at this point in the history
test r15
  • Loading branch information
dhbloo committed Jul 26, 2024
1 parent 49a8c22 commit 64b798e
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,34 +858,34 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
return eval;

// Step 9. Null move pruning (~35 elo)
if (!PvNode && !oppo4 && !skipMove && eval >= beta
&& board.getLastMove() != Pos::PASS // No consecutive pass moves
&& ss->staticEval >= beta + nullMoveMargin<Rule>(depth)) {
Depth r = nullMoveReduction<Rule>(depth);
ss->currentMove = Pos::PASS;

(ss + 1)->numNullMoves++;
board.doPassMove();
TT.prefetch(board.zobristKey());
value = -search<Rule, NonPV>(board, ss + 1, -beta, -beta + 1, depth - r, !cutNode);
board.undoPassMove();
(ss + 1)->numNullMoves--;

if (value >= beta) {
// Do not return unproven mate scores
if (value >= VALUE_MATE_IN_MAX_PLY)
value = beta;

if (std::abs(beta) < VALUE_MATE_IN_MAX_PLY)
return value;
else {
// Do verification search at high depths, with null move pruning disabled
Value v = search<Rule, NonPV>(board, ss, beta - 1, beta, depth - r, false);
if (v >= beta)
return value;
}
}
}
//if (!PvNode && !oppo4 && !skipMove && eval >= beta
// && board.getLastMove() != Pos::PASS // No consecutive pass moves
// && ss->staticEval >= beta + nullMoveMargin<Rule>(depth)) {
// Depth r = nullMoveReduction<Rule>(depth);
// ss->currentMove = Pos::PASS;

// (ss + 1)->numNullMoves++;
// board.doPassMove();
// TT.prefetch(board.zobristKey());
// value = -search<Rule, NonPV>(board, ss + 1, -beta, -beta + 1, depth - r, !cutNode);
// board.undoPassMove();
// (ss + 1)->numNullMoves--;

// if (value >= beta) {
// // Do not return unproven mate scores
// if (value >= VALUE_MATE_IN_MAX_PLY)
// value = beta;

// if (std::abs(beta) < VALUE_MATE_IN_MAX_PLY)
// return value;
// else {
// // Do verification search at high depths, with null move pruning disabled
// Value v = search<Rule, NonPV>(board, ss, beta - 1, beta, depth - r, false);
// if (v >= beta)
// return value;
// }
// }
//}

// Step 10. Internal iterative deepening (reduction)
if (!RootNode && PvNode && !ttMove)
Expand Down

0 comments on commit 64b798e

Please sign in to comment.