Skip to content

Commit

Permalink
Split rfp values (#507)
Browse files Browse the repository at this point in the history
Bench: 10727485
  • Loading branch information
PGG106 authored Jan 28, 2025
1 parent fa1c86a commit 3b02937
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ int AspirationWindowSearch(int prev_eval, int depth, ThreadData* td) {
return score;
}

int futilityMargin(const int depth, const bool improving, const bool canIIR){
return rfpDepthMargin() * depth - rfpImprovingMargin() * improving - rfpIIRMargin() * canIIR;
}

// Negamax alpha beta search
template <bool pvNode>
int Negamax(int alpha, int beta, int depth, const bool cutNode, ThreadData* td, SearchStack* ss) {
Expand Down Expand Up @@ -517,8 +521,8 @@ int Negamax(int alpha, int beta, int depth, const bool cutNode, ThreadData* td,
if ( depth < 10
&& abs(eval) < MATE_FOUND
&& (ttMove == NOMOVE || isTactical(ttMove))
&& eval - rfpMargin() * (depth - improving - canIIR) >= beta)
return eval - rfpMargin() * (depth - improving - canIIR);
&& eval - futilityMargin(depth, improving, canIIR) >= beta)
return eval - futilityMargin(depth, improving, canIIR);

// Null move pruning: If our position is so good that we can give the opponent a free move and still fail high,
// return early. At higher depth we do a reduced search with null move pruning disabled (ie verification search)
Expand Down Expand Up @@ -671,7 +675,7 @@ int Negamax(int alpha, int beta, int depth, const bool cutNode, ThreadData* td,
skipQuiets = true;
}
}
int see_margin = isQuiet ? seeQuietMargin() * lmrDepth : seeNoisyMargin() * lmrDepth * lmrDepth;
int see_margin = isQuiet ? seeQuietMargin() * lmrDepth : seeNoisyMargin() * lmrDepth * lmrDepth;
// See pruning: prune all the moves that have a SEE score that is lower than our threshold
if (!SEE(pos, move, see_margin))
continue;
Expand Down
4 changes: 3 additions & 1 deletion src/tune.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ TUNE_PARAM(nodeTmMultiplier, 183, 80, 250, 8, 0.002)


// Search
TUNE_PARAM(rfpMargin, 79, 40, 200, 10, 0.002)
TUNE_PARAM(rfpDepthMargin, 79, 40, 200, 10, 0.002)
TUNE_PARAM(rfpImprovingMargin, 79, 40, 200, 10, 0.002)
TUNE_PARAM(rfpIIRMargin, 79, 40, 200, 10, 0.002)
TUNE_PARAM(nmpReductionEvalDivisor, 195, 100, 400, 20, 0.002)
TUNE_PARAM(razoringCoeff, 243, 100, 400, 20, 0.002)
TUNE_PARAM(historyQuietLmrDivisor, 8177, 1, 16383, 100, 0.002)
Expand Down

0 comments on commit 3b02937

Please sign in to comment.