Skip to content

Commit 3d63fc9

Browse files
committed
Bench: 6111415
1 parent 8843531 commit 3d63fc9

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/search.cpp

+13-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929

3030
int lmr_reductions_array[64][64]{0};
3131

32-
std::atomic_bool SEARCH_ABORT = ATOMIC_VAR_INIT(false);
32+
int lmp_margin[64][2]{0};
33+
int quiet_lmp_margin[64]{0};
3334

34-
constexpr int see_pruning_margins[5] {
35+
constexpr int see_pruning_margins[5]
36+
{
3537
0, -100, -100, -300, -325
3638
};
3739

@@ -168,6 +170,9 @@ namespace
168170
}
169171

170172
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)];
171176

172177
if (!at_root && !in_check && depth < 6 && (eval - depth * 170) >= beta)
173178
return eval;
@@ -192,10 +197,10 @@ namespace
192197

193198
for (Move move; picker.next(move);)
194199
{
195-
if (move_num > 3 + depth * depth)
200+
if (move_num > lmp_margin[depth][improving])
196201
picker.skip_quiets = true;
197202

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])
199204
break;
200205

201206
if (depth < 5 && move_is_capture(position, move) && move.score < see_pruning_margins[depth])
@@ -343,6 +348,10 @@ namespace Search
343348
{
344349
lmr_reductions_array[i][j] = log(i) * log(j);
345350
}
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;
346355
}
347356
}
348357

src/search.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ namespace Search
3333
HistoryTable history = {0};
3434
HistoryTable capture_history = {0};
3535

36+
int eval[64] = {0};
37+
3638
void update();
3739
};
3840

3941
void init();
4042
uint64_t bestmove(Info&, bool log);
4143
}
4244

43-
extern std::atomic_bool SEARCH_ABORT;
45+
inline std::atomic_bool SEARCH_ABORT = ATOMIC_VAR_INIT(false);

src/uci.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "polyglot.h"
2828
#include <cstring>
2929

30-
const char *version = "7.41";
30+
const char *version = "7.42";
3131

3232
namespace
3333
{

0 commit comments

Comments
 (0)