From bb752eb2f6d55704ddb1bd3dcead348716b1a972 Mon Sep 17 00:00:00 2001 From: anematode Date: Thu, 9 Apr 2026 21:41:46 +0200 Subject: [PATCH] Remove step in update_accumulator_refresh_cache Passed simplification STC https://tests.stockfishchess.org/tests/live_elo/69c9c050a54395a76133504c LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 304544 W: 78502 L: 78574 D: 147468 Ptnml(0-2): 906, 33590, 83358, 33506, 912 closes https://github.com/official-stockfish/Stockfish/pull/6697 No functional change --- src/nnue/nnue_accumulator.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/nnue/nnue_accumulator.cpp b/src/nnue/nnue_accumulator.cpp index 554060dd8..ca1dcdc24 100644 --- a/src/nnue/nnue_accumulator.cpp +++ b/src/nnue/nnue_accumulator.cpp @@ -746,20 +746,7 @@ void update_accumulator_refresh_cache(Color pers for (IndexType k = 0; k < Tiling::NumRegs; ++k) acc[k] = entryTile[k]; - int i = 0; - for (; i < std::min(removed.ssize(), added.ssize()); ++i) - { - size_t indexR = removed[i]; - const size_t offsetR = Dimensions * indexR; - auto* columnR = reinterpret_cast(&weights[offsetR]); - size_t indexA = added[i]; - const size_t offsetA = Dimensions * indexA; - auto* columnA = reinterpret_cast(&weights[offsetA]); - - for (IndexType k = 0; k < Tiling::NumRegs; ++k) - acc[k] = fused(acc[k], columnA[k], columnR[k]); - } - for (; i < removed.ssize(); ++i) + for (int i = 0; i < removed.ssize(); ++i) { size_t index = removed[i]; const size_t offset = Dimensions * index; @@ -768,7 +755,7 @@ void update_accumulator_refresh_cache(Color pers for (IndexType k = 0; k < Tiling::NumRegs; ++k) acc[k] = vec_sub_16(acc[k], column[k]); } - for (; i < added.ssize(); ++i) + for (int i = 0; i < added.ssize(); ++i) { size_t index = added[i]; const size_t offset = Dimensions * index;