From 25677ae2c6ea0e963720692ba10089f53cf39c0c Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Sat, 11 May 2024 12:50:33 +0200 Subject: [PATCH] Add improved NMP reduction scheme (20.1 +/- 14) --- Chess/nimfish/nimfishpkg/search.nim | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Chess/nimfish/nimfishpkg/search.nim b/Chess/nimfish/nimfishpkg/search.nim index 13762f6..468f81e 100644 --- a/Chess/nimfish/nimfishpkg/search.nim +++ b/Chess/nimfish/nimfishpkg/search.nim @@ -56,7 +56,7 @@ const # Limit after which FP is disabled FP_DEPTH_LIMIT {.used.} = 1 # Advantage threshold - FP_EVAL_MARGIN {.used.} = 300 + FP_EVAL_MARGIN {.used.} = 125 # Constants to configure LMP (Late # Move Pruning) @@ -448,12 +448,7 @@ proc search(self: var SearchManager, depth, ply: int, alpha, beta: Score, isPV: self.board.makeNullMove() # We perform a shallower search because otherwise there would be no point in # doing NMP at all! - var reduction: int - when defined(NMP2): - # Reduce more based on depth - reduction = NMP_BASE_REDUCTION + depth div NMP_DEPTH_REDUCTION - else: - reduction = NMP_BASE_REDUCTION + var reduction = NMP_BASE_REDUCTION + depth div NMP_DEPTH_REDUCTION let score = -self.search(depth - reduction, ply + 1, -beta + 1, -beta, isPV=false) self.board.unmakeMove() if score >= beta: