Skip to content
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

Simplify Probcut Conditions #5720

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xu-shawn
Copy link
Contributor

Passed Non-regression STC:
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 248608 W: 64453 L: 64467 D: 119688
Ptnml(0-2): 784, 29486, 63796, 29436, 802
https://tests.stockfishchess.org/tests/view/6759244386d5ee47d95420ea

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 248988 W: 63217 L: 63230 D: 122541
Ptnml(0-2): 142, 27325, 69584, 27290, 153
https://tests.stockfishchess.org/tests/view/675a7ad886d5ee47d9542341

bench 1032143

bench 1032143
Copy link

clang-format 18 needs to be run on this PR.
If you do not have clang-format installed, the maintainer will run it when merging.
For the exact version please see https://packages.ubuntu.com/noble/clang-format-18.

(execution 12331921922 / attempt 1)

@peregrineshahin
Copy link
Contributor

According to this commit, SF prevented fully returning mates from TTs at PvNodes making a hash collision impossible to make us announce a wrong mate as we did in some case
7e890fd
So this re-allows that and leaks it from another place, so a guard would be needed. So I'm not sure that this would be simplifying anything if it confuses the matters and require a fix.

@xu-shawn
Copy link
Contributor Author

hmm, @Disservin any opinions on this?

@peregrineshahin
Copy link
Contributor

It's probably worth noting that we don't know the actual root bounds with such cutoffs, so if any value returned at pv-nodes it might propagate to root as an exact score, and that's because we update alpha and keep switching sides with the negamax, so a fail-high or a fail-low on a pv-node can easily resolve to an exact root score (e.g. a worst case scenario of a mate in 2 where there isn't).

@xu-shawn
Copy link
Contributor Author

It's probably worth noting that we don't know the actual root bounds with such cutoffs, so if any value returned at pv-nodes it might propagate to root as an exact score, and that's because we update alpha and keep switching sides with the negamax, so a fail-high or a fail-low on a pv-node can easily resolve to an exact root score (e.g. a worst case scenario of a mate in 2 where there isn't).

How would that happen? I thought a fail high can only propagate back as a fail low score in the parent node?

@peregrineshahin
Copy link
Contributor

How would that happen? I thought a fail high can only propagate back as a fail low score in the parent node?

Good question. while it makes sense for fail-lows and one can imagine it easily it doesn't theoretically make much sense for my concern to happen on fail-highs since bestValue is tracked and we make sure to align that with alpha.
but because of the upcoming_repetition code as we don't necessarily update bestValue to alpha, we can have a double upcoming_repetition setting the window to (-1, 0) without bestValue getting changed suddenly leading to all sort of weird things, so probably what you noted is true for fail-highs if bestValue is always aligned.

@xu-shawn
Copy link
Contributor Author

OK, I can see how that would lead to bad exact scores in some cases. Do you think some of these guards can be removed if bestValue is also updated in upcoming 3-fold detection?

@Disservin Disservin added the simplification A simplification patch label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simplification A simplification patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants