mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Remove simple eval
With the recent introduction of the dual NNUE, the need for simple eval is no longer there. Passed STC: https://tests.stockfishchess.org/tests/view/65c1f735c865510db0281652 LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 85312 W: 22009 L: 21837 D: 41466 Ptnml(0-2): 334, 10155, 21567, 10205, 395 Passed LTC: https://tests.stockfishchess.org/tests/view/65c2d64bc865510db0282810 LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 49956 W: 12596 L: 12402 D: 24958 Ptnml(0-2): 28, 5553, 13624, 5743, 30 closes https://github.com/official-stockfish/Stockfish/pull/5037 Bench 1213676
This commit is contained in:
parent
f2984471c9
commit
c0107b3c27
1 changed files with 12 additions and 21 deletions
|
@ -199,33 +199,24 @@ Value Eval::evaluate(const Position& pos, int optimism) {
|
|||
|
||||
assert(!pos.checkers());
|
||||
|
||||
int v;
|
||||
Color stm = pos.side_to_move();
|
||||
int shuffling = pos.rule50_count();
|
||||
int simpleEval = simple_eval(pos, stm);
|
||||
int simpleEval = simple_eval(pos, pos.side_to_move());
|
||||
bool smallNet = std::abs(simpleEval) > 1050;
|
||||
|
||||
bool lazy = std::abs(simpleEval) > 2550;
|
||||
if (lazy)
|
||||
v = simpleEval;
|
||||
else
|
||||
{
|
||||
bool smallNet = std::abs(simpleEval) > 1050;
|
||||
int nnueComplexity;
|
||||
|
||||
int nnueComplexity;
|
||||
Value nnue = smallNet ? NNUE::evaluate<NNUE::Small>(pos, true, &nnueComplexity)
|
||||
: NNUE::evaluate<NNUE::Big>(pos, true, &nnueComplexity);
|
||||
|
||||
Value nnue = smallNet ? NNUE::evaluate<NNUE::Small>(pos, true, &nnueComplexity)
|
||||
: NNUE::evaluate<NNUE::Big>(pos, true, &nnueComplexity);
|
||||
// Blend optimism and eval with nnue complexity and material imbalance
|
||||
optimism += optimism * (nnueComplexity + std::abs(simpleEval - nnue)) / 512;
|
||||
nnue -= nnue * (nnueComplexity + std::abs(simpleEval - nnue)) / 32768;
|
||||
|
||||
// Blend optimism and eval with nnue complexity and material imbalance
|
||||
optimism += optimism * (nnueComplexity + std::abs(simpleEval - nnue)) / 512;
|
||||
nnue -= nnue * (nnueComplexity + std::abs(simpleEval - nnue)) / 32768;
|
||||
|
||||
int npm = pos.non_pawn_material() / 64;
|
||||
v = (nnue * (915 + npm + 9 * pos.count<PAWN>()) + optimism * (154 + npm)) / 1024;
|
||||
}
|
||||
int npm = pos.non_pawn_material() / 64;
|
||||
int v = (nnue * (915 + npm + 9 * pos.count<PAWN>()) + optimism * (154 + npm)) / 1024;
|
||||
|
||||
// Damp down the evaluation linearly when shuffling
|
||||
v = v * (200 - shuffling) / 214;
|
||||
int shuffling = pos.rule50_count();
|
||||
v = v * (200 - shuffling) / 214;
|
||||
|
||||
// Guarantee evaluation does not hit the tablebase range
|
||||
v = std::clamp(int(v), VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1);
|
||||
|
|
Loading…
Add table
Reference in a new issue