Skip to content

Commit 012f20d

Browse files
committed
Fix an assert in Probcut
When running the following position: 8/kPp5/2P3p1/p1P1p1P1/2PpPp2/3p1p2/3P1P2/5K2 w - - 0 1 An assert is raised at depth 92: assert(-VALUE_INFINITE <= alpha && alpha < beta && beta <= VALUE_INFINITE); This is because it happens that beta = 29832, so rbeta = 30032 that is > VALUE_INFINITE Bug spotted and analyzed by Uri, fix suggested by Joerg. Other fixes where possible but this one is pointed exactly at the source of the bug, so it is the best from a code documentation point of view. bench: 8430785
1 parent b8cfc25 commit 012f20d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ namespace {
668668
&& !ss->skipNullMove
669669
&& abs(beta) < VALUE_MATE_IN_MAX_PLY)
670670
{
671-
Value rbeta = beta + 200;
671+
Value rbeta = std::min(beta + 200, VALUE_INFINITE);
672672
Depth rdepth = depth - ONE_PLY - 3 * ONE_PLY;
673673

674674
assert(rdepth >= ONE_PLY);

0 commit comments

Comments
 (0)