Skip to content

Commit b65dd64

Browse files
committed
Merge branch 'reduce_syscalls_node_based_timechecks_or_something'
bench: 4271540 ``` ELO | 12.40 +- 5.10 (95%) SPRT | 60.0+0.60s Threads=1 Hash=8MB LLR | 2.96 (-2.94, 2.94) [0.00, 2.50] GAMES | N: 7992 W: 1940 L: 1655 D: 4397 ELO | 17.25 +- 6.48 (95%) SPRT | 8.0+0.08s Threads=1 Hash=16MB LLR | 2.95 (-2.94, 2.94) [-2.50, 0.00] GAMES | N: 5120 W: 1317 L: 1063 D: 2740 ```
2 parents bf25df4 + aa69367 commit b65dd64

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src_files/search.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,12 @@ Score Search::pvSearch(Board* b, Score alpha, Score beta, Depth depth, Depth ply
438438
}
439439

440440
// if the time is over, we fail hard to stop the search. We don't want to call the system clock
441-
// too often for speed reasons, so we only apply this when the depth is larger than 6.
442-
if ((depth > 6 && !timeManager->isTimeLeft(&td->searchData))) {
441+
// too often for speed reasons, so we only apply this when the node count is a multiple of 1024
442+
if ( td->nodes % 1024 == 0
443+
&& td->threadID == 0
444+
&& !timeManager->isTimeLeft(&td->searchData)) {
443445
td->dropOut = true;
446+
this->timeManager->stopSearch();
444447
return beta;
445448
}
446449

0 commit comments

Comments
 (0)