Add improved NMP reduction scheme (20.1 +/- 14)
This commit is contained in:
parent
9331729d76
commit
25677ae2c6
|
@ -56,7 +56,7 @@ const
|
||||||
# Limit after which FP is disabled
|
# Limit after which FP is disabled
|
||||||
FP_DEPTH_LIMIT {.used.} = 1
|
FP_DEPTH_LIMIT {.used.} = 1
|
||||||
# Advantage threshold
|
# Advantage threshold
|
||||||
FP_EVAL_MARGIN {.used.} = 300
|
FP_EVAL_MARGIN {.used.} = 125
|
||||||
|
|
||||||
# Constants to configure LMP (Late
|
# Constants to configure LMP (Late
|
||||||
# Move Pruning)
|
# Move Pruning)
|
||||||
|
@ -448,12 +448,7 @@ proc search(self: var SearchManager, depth, ply: int, alpha, beta: Score, isPV:
|
||||||
self.board.makeNullMove()
|
self.board.makeNullMove()
|
||||||
# We perform a shallower search because otherwise there would be no point in
|
# We perform a shallower search because otherwise there would be no point in
|
||||||
# doing NMP at all!
|
# doing NMP at all!
|
||||||
var reduction: int
|
var reduction = NMP_BASE_REDUCTION + depth div NMP_DEPTH_REDUCTION
|
||||||
when defined(NMP2):
|
|
||||||
# Reduce more based on depth
|
|
||||||
reduction = NMP_BASE_REDUCTION + depth div NMP_DEPTH_REDUCTION
|
|
||||||
else:
|
|
||||||
reduction = NMP_BASE_REDUCTION
|
|
||||||
let score = -self.search(depth - reduction, ply + 1, -beta + 1, -beta, isPV=false)
|
let score = -self.search(depth - reduction, ply + 1, -beta + 1, -beta, isPV=false)
|
||||||
self.board.unmakeMove()
|
self.board.unmakeMove()
|
||||||
if score >= beta:
|
if score >= beta:
|
||||||
|
|
Loading…
Reference in New Issue