-
Notifications
You must be signed in to change notification settings - Fork 571
Early exit if backend is idle and there is work to do. #1503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Worth mentioning this only works for multigather - but I've put the backend idle counter in unconditionally since it should be very cheap - and maybe a similar heuristic could be invented for non multigather if we wanted to bother doing so. |
Umm this PR is 'broken' since I put the counter in the wrong spot. Surprised that it still gives the nps improvement... |
Having fixed the broken logic, I retested a more aggressive idea that had previously turned up bad and found it vastly superior. |
I realized that this optimization while very cool, interacts very poorly if there is only one search worker. So I've disabled it in that case. |
Fixed nodes test:
|
Inspired by investigations into
position fen 1r1qr1k1/6bp/1n4p1/2pPpp2/1n3P2/1QN5/1P1N2PP/R4RBK w - - 0 24
In that position on my machine this change almost doubles NPS at one point during the search (a few million nodes in).
In my 'standard benchmark run' it may be worth a couple of percent.
I think this heuristic can probably be improved upon, but it seems a pretty good start.
Since its an early exit - so long as the nps stays high I think its a clear win (the early exit itself is potentially worth elo at fixed nodes - untested).
I am unclear if there are any scenarios where this will be a net loss of nps - but I haven't thought of any of signifiance so far.