From eec361f64c7d28ff3a5add64bddc5a96800f7fba Mon Sep 17 00:00:00 2001 From: mstembera Date: Mon, 8 Jan 2024 01:03:38 -0800 Subject: [PATCH] Simplify bad quiets The main difference is that instead of returning the first bad quiet as a good one we fall through. This is actually more correct and simpler to implement. Non regression STC: https://tests.stockfishchess.org/tests/view/659bbb3479aa8af82b964ec7 LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 150944 W: 38399 L: 38305 D: 74240 Ptnml(0-2): 485, 18042, 38298, 18188, 459 Non regression LTC: https://tests.stockfishchess.org/tests/view/659c6e6279aa8af82b9660eb LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 192060 W: 47871 L: 47823 D: 96366 Ptnml(0-2): 144, 21912, 51845, 22010, 119 The cutoff is now -8K instead of -7.5K. -7.5K failed. https://tests.stockfishchess.org/tests/view/659a1f4b79aa8af82b962a0e This was likely a false negative. closes https://github.com/official-stockfish/Stockfish/pull/4975 Bench: 1308279 --- src/movepick.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index c6532520..e521689e 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -312,19 +312,11 @@ top: return *cur != refutations[0] && *cur != refutations[1] && *cur != refutations[2]; })) { - Move tmp = *(cur - 1); - if ((cur - 1)->value < -7500 && (cur - 1)->value > quiet_threshold(depth)) - { - // Remaining quiets are bad - beginBadQuiets = cur; + if ((cur - 1)->value > -8000 || (cur - 1)->value <= quiet_threshold(depth)) + return *(cur - 1); - // Prepare the pointers to loop over the bad captures - cur = moves; - endMoves = endBadCaptures; - - ++stage; - } - return tmp; + // Remaining quiets are bad + beginBadQuiets = cur - 1; } // Prepare the pointers to loop over the bad captures