Skip to content

Commit c27c174

Browse files
jake-ciolekvondele
authored andcommitted
qsearch: prevent bestValue from going down
The bestValue can sometimes go down. This happens 2% of the time or so. This fix stops it from decreasing. Failed gainer STC: LLR: -2.94 (-2.94,2.94) <0.00,2.00> Total: 146176 W: 37930 L: 37976 D: 70270 Ptnml(0-2): 480, 17422, 37366, 17304, 516 https://tests.stockfishchess.org/tests/view/6953be19572093c1986da66a Passed Non-regression LTC: LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 257796 W: 65662 L: 65683 D: 126451 Ptnml(0-2): 164, 28247, 72087, 28246, 154 https://tests.stockfishchess.org/tests/view/69554ff0d844c1ce7cc7e333 closes official-stockfish#6520 fixes official-stockfish#6519 Bench: 2477446
1 parent 8be6b14 commit c27c174

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Hongzhi Cheng
111111
Ivan Ivec (IIvec)
112112
Jacques B. (Timshel)
113113
Jake Senne (w1wwwwww)
114+
Jakub Ciolek (jake-ciolek)
114115
Jan Ondruš (hxim)
115116
Jared Kish (Kurtbusch, kurt22i)
116117
Jarrod Torriero (DU-jdto)

src/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
16531653
// we can prune this move.
16541654
if (!pos.see_ge(move, alpha - futilityBase))
16551655
{
1656-
bestValue = std::min(alpha, futilityBase);
1656+
bestValue = std::max(bestValue, std::min(alpha, futilityBase));
16571657
continue;
16581658
}
16591659
}

0 commit comments

Comments
 (0)