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:
Linmiao Xu
2026-04-02 20:32:43 +02:00
committed by Disservin
parent 171afd2b4d
commit 8a1b0f8b04
+3 -4
View File
@@ -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>