From 2844d4f56d5a6e60de70432beb75ab3e72406945 Mon Sep 17 00:00:00 2001 From: Terje Date: Tue, 31 Dec 2024 18:08:46 +0100 Subject: [PATCH] Bench: 23640094 --- src/movepicker.c | 5 +++-- src/movepicker.h | 2 +- src/search.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/movepicker.c b/src/movepicker.c index dc7a0dcb..d93f8bad 100644 --- a/src/movepicker.c +++ b/src/movepicker.c @@ -159,7 +159,8 @@ void InitNoisyMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove) { mp->onlyNoisy = true; } -void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, int threshold) { - InitNoisyMP(mp, thread, ss, NOMOVE); +void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove, int threshold) { + Position *pos = &thread->pos; + InitNoisyMP(mp, thread, ss, ttMove && SEE(pos, ttMove, threshold) ? ttMove : NOMOVE); mp->threshold = threshold; } diff --git a/src/movepicker.h b/src/movepicker.h index 0c94f78c..a61a5da7 100644 --- a/src/movepicker.h +++ b/src/movepicker.h @@ -41,4 +41,4 @@ typedef struct MovePicker { Move NextMove(MovePicker *mp); void InitNormalMP(MovePicker *mp, Thread *thread, Stack *ss, Depth depth, Move ttMove, Move killer); void InitNoisyMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove); -void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, int threshold); +void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove, int threshold); diff --git a/src/search.c b/src/search.c index 4cba415e..702a8f0f 100644 --- a/src/search.c +++ b/src/search.c @@ -398,7 +398,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth if ( depth >= 5 && (!ttHit || ttBound == BOUND_LOWER || ttScore >= probCutBeta)) { - InitProbcutMP(&mp, thread, ss, probCutBeta - ss->staticEval); + InitProbcutMP(&mp, thread, ss, ttMove, probCutBeta - ss->staticEval); Move move; while ((move = NextMove(&mp))) {