Remove delta, adjusted, complexity from nnue code

...rather they're the consumer's concern whether to tweak the result or not.

Passed STC:
https://tests.stockfishchess.org/tests/view/665cea9ffd45fb0f907c53bd
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 69696 W: 18101 L: 17918 D: 33677
Ptnml(0-2): 195, 8171, 17929, 8362, 191

Passed LTC:
https://tests.stockfishchess.org/tests/view/665cf761fd45fb0f907c5406
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 63720 W: 16344 L: 16165 D: 31211
Ptnml(0-2): 32, 6990, 17625, 7193, 20

Non functional except for rounding issues of OutputScale changing bench.

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

Bench: 1378596
This commit is contained in:
Dubslow
2024-06-02 16:55:10 -05:00
committed by Disservin
parent 397f47a7a1
commit 86b564055d
4 changed files with 31 additions and 33 deletions
+8 -5
View File
@@ -28,6 +28,7 @@
#include <iostream>
#include <sstream>
#include <string_view>
#include <tuple>
#include "../evaluate.h"
#include "../position.h"
@@ -131,8 +132,9 @@ trace(Position& pos, const Eval::NNUE::Networks& networks, Eval::NNUE::Accumulat
// We estimate the value of each piece by doing a differential evaluation from
// the current base eval, simulating the removal of the piece from its square.
Value base = networks.big.evaluate(pos, &caches.big);
base = pos.side_to_move() == WHITE ? base : -base;
auto [psqt, positional] = networks.big.evaluate(pos, &caches.big);
Value base = psqt + positional;
base = pos.side_to_move() == WHITE ? base : -base;
for (File f = FILE_A; f <= FILE_H; ++f)
for (Rank r = RANK_1; r <= RANK_8; ++r)
@@ -148,9 +150,10 @@ trace(Position& pos, const Eval::NNUE::Networks& networks, Eval::NNUE::Accumulat
pos.remove_piece(sq);
st->accumulatorBig.computed[WHITE] = st->accumulatorBig.computed[BLACK] = false;
Value eval = networks.big.evaluate(pos, &caches.big);
eval = pos.side_to_move() == WHITE ? eval : -eval;
v = base - eval;
std::tie(psqt, positional) = networks.big.evaluate(pos, &caches.big);
Value eval = psqt + positional;
eval = pos.side_to_move() == WHITE ? eval : -eval;
v = base - eval;
pos.put_piece(pc, sq);
st->accumulatorBig.computed[WHITE] = st->accumulatorBig.computed[BLACK] = false;