Skip to content

Commit a32d208

Browse files
candirufishvondele
authored andcommitted
Use fail high count for LMR
Increase reduction if next ply has a lot of fail high else reset count to 0 Passed STC: https://tests.stockfishchess.org/tests/view/626ea8299116b52aa83b71f6 LLR: 2.94 (-2.94,2.94) <0.00,2.50> Total: 144288 W: 38377 L: 37902 D: 68009 Ptnml(0-2): 565, 16298, 38054, 16551, 676 Passed LTC: https://tests.stockfishchess.org/tests/view/626fa0fb79f761bab2e382f0 LLR: 2.98 (-2.94,2.94) <0.50,3.00> Total: 74872 W: 20050 L: 19686 D: 35136 Ptnml(0-2): 51, 7541, 21893, 7895, 56 closes #4006 bench: 7084802
1 parent 285a79e commit a32d208

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/search.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ namespace {
603603
(ss+1)->ttPv = false;
604604
(ss+1)->excludedMove = bestMove = MOVE_NONE;
605605
(ss+2)->killers[0] = (ss+2)->killers[1] = MOVE_NONE;
606+
(ss+2)->cutoffCnt = 0;
606607
ss->doubleExtensions = (ss-1)->doubleExtensions;
607608
ss->depth = depth;
608609
Square prevSq = to_sq((ss-1)->currentMove);
@@ -1175,6 +1176,10 @@ namespace {
11751176
if (PvNode)
11761177
r -= 1 + 15 / ( 3 + depth );
11771178

1179+
// Increase reduction if next ply has a lot of fail high else reset count to 0
1180+
if ((ss+1)->cutoffCnt > 3 && !PvNode)
1181+
r++;
1182+
11781183
ss->statScore = thisThread->mainHistory[us][from_to(move)]
11791184
+ (*contHist[0])[movedPiece][to_sq(move)]
11801185
+ (*contHist[1])[movedPiece][to_sq(move)]
@@ -1298,11 +1303,15 @@ namespace {
12981303
alpha = value;
12991304
else
13001305
{
1306+
ss->cutoffCnt++;
13011307
assert(value >= beta); // Fail high
13021308
break;
13031309
}
13041310
}
13051311
}
1312+
else
1313+
ss->cutoffCnt = 0;
1314+
13061315

13071316
// If the move is worse than some previously searched move, remember it to update its stats later
13081317
if (move != bestMove)

src/search.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ struct Stack {
5454
bool ttPv;
5555
bool ttHit;
5656
int doubleExtensions;
57+
int cutoffCnt;
5758
};
5859

5960

0 commit comments

Comments
 (0)