Skip to content

Commit

Permalink
use statScore to adjust futility margin (div 300)
Browse files Browse the repository at this point in the history
test r15
  • Loading branch information
dhbloo committed Jun 14, 2024
1 parent 190b2a1 commit df6a02d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rapfi/search/ab/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ template <Rule R>
constexpr Value futilityMargin(Depth d, bool noTTCutNode, bool improving)
{
constexpr int FutilityScale[RULE_NB] = {63, 61, 78};
return Value(std::max(int((FutilityScale[R] - 13 * noTTCutNode) * (d - improving)), 0));
return Value(std::max(int((FutilityScale[R] - 13 * noTTCutNode) * (d - 1 - improving)), 0));
}

/// Null move pruning margin
Expand Down
4 changes: 3 additions & 1 deletion Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,9 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
// Step 8. Futility pruning: child node (~70 elo)
if (!PvNode && eval < VALUE_MATE_IN_MAX_PLY // Do not return unproven wins
&& beta > VALUE_MATED_IN_MAX_PLY // Confirm non-losing move exists
&& eval - futilityMargin<Rule>(depth - 1, cutNode && !ttHit, improvement > 0) >= beta
&& eval - futilityMargin<Rule>(depth, cutNode && !ttHit, improvement > 0)
- (ss - 1)->statScore / 300
>= beta
&& !((ss - 2)->moveP4[self] >= E_BLOCK4 && (ss - 4)->moveP4[self] >= E_BLOCK4))
return eval;

Expand Down

0 comments on commit df6a02d

Please sign in to comment.