1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00
BadFish/src
Stéphane Nicolet b25d68f6ee Introduce simple_eval() for lazy evaluations
This patch implements the pure materialistic evaluation called simple_eval()
to gain a speed-up during Stockfish search.

We use the so-called lazy evaluation trick: replace the accurate but slow
NNUE network evaluation by the super-fast simple_eval() if the position
seems to be already won (high material advantage). To guard against some
of the most obvious blunders introduced by this idea, this patch uses the
following features which will raise the lazy evaluation threshold in some
situations:

- avoid lazy evals on shuffling branches in the search tree
- avoid lazy evals if the position at root already has a material imbalance
- avoid lazy evals if the search value at root is already winning/losing.

Moreover, we add a small random noise to the simple_eval() term. This idea
(stochastic mobility in the minimax tree) was worth about 200 Elo in the pure
simple_eval() player on Lichess.

Overall, the current implementation in this patch evaluates about 2% of the
leaves in the search tree lazily.

--------------------------------------------

STC:
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 60352 W: 15585 L: 15234 D: 29533
Ptnml(0-2): 216, 6906, 15578, 7263, 213
https://tests.stockfishchess.org/tests/view/64f1d9bcbd9967ffae366209

LTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 35106 W: 8990 L: 8678 D: 17438
Ptnml(0-2): 14, 3668, 9887, 3960, 24
https://tests.stockfishchess.org/tests/view/64f25204f5b0c54e3f04c0e7

verification run at VLTC:
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 74362 W: 19088 L: 18716 D: 36558
Ptnml(0-2): 6, 7226, 22348, 7592, 9
https://tests.stockfishchess.org/tests/view/64f2ecdbf5b0c54e3f04d3ae

All three tests above were run with adjudication off, we also verified that
there was no regression on matetracker (thanks Disservin!).

----------------------------------------------

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

Bench: 1393714
2023-09-03 09:28:16 +02:00
..
incbin Change mode of incbin.h 2023-03-14 08:23:50 +01:00
nnue Cleanup includes 2023-09-03 08:24:51 +02:00
syzygy Cleanup includes 2023-09-03 08:24:51 +02:00
benchmark.cpp Cleanup includes 2023-09-03 08:24:51 +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 Cleanup includes 2023-09-03 08:24:51 +02:00
evaluate.cpp Introduce simple_eval() for lazy evaluations 2023-09-03 09:28:16 +02:00
evaluate.h Introduce simple_eval() for lazy evaluations 2023-09-03 09:28:16 +02:00
main.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
Makefile Fix some tabs in Makefile 2023-08-22 10:59:39 +02:00
misc.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
misc.h Cleanup includes 2023-09-03 08:24:51 +02:00
movegen.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
movegen.h Cleanup includes 2023-09-03 08:24:51 +02:00
movepick.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
movepick.h Cleanup includes 2023-09-03 08:24:51 +02:00
position.cpp Simplify slider_blocker calculation 2023-09-03 08:57:43 +02:00
position.h Simplify slider_blocker calculation 2023-09-03 08:57:43 +02:00
search.cpp Rename one variable 2023-09-03 09:10:27 +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 Cleanup includes 2023-09-03 08:24:51 +02:00
tt.h Cleanup includes 2023-09-03 08:24:51 +02:00
tune.cpp Cleanup includes 2023-09-03 08:24:51 +02:00
tune.h Cleanup includes 2023-09-03 08:24:51 +02:00
types.h Cleanup includes 2023-09-03 08:24:51 +02:00
uci.cpp Cleanup includes 2023-09-03 08:24:51 +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