Skip to content

Commit

Permalink
extra reduction for very likely fail high
Browse files Browse the repository at this point in the history
test r15
  • Loading branch information
dhbloo committed Jun 13, 2024
1 parent fa863d2 commit 93250c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,8 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
// Fail-High reduction (~50 elo)
// Indicate cutNode that will probably fail high if current eval is far above beta
bool likelyFailHigh = !PvNode && cutNode && eval >= beta + failHighMargin<Rule>(depth, oppo4);
bool veryLikelyFailHigh =
!PvNode && cutNode && eval >= beta + 2 * failHighMargin<Rule>(depth, oppo4);

MovePicker mp(Rule,
board,
Expand Down Expand Up @@ -1076,13 +1078,15 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
extension += (distSelf <= 4 ? 0.20f : 0.05f);
}

// Fail high reduction
// Fail High Reduction/Extension
if (likelyFailHigh) {
if (ss->moveP4[self] >= E_BLOCK4) {
// If we failed high for two continous E_BLOCK4 moves, extend rather than reduce
if ((ss - 2)->moveP4[self] >= E_BLOCK4)
extension += 1.0f;
}
else if (ss->moveP4[self] < H_FLEX3 && veryLikelyFailHigh)
extension -= 2.0f;
else
extension -= 1.0f;
}
Expand Down

0 comments on commit 93250c3

Please sign in to comment.