Skip to content

Commit 8dea070

Browse files
Vizvezdenecvondele
authored andcommitted
Move internal iterative reduction before probcut
This patch moves IIR before probcut which allows probcut to be produced at lower depths. Comments in IIR are also slightly updated. Passed STC: https://tests.stockfishchess.org/tests/view/6472d604d29264e4cfa749fd LLR: 2.94 (-2.94,2.94) <0.00,2.00> Total: 387616 W: 103295 L: 102498 D: 181823 Ptnml(0-2): 976, 42322, 106381, 43187, 942 Passed LTC: https://tests.stockfishchess.org/tests/view/6475eb8c4a36543c4c9f42e8 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 202836 W: 54901 L: 54281 D: 93654 Ptnml(0-2): 85, 19609, 61422, 20205, 97 closes #4597 bench 2551691
1 parent ced0311 commit 8dea070

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/search.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,24 @@ namespace {
822822
}
823823
}
824824

825+
// Step 10. If the position doesn't a have ttMove, decrease depth by 2
826+
// (or by 4 if the TT entry for the current position was hit and the stored depth is greater than or equal to the current depth).
827+
// Use qsearch if depth is equal or below zero (~9 Elo)
828+
if ( PvNode
829+
&& !ttMove)
830+
depth -= 2 + 2 * (ss->ttHit && tte->depth() >= depth);
831+
832+
if (depth <= 0)
833+
return qsearch<PV>(pos, ss, alpha, beta);
834+
835+
if ( cutNode
836+
&& depth >= 8
837+
&& !ttMove)
838+
depth -= 2;
839+
825840
probCutBeta = beta + 168 - 61 * improving;
826841

827-
// Step 10. ProbCut (~10 Elo)
842+
// Step 11. ProbCut (~10 Elo)
828843
// If we have a good enough capture (or queen promotion) and a reduced search returns a value
829844
// much above beta, we can (almost) safely prune the previous move.
830845
if ( !PvNode
@@ -875,20 +890,6 @@ namespace {
875890
Eval::NNUE::hint_common_parent_position(pos);
876891
}
877892

878-
// Step 11. If the position is not in TT, decrease depth by 2 (or by 4 if the TT entry for the current position was hit and the stored depth is greater than or equal to the current depth).
879-
// Use qsearch if depth is equal or below zero (~9 Elo)
880-
if ( PvNode
881-
&& !ttMove)
882-
depth -= 2 + 2 * (ss->ttHit && tte->depth() >= depth);
883-
884-
if (depth <= 0)
885-
return qsearch<PV>(pos, ss, alpha, beta);
886-
887-
if ( cutNode
888-
&& depth >= 8
889-
&& !ttMove)
890-
depth -= 2;
891-
892893
moves_loop: // When in check, search starts here
893894

894895
// Step 12. A small Probcut idea, when we are in check (~4 Elo)

0 commit comments

Comments
 (0)