Skip to content

Commit 2e91a86

Browse files
locutus2vondele
authored andcommitted
Add log depth as term to reduction factors.
Replace most reduction factors with a linear term of the form X + Y * msb(depth) (using msb(depth) as simple and fast approximation for log(depth)) and tune the weights with following SPSA test: https://tests.stockfishchess.org/tests/view/689903860049e8ccef9d6415. Here the tuned values of X[8] and Y[8] were ignored because a simple test with this parameters alone failed badly (https://tests.stockfishchess.org/tests/view/68992b350049e8ccef9d6482). Passed STC: LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 32448 W: 8651 L: 8342 D: 15455 Ptnml(0-2): 81, 3695, 8408, 3914, 126 https://tests.stockfishchess.org/tests/view/6899489b0049e8ccef9d64ad Passed LTC: LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 73854 W: 19042 L: 18649 D: 36163 Ptnml(0-2): 37, 7908, 20659, 8271, 52 https://tests.stockfishchess.org/tests/view/689abbe7fd8719b088c8d514 closes #6229 Bench: 3151102
1 parent 0383670 commit 2e91a86

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/search.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,27 +1178,27 @@ Value Search::Worker::search(
11781178

11791179
// These reduction adjustments have no proven non-linear scaling
11801180

1181-
r += 650; // Base reduction offset to compensate for other tweaks
1182-
r -= moveCount * 69;
1181+
r += 679 - 6 * msb(depth); // Base reduction offset to compensate for other tweaks
1182+
r -= moveCount * (67 - 2 * msb(depth));
11831183
r -= std::abs(correctionValue) / 27160;
11841184

11851185
// Increase reduction for cut nodes
11861186
if (cutNode)
1187-
r += 3000 + 1024 * !ttData.move;
1187+
r += 2998 + 2 * msb(depth) + (948 + 14 * msb(depth)) * !ttData.move;
11881188

11891189
// Increase reduction if ttMove is a capture
11901190
if (ttCapture)
1191-
r += 1350;
1191+
r += 1402 - 39 * msb(depth);
11921192

11931193
// Increase reduction if next ply has a lot of fail high
11941194
if ((ss + 1)->cutoffCnt > 2)
1195-
r += 935 + allNode * 763;
1195+
r += 925 + 33 * msb(depth) + allNode * (701 + 224 * msb(depth));
11961196

11971197
r += (ss + 1)->quietMoveStreak * 51;
11981198

11991199
// For first picked move (ttMove) reduce reduction
12001200
if (move == ttData.move)
1201-
r -= 2043;
1201+
r -= 2121 + 28 * msb(depth);
12021202

12031203
if (capture)
12041204
ss->statScore = 782 * int(PieceValue[pos.captured_piece()]) / 128
@@ -1209,7 +1209,7 @@ Value Search::Worker::search(
12091209
+ (*contHist[1])[movedPiece][move.to_sq()];
12101210

12111211
// Decrease/increase reduction for moves with a good/bad history
1212-
r -= ss->statScore * 789 / 8192;
1212+
r -= ss->statScore * (729 - 12 * msb(depth)) / 8192;
12131213

12141214
// Step 17. Late moves reduction / extension (LMR)
12151215
if (depth >= 2 && moveCount > 1)
@@ -1250,7 +1250,7 @@ Value Search::Worker::search(
12501250
{
12511251
// Increase reduction if ttMove is not present
12521252
if (!ttData.move)
1253-
r += 1139;
1253+
r += 1199 + 35 * msb(depth);
12541254

12551255
const int threshold1 = depth <= 4 ? 2000 : 3200;
12561256
const int threshold2 = depth <= 4 ? 3500 : 4600;

0 commit comments

Comments
 (0)