1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00
BadFish/src
Shahin M. Shahin a4fedd8152 Fix greater than TB scores in null move pruning.
This patch is a simplification and a fix to dealing with null moves scores that returns proven mates or TB scores by preventing 'null move pruning' if the nullvalue is in that range.

Current solution downgrades nullValues on the non-PV node but the value can be used in a transposed PV-node to the same position afterwards (Triangulation), the later is prone to propagate a wrong score (96.05) to root that will not be refuted unless we search further.

Score of (96.05) can be obtained be two methods,

maxim static-eval returned on Pv update (mostly qSearch)
this downgrade (clamp) in NMP
and theoretically can happen with or without TBs but the second scenario is more dangerous than the first.
This fixes the reproducible case in very common scenarios with TBs as shown in the debugging at discord.

Fixes: #4699

Passed STC:
https://tests.stockfishchess.org/tests/view/64c1eca8dc56e1650abba6f9
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 670048 W: 171132 L: 171600 D: 327316
Ptnml(0-2): 2134, 75687, 179820, 75279, 2104

Passed LTC:
https://tests.stockfishchess.org/tests/view/64c5e130dc56e1650abc0438
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 92868 W: 23642 L: 23499 D: 45727
Ptnml(0-2): 52, 9509, 27171, 9648, 54

closes https://github.com/official-stockfish/Stockfish/pull/4715

Bench: 1327410
2023-10-21 10:01:26 +02:00
..
incbin Change mode of incbin.h 2023-03-14 08:23:50 +01:00
nnue Optimize the most common update accumalator cases w/o tiling 2023-10-08 07:42:39 +02:00
syzygy Use C++17 variable templates for type traits 2023-09-29 22:22:40 +02:00
benchmark.cpp Avoid "using namespace std" 2023-09-11 22:07:55 +02:00
benchmark.h Warn if a global function has no previous declaration 2023-01-09 20:18:39 +01:00
bitboard.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
bitboard.h Improve grammar of comments 2023-09-29 22:18:17 +02:00
evaluate.cpp Simplify pawn count in evaluation 2023-09-29 22:12:46 +02:00
evaluate.h Update default net to nn-0000000000a0.nnue 2023-09-29 22:30:27 +02:00
main.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
Makefile Remove handcrafted MMX code 2023-10-08 07:37:01 +02:00
misc.cpp Remove handcrafted MMX code 2023-10-08 07:37:01 +02:00
misc.h Optimize the most common update accumalator cases w/o tiling 2023-10-08 07:42:39 +02:00
movegen.cpp Make casting styles consistent 2023-09-22 19:14:29 +02:00
movegen.h Improve grammar of comments 2023-09-29 22:18:17 +02:00
movepick.cpp Use more continuation histories. 2023-10-14 16:52:35 +02:00
movepick.h Use C++17 variable templates for type traits 2023-09-29 22:22:40 +02:00
position.cpp Remove unused see_ge() code 2023-09-29 22:19:08 +02:00
position.h Remove unused see_ge() code 2023-09-29 22:19:08 +02:00
search.cpp Fix greater than TB scores in null move pruning. 2023-10-21 10:01:26 +02:00
search.h Cleanup includes 2023-09-03 08:24:51 +02:00
thread.cpp Introduce simple_eval() for lazy evaluations 2023-09-03 09:28:16 +02:00
thread.h Introduce simple_eval() for lazy evaluations 2023-09-03 09:28:16 +02:00
thread_win32_osx.h Modernize code base a little bit 2023-01-09 20:25:13 +01:00
timeman.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
timeman.h Cleanup includes 2023-09-03 08:24:51 +02:00
tt.cpp Make casting styles consistent 2023-09-22 19:14:29 +02:00
tt.h Make casting styles consistent 2023-09-22 19:14:29 +02:00
tune.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
tune.h Use C++17 variable templates for type traits 2023-09-29 22:22:40 +02:00
types.h Improve grammar of comments 2023-09-29 22:18:17 +02:00
uci.cpp Improve grammar of comments 2023-09-29 22:18:17 +02:00
uci.h Cleanup includes 2023-09-03 08:24:51 +02:00
ucioption.cpp Cleanup includes 2023-09-03 08:24:51 +02:00