-
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
Remove set statScore to zero #2578
Remove set statScore to zero #2578
Conversation
It looks like both the AppVeyor and Travis CI builds are having issues. Can anyone help me see what I'm doing wrong? My bash file is
This gives me Bench 5204700 For reference, I am on Windows and I utilized in essence the script from this guide for 64 bit Windows using the MSYS2 MinGW 64-bit shell: https://github.com/glinscott/fishtest/wiki/Building-stockfish-on-Windows |
@silversolver1 the reference bench number is extracted from the commit message (not the PR comment). You could fix that for example with
|
@vondele Thanks, I did what you said and it looks like the AppVeyor CI went fully through and 3/4 of the Travis checks as well. It looks like the remaining Travis check failed because an assert in endgame.cpp was called? Not entirely sure why because I don't think what I removed touches that but presumably there's some interaction. I'm not really sure how to proceed to be honest. Any advice would be appreciated. |
@silversolver1 interesting.. your patch changes search, and exposes what is presumably a recently introduced bug. Nothing to worry about from your side, but @protonspring ;-) On this position, we're making the eval somewhat to large: This might be accidentally fixed by #2577 ... let me have a look. |
The values in the Corners array were raised from 20-100 to 6k. The testing at the time demonstrated significant gains for KBNK games with no regression in master, but yes. 6k above VALUE_KNOWN_WIN is probably out of bounds. The equations in #2577 closely represent the array values, so I wouldn't expect it to fix anything. Perhaps for this specific ending, reduce the base so that adding the 6k approaches VALUE_KNOWN_WIN. Probably requires additional testing though to see what the ramifications are. EDIT: I was confused between VALUE_KNOWN_WIN and VALUE_TB_IN_MAX_PLY. |
@protonspring first quick testing with #2577 doesn't show this issue.... However, we have to be sure. Can you have a more careful look, determining the maximum value, and making sure it is below VALUE_TB_WIN_IN_MAX_PLY ? |
VALUE_TB_IN_MAX_PLY = (VALUE_MATE - 2 * MAX_PLY = (32000 - 512) = 31488 It's possible that we were going out of bounds somewhere on the arrays and the equations fix it? |
I poked around a bit. . the value of the result before dying was 677747157. Definitely seems like an out of bounds thing. |
hmm mysterious indeed. For me I have the assert when I compile as:
but not
that's for gcc 9.2.1. With clang++ both versions are clean. The eval is also 47.89, well below the maximum, indeed. |
Oh. . this is the flip_square thing. ~loserKsq is wrong. This was fixed in the simplifications, but it's not commited to master yet. |
~loserKsq should be flip_rank(loserKsq). See #2567 |
I see. That's consistent with the compiler variations, and indeed out of bounds. Also means, this code is indeed not exercised in bench (enough), otherwise this mistake would have been noticed before. Could you have a careful look if any other operator~ passed through the cracks? |
Yes. . . after I missed the loserKsq, I took a pretty careful look. That was the only missing one, but I will look again. @silversolver1 You could make the change I suggested and see if it fixes the build. I assume it will. |
@protonspring, no need for @silversolver1 to do this. Let me take care of as part of the merging of the other PR. However, @silversolver1 you might want to update the AUTHORS file as part of this PR :-) or just drop your full name in this thread (unless you want to be there just with your github handle). |
@silversolver1 master has changed meanwhile, so the bench has changed... don't worry I'll merge this shortly and take care. |
Ok sure, thanks for your help! |
Thanks! |
@silversolver1 Congratulations on your successful PR! :) |
@31m059 Thanks! :) And also thanks for helping me better understand what counts as a simplification lol |
* Equations for edges and corners. This is a functional simplification that removes the large arrays in endgames.cpp. It also fixes a recently introduced bug (960d59d) in KNBvK, now using flip_file() instead of ~. One fen added to bench to increase endgame coverage. STC LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 174724 W: 33325 L: 33404 D: 107995 Ptnml(0-2): 2503, 19607, 43181, 19608, 2463 http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287 LTC LLR: 2.95 (-2.94,2.94) {-1.50,0.50} Total: 35640 W: 4679 L: 4621 D: 26340 Ptnml(0-2): 189, 2991, 11424, 3005, 211 http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8 closes official-stockfish#2577 Bench: 5527957 * Remove set statScore to zero Simplification. Removes setting statScore to zero if negative. STC: LLR: 2.95 (-2.94,2.94) {-1.50,0.50} Total: 84820 W: 16100 L: 16033 D: 52687 Ptnml(0-2): 1442, 9865, 19723, 9944, 1436 https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8 LTC: LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 57658 W: 7435 L: 7391 D: 42832 Ptnml(0-2): 441, 5397, 17104, 5451, 436 https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307 closes official-stockfish#2578 Bench: 5168890 Co-authored-by: protonspring <mike@whiteley.org>
* Equations for edges and corners. This is a functional simplification that removes the large arrays in endgames.cpp. It also fixes a recently introduced bug (960d59d) in KNBvK, now using flip_file() instead of ~. One fen added to bench to increase endgame coverage. STC LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 174724 W: 33325 L: 33404 D: 107995 Ptnml(0-2): 2503, 19607, 43181, 19608, 2463 http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287 LTC LLR: 2.95 (-2.94,2.94) {-1.50,0.50} Total: 35640 W: 4679 L: 4621 D: 26340 Ptnml(0-2): 189, 2991, 11424, 3005, 211 http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8 closes official-stockfish#2577 Bench: 5527957 * Remove set statScore to zero Simplification. Removes setting statScore to zero if negative. STC: LLR: 2.95 (-2.94,2.94) {-1.50,0.50} Total: 84820 W: 16100 L: 16033 D: 52687 Ptnml(0-2): 1442, 9865, 19723, 9944, 1436 https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8 LTC: LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 57658 W: 7435 L: 7391 D: 42832 Ptnml(0-2): 441, 5397, 17104, 5451, 436 https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307 closes official-stockfish#2578 Bench: 5168890 * simplify castling part of generate_all. somewhat more compact, generates same code. close official-stockfish#2580 No functional change. * Simplify futility pruning parent node only continuation histories seem needed for this purpose. STC: http://tests.stockfishchess.org/tests/view/5e6b88dfe42a5c3b3ca2e4ab LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 113356 W: 21725 L: 21696 D: 69935 Ptnml(0-2): 1999, 13255, 26163, 13240, 2021 LTC: http://tests.stockfishchess.org/tests/view/5e6babbfe42a5c3b3ca2e4c2 LLR: 2.94 (-2.94,2.94) {-1.50,0.50} Total: 22164 W: 2917 L: 2821 D: 16426 Ptnml(0-2): 173, 2040, 6548, 2160, 161 closes official-stockfish#2583 bench: 4839496 * Small cleanups closes official-stockfish#2567 No functional change. Co-authored-by: protonspring <mike@whiteley.org> Co-authored-by: pb00067 <pb00067@PHXL0356.wp.lan> Co-authored-by: Joost VandeVondele <Joost.VandeVondele@gmail.com>
Simplification. Removes setting statScore to zero if negative.
STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 84820 W: 16100 L: 16033 D: 52687
Ptnml(0-2): 1442, 9865, 19723, 9944, 1436
https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8
LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57658 W: 7435 L: 7391 D: 42832
Ptnml(0-2): 441, 5397, 17104, 5451, 436
https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307
Rationale: The idea was basically to not change values to something they're not, especially as doing so would be altering the value from its true state. Essentially: if the statScore was in fact negative, why would we treat it as if it were not?
Also, my first passed LTC! And hopefully my first successful PR to something on Github! :)
Bench 5204700