From de1d0e22ff5899f86ba2ce4e433be304df9bf389 Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 30 Sep 2026 20:01:33 +0200 Subject: [PATCH] moving ss storing under se to prevent overwriting | bench 1342782 --- source/search.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 68743e7..efb434a 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -620,14 +620,6 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC Board copy = board; copy.MakeMove(currMove); - ctx->ss[ply].pieceType = board.GetPieceType(currMove.MoveFrom()); - ctx->ss[ply].moveTo = currMove.MoveTo(); - ctx->ss[ply].side = board.sideToMove; - - if (copy.positionIndex >= ctx->positionHistory.size()) { - ctx->positionHistory.resize(copy.positionIndex + 100); - } - ctx->positionHistory[copy.positionIndex] = copy.hashKey; ctx->nodes++; ctx->TT->PrefetchEntry(copy.hashKey); @@ -675,6 +667,14 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC cutnode |= extension < 0; + ctx->ss[ply].pieceType = board.GetPieceType(currMove.MoveFrom()); + ctx->ss[ply].moveTo = currMove.MoveTo(); + ctx->ss[ply].side = board.sideToMove; + + if (copy.positionIndex >= ctx->positionHistory.size()) { + ctx->positionHistory.resize(copy.positionIndex + 100); + } + ctx->positionHistory[copy.positionIndex] = copy.hashKey; int newDepth = depth + (copy.InCheck() && !ctx->excluded) - 1 + extension; -- 2.47.3