Skip to content

Commit 1566357

Browse files
committed
Fix a 'value > VALUE_INFINITE' assert
This fixes an assert while testing with debug on. Assert was due to static null pruning returning value eval - futility_margin(depth, (ss-1)->futilityMoveCount) That was sometimes higher than VALUE_INFINITE triggering an assert at the caller site. Because eval con be equal to ttValue and anyhow is read from TT that can be corrupted in SMP case, we need to sanity check it before to use. bench: 4176431
1 parent 083fe58 commit 1566357

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/search.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ namespace {
646646
&& !inCheck
647647
&& eval - futility_margin(depth, (ss-1)->futilityMoveCount) >= beta
648648
&& abs(beta) < VALUE_MATE_IN_MAX_PLY
649+
&& abs(eval) < VALUE_KNOWN_WIN
649650
&& pos.non_pawn_material(pos.side_to_move()))
650651
return eval - futility_margin(depth, (ss-1)->futilityMoveCount);
651652

0 commit comments

Comments
 (0)