-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Refactor get_best_thread #5001
Refactor get_best_thread #5001
Conversation
Refactors get_best_thread function logic for readability Passed non-reg STC: https://tests.stockfishchess.org/tests/view/65a91c6679aa8af82b975500 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 186000 W: 46379 L: 46325 D: 93296 Ptnml(0-2): 269, 21374, 49634, 21480, 243 no functional change
Make get_best_thread function easier to understand. Passed non-reg SMP STC: https://tests.stockfishchess.org/tests/view/65a91c6679aa8af82b975500 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 186000 W: 46379 L: 46325 D: 93296 Ptnml(0-2): 269, 21374, 49634, 21480, 243 closes official-stockfish#5001 No functional change
Sorry for the late review but I believe line 264 |
It's a pre-calculated boolean so it should be exactly the same, since bestThread is in proven loss the newThread can't be < and not negative infinity unless it's also in proven loss. |
I c ok that makes sense. What I now realize is that I don't understand why we want to select the new thread when newThreadScore < bestThreadScore ? We should want the opposite to maximize the score. Turns out this logic got reversed in #4990 which I believe is a bug. We want to stave off the mate the longest not shortest. |
It's the other way around, the bug was that we were staving off the mated in scores.. currently no non proven mated score can be reported by any thread which wasn't the case before. This means that staving off mated in scores was neccessary because threads will stuck with a non proven mated in scores. If we use the previous iteration to prove mated in scores then a lower score has the correct best move anyways. |
Hmm It seems that we should be staving off mate. Doesn't a more negative score mean the mate is closer so therefore we want a higher(less negative) score? Why was that a bug?
What does it mean for a mate to be proven and why would it change the fact that when we are defending we want the longest as opposed to the shortest mate? That should still correspond to the least negative score as it did before. Am I'm missing something fundamental about how this works? |
Refactors get_best_thread function logic for readability
Passed non-reg STC:
https://tests.stockfishchess.org/tests/view/65a91c6679aa8af82b975500
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 186000 W: 46379 L: 46325 D: 93296
Ptnml(0-2): 269, 21374, 49634, 21480, 243
no functional change