Skip to content

Commit e972afd

Browse files
committed
Increase depth reduction by 1 and clamp depth after reductino for lmr. Bench: 7248771
1 parent c24d71c commit e972afd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Bit-Genie/src/search.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,13 @@ namespace
186186
bool quiet = !move_is_capture(position, move);
187187

188188
int R = lmr_reductions_array[quiet][std::min(move_num, 31)];
189+
int new_depth = depth - 1;
189190

190191
R -= pv_node;
191192

192-
score = -pvs(position, search, tt, depth - R, -alpha - 1, -alpha, false, false).score;
193+
int RDepth = std::clamp(new_depth - R, 1, new_depth - 1);
194+
195+
score = -pvs(position, search, tt, RDepth, -alpha - 1, -alpha, false, false).score;
193196

194197
if (score > alpha)
195198
score = -pvs(position, search, tt, depth - 1, -beta, -alpha, false).score;

0 commit comments

Comments
 (0)