-
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
Prune illegal moves in qsearch earlier #3618
Conversation
I don't know, I'm not so convinced about this. |
I was thinking about this and came to the conclusion that its actually quite important. |
This fixes a bug. The bounds were appropriate. |
fixes a bug and shrinks code. |
Code robustness is indeed a valid argument. |
I think that smth like
can increase bestValue in some cases even if move gets pruned - so basically qsearch can return value that is < alpha but higher than it should be if we wouldn't let illegal moves influence it. |
Also another example. |
I agree that the removal of the moveCount adjustment makes this OK as a simplification. |
passed STC with elo-gaining bounds
https://tests.stockfishchess.org/tests/view/60f20aefd1189bed71812da0
LLR: 2.94 (-2.94,2.94) <-0.50,2.50>
Total: 61512 W: 4688 L: 4492 D: 52332
Ptnml(0-2): 139, 3730, 22848, 3874, 165
The same version functionally but with moving condition ever earlier passed LTC with simplification bounds.
https://tests.stockfishchess.org/tests/view/60f292cad1189bed71812de9
LLR: 2.98 (-2.94,2.94) <-2.50,0.50>
Total: 60944 W: 1724 L: 1685 D: 57535
Ptnml(0-2): 11, 1556, 27298, 1597, 10
Main idea is that illegal moves influencing search or qsearch obviously can't be any sort of good.
The only reason why initially legality checks for search and qsearch were done after they actually can influence some heuristics is because legality check is expensive computationally.
Eventually in search it was moved to the place where it makes sure that illegal moves can't influence search.
This patch shows that the same can be done for qsearch + it passed STC with elo-gaining bounds + it removes 3 lines of code because you no longer need to increment/decrement movecount on illegal moves.
bench 4709569