Fix long-standing incorrect definition of improving (bench 5552934)

This commit is contained in:
2026-05-23 14:49:51 +02:00
parent 6d61b7dbf4
commit 607c5319fc

View File

@@ -1022,7 +1022,7 @@ proc search(self: var SearchManager, depth, ply: int, alpha, beta: Score, isPV,
# If the static eval from this position is greater than that from 2 plies
# ago (our previous turn), then we are improving our position
var improving = false
if ply > 2 and not self.stack[ply].inCheck and not self.stack[ply - 2].inCheck:
if ply > 1 and not self.stack[ply].inCheck and not self.stack[ply - 2].inCheck:
improving = staticEval > self.stack[ply - 2].staticEval
if not ttHit and not isSingularSearch and not self.stack[ply].inCheck:
# Cache static eval immediately