29
29
30
30
int lmr_reductions_array[64 ][64 ]{0 };
31
31
32
- std::atomic_bool SEARCH_ABORT = ATOMIC_VAR_INIT(false );
32
+ int lmp_margin[64 ][2 ]{0 };
33
+ int quiet_lmp_margin[64 ]{0 };
33
34
34
- constexpr int see_pruning_margins[5 ] {
35
+ constexpr int see_pruning_margins[5 ]
36
+ {
35
37
0 , -100 , -100 , -300 , -325
36
38
};
37
39
@@ -168,6 +170,9 @@ namespace
168
170
}
169
171
170
172
int eval = tthit ? entry.seval : eval_position (position);
173
+ search.eval [search.stats .ply ] = eval;
174
+
175
+ bool improving = eval > search.eval [std::max (0 , search.stats .ply - 2 )];
171
176
172
177
if (!at_root && !in_check && depth < 6 && (eval - depth * 170 ) >= beta)
173
178
return eval;
@@ -192,10 +197,10 @@ namespace
192
197
193
198
for (Move move; picker.next (move);)
194
199
{
195
- if (move_num > 3 + depth * depth )
200
+ if (move_num > lmp_margin[ depth][improving] )
196
201
picker.skip_quiets = true ;
197
202
198
- if (picker.stage >= MovePicker::Stage::GiveQuiet && move_num > depth * depth + 2 )
203
+ if (picker.stage >= MovePicker::Stage::GiveQuiet && move_num > quiet_lmp_margin[ depth] )
199
204
break ;
200
205
201
206
if (depth < 5 && move_is_capture (position, move) && move.score < see_pruning_margins[depth])
@@ -343,6 +348,10 @@ namespace Search
343
348
{
344
349
lmr_reductions_array[i][j] = log (i) * log (j);
345
350
}
351
+
352
+ lmp_margin[i][0 ] = 3 + i * i;
353
+ lmp_margin[i][1 ] = 3 + i * i / 1.5 ;
354
+ quiet_lmp_margin[i] = 2 + i * i;
346
355
}
347
356
}
348
357
0 commit comments