Skip to content

Commit 74776db

Browse files
snicoletvondele
authored andcommitted
Simplification in evaluate_nnue.cpp
Removes the test on non-pawn-material before applying the positional/materialistic bonus. Passed STC: LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 46904 W: 12197 L: 12059 D: 22648 Ptnml(0-2): 170, 5243, 12479, 5399, 161 https://tests.stockfishchess.org/tests/view/61be57cf57a0d0f327c3999d Passed LTC: LLR: 2.95 (-2.94,2.94) <-2.25,0.25> Total: 18760 W: 4958 L: 4790 D: 9012 Ptnml(0-2): 14, 1942, 5301, 2108, 15 https://tests.stockfishchess.org/tests/view/61bed1fb57a0d0f327c3afa9 closes #3866 Bench: 4826206
1 parent ca51b45 commit 74776db

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/nnue/evaluate_nnue.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,11 @@ namespace Stockfish::Eval::NNUE {
165165
const auto psqt = featureTransformer->transform(pos, transformedFeatures, bucket);
166166
const auto positional = network[bucket]->propagate(transformedFeatures, buffer)[0];
167167

168-
// Give more value to positional evaluation when material is balanced
169-
if ( adjusted
170-
&& abs(pos.non_pawn_material(WHITE) - pos.non_pawn_material(BLACK)) <= RookValueMg - BishopValueMg)
171-
return static_cast<Value>(((128 - delta) * psqt + (128 + delta) * positional) / 128 / OutputScale);
168+
// Give more value to positional evaluation when adjusted flag is set
169+
if (adjusted)
170+
return static_cast<Value>(((128 - delta) * psqt + (128 + delta) * positional) / 128 / OutputScale);
172171
else
173-
return static_cast<Value>((psqt + positional) / OutputScale);
172+
return static_cast<Value>((psqt + positional) / OutputScale);
174173
}
175174

176175
struct NnueEvalTrace {

0 commit comments

Comments
 (0)