-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Exact go nodes
#5681
base: master
Are you sure you want to change the base?
Exact go nodes
#5681
Conversation
bench 840721 Co-authored-by: andrew <andrew.github@grantnet.us>
clang-format 18 needs to be run on this PR. (execution 11873702841 / attempt 1) |
this would also need a non regression test but i'll wait for what @vondele has to say |
Sorry forgot to include the test results. It's in the description now. |
I assume there are two problems the PR is trying to solve that I don't see are necessarily related because you can approach one without the other: Now this PR has new changes that are non-functional to fix both, because to solve the first problem you need to check for a stop only at the beginning of search or in a moves-loop, but this PR checks for a stop to return |
I feel that this is more of a secondary goal of the PR. The primary goal is always to make |
Yes, but I am failing to understand how can checking for the stop flag in those specifically three places help make go nodes exact, i.e. what are the checks exactly fixing: |
If time runs out during the Probcut search, not only will an invalid tt be stored, but the following line inside the parent node will still be run: Line 1150 in 82b092c
Causing the node counter to overshoot. Same applies to the two other cases. |
Okay so the problem is exactly here, why can't we run the check before doing the move and after undoing it, instead of putting the check at every early prunning heuristic? |
This can probably work as well, but I believe that catching timeouts right when they happen has two advantages:
|
I see your point regarding timeouts, but it's the opposite of 'easier to maintain', since this requires everyone who wants to introduce any new pre-moves heuristic to add this check after their search calls, and it's very easy to miss, let alone the amount of duplication there, whereas in the other option one can refactor those checks as parts of the do/undo functions including the addition of a node, forgetting about this issue for good. |
A complete version of PR #5612. This patch guards against all possible misuse of information from an aborted search. As a by-product of this modification, Stockfish can now search exactly m nodes when given the command
go nodes m
, except for two edge cases:Supersedes #5612
Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 109632 W: 28340 L: 28206 D: 53086
Ptnml(0-2): 261, 11926, 30317, 12042, 270
https://tests.stockfishchess.org/tests/view/6733aabf86d5ee47d953e918
Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 222474 W: 56364 L: 56350 D: 109760
Ptnml(0-2): 120, 21983, 67031, 21969, 134
https://tests.stockfishchess.org/tests/view/6734c4d286d5ee47d953ea2d
no bench change