mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Reorder NNUE accumulator evals
Makes eval calls more cache-friendly on a hot path. Hints of a speedup found locally: ``` Result of 30 runs ================== base (...ockfish-base) = 1754124 +/- 2887 test (...h-eval-order) = 1757848 +/- 2412 diff = +3724 +/- 1368 speedup = +0.0021 P(speedup > 0) = 1.0000 CPU: 16 x arm Hyperthreading: off ``` Passed STC: https://tests.stockfishchess.org/tests/view/69c84f3cf40d95b975597c21 LLR: 3.36 (-2.94,2.94) <0.00,2.00> Total: 335840 W: 87022 L: 86257 D: 162561 Ptnml(0-2): 932, 36760, 91816, 37435, 977 closes https://github.com/official-stockfish/Stockfish/pull/6693 No functional change
This commit is contained in:
@@ -145,14 +145,13 @@ void AccumulatorStack::evaluate(const Position& pos,
|
||||
constexpr bool UseThreats = (Dimensions == TransformedFeatureDimensionsBig);
|
||||
|
||||
evaluate_side<PSQFeatureSet>(WHITE, pos, featureTransformer, cache);
|
||||
|
||||
if (UseThreats)
|
||||
evaluate_side<ThreatFeatureSet>(WHITE, pos, featureTransformer, cache);
|
||||
|
||||
evaluate_side<PSQFeatureSet>(BLACK, pos, featureTransformer, cache);
|
||||
|
||||
if (UseThreats)
|
||||
{
|
||||
evaluate_side<ThreatFeatureSet>(WHITE, pos, featureTransformer, cache);
|
||||
evaluate_side<ThreatFeatureSet>(BLACK, pos, featureTransformer, cache);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FeatureSet, IndexType Dimensions>
|
||||
|
||||
Reference in New Issue
Block a user