Skip to content

Commit 25e9802

Browse files
committed
add stalemate limit
1 parent 7aa9a53 commit 25e9802

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sunfish_lmr.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,20 @@
125125
#QS_B = 219
126126
#QS_A = 500
127127
#EVAL_ROUGHNESS = 13
128-
QS_B = 100
129-
QS_A = 200
128+
QS_B = 50
129+
QS_A = 250
130130
EVAL_ROUGHNESS = 17
131131

132132
# Constants to be removed later
133-
USE_BOUND_FOR_CHECK_TEST = 0
133+
USE_BOUND_FOR_CHECK_TEST = 1
134134
IID_LIMIT = 2 # depth > 2
135135
IID_REDUCE = 3 # depth reduction in IID
136136
IID_TYPE = 0 # None, gamma=pos.score, gamma=gamma, iterative, depth-reduce
137137
REPEAT_NULL = 1 # Whether a null move can be responded too by another null move
138-
NULL_LIMIT = 2 # Only null-move if depth > NULL_LIMIT
138+
NULL_LIMIT = 0 # Only null-move if depth > NULL_LIMIT
139+
STALEMATE_LIMIT = 0 # Only null-move if depth > NULL_LIMIT
140+
141+
# There is some issue with combining "bound for check test" with a high "null_limit".
139142

140143
# minifier-hide start
141144
opt_ranges = dict(
@@ -148,6 +151,7 @@
148151
IID_TYPE = (0, 4),
149152
REPEAT_NULL = (0, 1),
150153
NULL_LIMIT = (0, 5),
154+
STALEMATE_LIMIT = (0, 5),
151155
)
152156
# minifier-hide end
153157

@@ -494,7 +498,7 @@ def reduce(val):
494498
# realize it's not a mate after all. That's fair.
495499

496500
# This is too expensive to test at depth==0
497-
if depth > 0 and best == -MATE_UPPER:
501+
if depth > STALEMATE_LIMIT and best == -MATE_UPPER:
498502
flipped = pos.rotate(nullmove=True)
499503
# Both of these check-tests work. Is one of them better?
500504
if USE_BOUND_FOR_CHECK_TEST == 1:

0 commit comments

Comments
 (0)