]> git.sesse.net Git - stockfish/commit - src/nnue/nnue_feature_transformer.h
Do not use lazy evaluation inside NNUE
authorStéphane Nicolet <cassio@free.fr>
Wed, 26 May 2021 23:10:00 +0000 (01:10 +0200)
committerStéphane Nicolet <cassio@free.fr>
Wed, 26 May 2021 23:21:56 +0000 (01:21 +0200)
commitf193778446acc6e60d7f0f99c6eb01489f89e962
treeb4531b75c06f3a14f918048ce1c824c8a62306f9
parent1b325bf86d02e02af8f693e7e1e70c8be5c7967b
Do not use lazy evaluation inside NNUE

This simplification patch implements two changes:

1. it simplifies away the so-called "lazy" path in the NNUE evaluation internals,
   where we trusted the psqt head alone to avoid the costly "positional" head in
   some cases;
2. it raises a little bit the NNUEThreshold1 in evaluate.cpp (from 682 to 800),
   which increases the limit where we switched from NNUE eval to Classical eval.

Both effects increase the number of positional evaluations done by our new net
architecture, but the results of our tests below seem to indicate that the loss
of speed will be compensated by the gain of eval quality.

STC:
LLR: 2.95 (-2.94,2.94) <-2.50,0.50>
Total: 26280 W: 2244 L: 2137 D: 21899
Ptnml(0-2): 72, 1755, 9405, 1810, 98
https://tests.stockfishchess.org/tests/view/60ae73f112066fd299795a51

LTC:
LLR: 2.95 (-2.94,2.94) <-2.50,0.50>
Total: 20592 W: 750 L: 677 D: 19165
Ptnml(0-2): 9, 614, 8980, 681, 12
https://tests.stockfishchess.org/tests/view/60ae88e812066fd299795a82

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

Bench: 3817907
src/evaluate.cpp
src/evaluate.h
src/nnue/evaluate_nnue.cpp
src/nnue/nnue_feature_transformer.h