From f434cc291892e826c675056bc5e770add7e004b3 Mon Sep 17 00:00:00 2001 From: Shawn Xu Date: Fri, 17 Oct 2025 15:53:49 -0700 Subject: [PATCH] Allow AccumulatorStack::size to point to one past the end this is guaranteed to be correct since we access the last element with `size - 1` closes https://github.com/official-stockfish/Stockfish/pull/6368 fixes https://github.com/official-stockfish/Stockfish/issues/6367 no functional change --- src/nnue/nnue_accumulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnue/nnue_accumulator.cpp b/src/nnue/nnue_accumulator.cpp index d13105aa4..3096758b9 100644 --- a/src/nnue/nnue_accumulator.cpp +++ b/src/nnue/nnue_accumulator.cpp @@ -75,7 +75,7 @@ void AccumulatorStack::reset() noexcept { } void AccumulatorStack::push(const DirtyPiece& dirtyPiece) noexcept { - assert(size + 1 < accumulators.size()); + assert(size < accumulators.size()); accumulators[size].reset(dirtyPiece); size++; }