Check time limit once per 1024 nodes

This commit is contained in:
2026-07-15 19:30:37 +03:00
parent cb47cc3c8b
commit 033bba0a12
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ pub fn negamax(
nodes: &mut u64, nodes: &mut u64,
do_nmp: bool, do_nmp: bool,
) -> Result<i16> { ) -> Result<i16> {
if *nodes & 1024 == 0 && time.exceed_hard_limit() { if *nodes & 1023 == 0 && time.exceed_hard_limit() {
bail!("Hard limit exceeded in negamax"); bail!("Hard limit exceeded in negamax");
} }

View File

@@ -15,7 +15,7 @@ pub fn quiescence(
time: &TimeInfo, time: &TimeInfo,
nodes: &mut u64, nodes: &mut u64,
) -> Result<i16> { ) -> Result<i16> {
if *nodes & 1024 == 0 && time.exceed_hard_limit() { if *nodes & 1023 == 0 && time.exceed_hard_limit() {
bail!("Hard limit exceeded in quiescence"); bail!("Hard limit exceeded in quiescence");
} }