Skip to content

Commit beaadd6

Browse files
vondelesnicolet
authored andcommitted
Correctly prevent recursive verification in nmp.
As discussed with @pb00068, the condition to prevent recursive verification was not completely correct. This patch corrects that condition, and adds an assert. In the current implementation, recursive verification needs to be avoided in order not to break the verification of the move closer to the root (i.e. to not set thisThread->nmp_min_ply to zero prematurely). This patch is tested as a bug fix, based on and tested against PR #1609 . passed STC: http://tests.stockfishchess.org/tests/view/5b050f170ebc5914abc129c5 LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 7875 W: 1669 L: 1523 D: 4683 passed LTC: http://tests.stockfishchess.org/tests/view/5b0513970ebc5914abc129cd LLR: 3.00 (-2.94,2.94) [-3.00,1.00] Total: 24048 W: 3525 L: 3407 D: 17116 Bench changes at high depth. Closes #1610 and #1609 Bench: 4484288
1 parent d702203 commit beaadd6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/search.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,13 @@ namespace {
773773
if (nullValue >= VALUE_MATE_IN_MAX_PLY)
774774
nullValue = beta;
775775

776-
if (abs(beta) < VALUE_KNOWN_WIN && (depth < 12 * ONE_PLY || thisThread->nmp_min_ply))
776+
if (thisThread->nmp_min_ply || (abs(beta) < VALUE_KNOWN_WIN && depth < 12 * ONE_PLY))
777777
return nullValue;
778778

779-
// Do verification search at high depths. Disable null move pruning
780-
// for side to move for the first part of the remaining search tree.
779+
assert(!thisThread->nmp_min_ply); // Recursive verification is not allowed
780+
781+
// Do verification search at high depths, with null move pruning disabled
782+
// for us, until ply exceeds nmp_min_ply.
781783
thisThread->nmp_min_ply = ss->ply + 3 * (depth-R) / 4 - 1;
782784
thisThread->nmp_color = us;
783785

0 commit comments

Comments
 (0)