summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
644f6d4)
Make the eval code in the evaluate_nnue.cpp more similar to the rest of the codebase:
* remove multiple variable assignment
* make if conditions explicit and indent on multiple lines
passed STC
LLR: 2.93 (-2.94,2.94) <-2.50,0.50>
Total: 59032 W: 14834 L: 14751 D: 29447
Ptnml(0-2): 176, 6310, 16459, 6397, 174
https://tests.stockfishchess.org/tests/view/
616f250540f619782fd4f76d
closes https://github.com/official-stockfish/Stockfish/pull/3753
No functional change
// overaligning stack variables with alignas() doesn't work correctly.
constexpr uint64_t alignment = CacheLineSize;
// overaligning stack variables with alignas() doesn't work correctly.
constexpr uint64_t alignment = CacheLineSize;
#if defined(ALIGNAS_ON_STACK_VARIABLES_BROKEN)
TransformedFeatureType transformedFeaturesUnaligned[
#if defined(ALIGNAS_ON_STACK_VARIABLES_BROKEN)
TransformedFeatureType transformedFeaturesUnaligned[
const std::size_t bucket = (pos.count<ALL_PIECES>() - 1) / 4;
const auto psqt = featureTransformer->transform(pos, transformedFeatures, bucket);
const std::size_t bucket = (pos.count<ALL_PIECES>() - 1) / 4;
const auto psqt = featureTransformer->transform(pos, transformedFeatures, bucket);
- const auto output = network[bucket]->propagate(transformedFeatures, buffer);
+ const auto positional = network[bucket]->propagate(transformedFeatures, buffer)[0];
- int materialist = psqt;
- int positional = output[0];
-
- int delta_npm = abs(pos.non_pawn_material(WHITE) - pos.non_pawn_material(BLACK));
- int entertainment = (adjusted && delta_npm <= RookValueMg - BishopValueMg ? 7 : 0);
-
- int A = 128 - entertainment;
- int B = 128 + entertainment;
-
- int sum = (A * materialist + B * positional) / 128;
-
- return static_cast<Value>( sum / OutputScale );
+ // Give more value to positional evaluation when material is balanced
+ if ( adjusted
+ && abs(pos.non_pawn_material(WHITE) - pos.non_pawn_material(BLACK)) <= RookValueMg - BishopValueMg)
+ return static_cast<Value>(((128 - delta) * psqt + (128 + delta) * positional) / 128 / OutputScale);
+ else
+ return static_cast<Value>((psqt + positional) / OutputScale);