-
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
Potential issue leading to wrong PV with a losing move instead of drawing move #4365
Comments
What depths do you see an issue, and have you found if searching deeper resolves the issue? |
Sorry, for being a little vague in the initial post. I found the time to reproduce and capture the console input and outputs. See the attached files. I call "8/P7/5R2/6k1/6p1/7p/5P1K/5r2 b - - 0 61" the first position and "8/P7/5R2/6k1/6p1/7p/5P1K/5r2 b - - 0 61 moves f1a1" the second position. If the search on the first position reaches a high depth (approx. > 240 maybe 245) and you then search the second position (very often) SF presents a completely wrong pv leading to a a loss with mate. It is also reproducable with one thread but takes much longer. Also varying hash does not seem to matter much. I am no longer convinced it has something to do with the tablebases. It seems that the high search depth might confuse SF (maybe its hash replacement strategy and PV reconstruction). You are correct though that SF on "go infinite" SF would never actually play a move. And here it gets interesting. SF displays the wrong losing line and never change to the correct line with "go infinite". So i reproduced without "go infinite" and used "go movetime"´instead. As you can see from the console output SF displays the wrong line just as with "go infinite". But surprisingly it will always play the correct move at the end. Also with shorter time it somehow always outputs the correct move to play (best move), while the pv remains incorrect. In the console output you can clearly see that, the moment the search of the first position reaches depth 245 (near the end of the output) the next search of the second position fails (the last search in the output). My current understanding is now this. For actual play this might be a cosmetic bug, while for analysis it seems like a serious issue (as you almost always use the infinite mode). As the problem seems unrelated to indeterministic search (as you can reproduce on one thread) i would speculate that hash reconstruction of the PV somehow fails if previous entries are near or at high depths > 240 or so. In the console output i used searching both positions for a bit and then alternating to reach the required depth. Maybe that somehow also confuses SF hash entries (it should not, but its a possibility). One could try to search directly to a depth of 240+ on the first search and see if that influences anything. |
I cannot reproduce any of this.
Since you also hid the "most" important part in the text file, ill repost that
so the previous search reached maxdepth, maybe theres some weird interaction ? |
You did not have a previous search reaching maxdepth. This is probably what triggers the bug. Please retry exactly as i did in the log file i provided. If you alternate searches it will reach maxdepth even on slow machines reasonably quickly.
Exactly - and this obviously should not happen and is some sort of bug. |
I tried reaching max depth by alternated searches but only ever got up to 100. Though maybe one can lower the max depth and reach the limit earlier to check if it changes anything |
I have partial 7p TB installed, this might help reaching maxdepth. Also you could try running the alternate searches for longer, and alternate more often if the machine is slower. |
@Videodr0me can you reproduce the problem if you have only 6men in use, i.e. not partial 7men. Correct partial 7men require for each TB file available also the corresponding 7men where one of the pawns promotes. For example, you have KPPPPvKR so you will need all these files present https://syzygy-tables.info/download/KPPPPvKR.txt?source=lichess&dtz=root |
With 6p tablebases only, I can only get to depth 120 or so in reasonable time. I think the missing pawn promotion wdl bases are no issue in this position, but maybe somebody with a complete set can try to reproduce to be sure. |
Describe the issue
Bug also present with newest dev20230128 which includes the tb changes.
This is a drawn 8 piece position: 8/P7/5R2/6k1/6p1/7p/5P1K/5r2 b - - 0 61
If you let stockfish_23011407_x64_avx2 go infinite on this position with partial 7 piece syzygy WDL bases (and all 6p WDL + DTZ bases) it correctly shows 0.00.
If you now enter the move Rf1a1 SF often (but not always) shows that white is winning and wants to play f3?? The position in fact remains drawn and f3 is one of the few losing moves.
Even if it does not happen and it shows 0.00 with one of the many drawing moves you can go back and forth (without clearing hash) and very often SF will return to showing the bad f3 move.
All tb files have been md5 validated. Here is a list of the 7p files i use:
7p_WDL.txt
Is this a bug? Is it expected behaviour with partial 7p wdl bases? And if the latter which one's am i missing?
Expected behavior
After entering Rf1a1 and go infinite SF should also show a drawn position and come up with one of the many non losing moves.
Steps to reproduce
Just let SF calculate on the original position, enter Rf1a1, and go infinite.
Anything else?
No response
Operating system
Windows
Stockfish version
stockfish_23011407_x64_avx2
The text was updated successfully, but these errors were encountered: