-
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
Depth 245 anomaly during TCEC #2717
Comments
There was also a big difference in depth between threads reported here #2620 |
TB could indeed be a reason for this. I couldn't yet reproduce it, but so far tried without TB. |
Maybe that's correct I'm not sure. The fact that it only happened in the position on move 67 and not any of the other similar positions just before or after seems odd regardless. |
Ok here is a game where it happens several times |
could we get the cutechess log for that game? Might be useful to figure out what's going on. |
This happened again yesterday in another game after Stockfish had found a TB win. |
Are we sure the thread voting patch is working correctly for cases with very high depth differences? |
@joergoster not necessarily, or said differently, that thread will have a very high weight. I once tried to limit the depth difference, but those patches did not pass: Some analysis why this is happening is still missing. |
@vondele But that seems more like a bugfix, no? But first, however, it must be fully understood what is going on. Edit: In TB win positions we shouldn't accept threads with lower scores, however! |
Yes, we need to fully understand before we can say something is a bug fix, or test it as a bug fix.... so testing as an Elo gainer was a quick workaround ;-) I agree that in TB win positions we should use the score, rather than a vote (but I think we do that already). |
Happened again |
depth 245 is a maximum depth of stockfish
see https://github.com/official-stockfish/Stockfish/blob/master/src/search.cpp#L372 |
so, some more investigation of the games https://tests.stockfishchess.org/tests/view/6272a6afc8f14123163c1997 some of these high depth happen also there, so it doesn't require TB. It doesn't happen in a single threaded run (https://tests.stockfishchess.org/tests/view/626abd7e8707aa698c0093a8), so it seems purely related to threading. So somehow an interaction between threads, but at least we can take TB out of the picture. |
I'm not too familiar with threading code, but does the following make sense: As far as I can tell, this is handled only by mainThread and updated only at the end of its current iteration. My thought is if it gets stuck in resolving a fail or stuck in some search explosion while increaseDepth is false, then some other thread could be looping over the same rootDepth until they reach 245. |
Two examples where this issue happens: depth245.zip For one of the cases, quick plot of the completed depth over time for each thread: |
I'm not sure if this is related but in the current TCEC swiss SF announced mate in 73 even though it only reported depth 39 and select depth 61. This was on move 53 of this game https://tcec-chess.com/#div=sw3&game=93&season=22 |
…cally per thread. Use same TC and threads as test 6272a6afc8f14123163c1997 where this was shown to occur. low tp. Bench: 5845802
… counter locally per thread helps. Use same TC and threads (but with low throughput) as test 6272a6afc8f14123163c1997 where this was known to occur. I may try to check pgns from time to time and stop the test earlier if the issue persists. Bench: 5845802
… counter locally per thread helps. Use same TC and threads (but with low throughput) as test 6272a6afc8f14123163c1997 where this was known to occur. I may try to check pgns from time to time and stop the test earlier if the issue persists. Bench: 5845802
looks like @miguel-l has identified the cause in the test https://tests.stockfishchess.org/tests/view/62aee644e7ee5525ef88c15a In discord: I can see how these changes could be related. |
@ruicoelhopedro any chance you could repeat your analysis, printing out an additional number of each thread, namely the |
So, explanation being discussed at https://discord.com/channels/435943710472011776/813919248455827515/991975708953935903 It's also consistent with the earlier posted graph where mainthread is stuck at a given depth. and of course that's @miguel-l explanation. |
I've started some games with the extra field. I'll post the logs when the issue is reproduced. |
Here they go, got a bit lucky as this happened in 3 games: depth245_adjustedDepth.zip |
so, the logs show that what we think is happing is actually happening. The increaseDepth is false, adjustedDepth is constant, and the rootDepth just reaches the maximum. |
Just want to have these somewhere I can find it (and also in case others might want to use or improve upon). For downloading sample pgns from a test For manual checking |
If the elapsed time is close to the available time, the time management thread can signal that the next iterations should be searched at the same depth (Threads.increaseDepth = false). While the rootDepth increases, the adjustedDepth is kept constant with the searchAgainCounter. In exceptional cases, when threading is used and the master thread, which controls the time management, signals to not increaseDepth, but by itself takes a long time to finish the iteration, the helper threads can search repeatedly a the same depth. This search finishes more and more quickly, leading to helper threads that report a rootDepth of MAX_DEPTH (245). The latter is not optimal as it is confusing for the user, stops search on these threads, and leads to an incorrect bias in the thread voting scheme. Probably with only a small impact on strength. This behavior was observed almost two years ago, see official-stockfish#2717 This patch fixes official-stockfish#2717 by ensuring the effective depth increases at once every four iterations, even in increaseDepth is false. Depth 245 searches (for non-trivial positions) were indeed absent with this patch, but frequent with master in the tests below: https://discord.com/channels/435943710472011776/813919248455827515/994872720800088095 Total pgns: 2173 Base: 2867 Patch: 0 it passed non-regression testing in various setups: SMP STC: https://tests.stockfishchess.org/tests/view/62bfecc96178ffe6394ba036 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 37288 W: 10171 L: 10029 D: 17088 Ptnml(0-2): 75, 3777, 10793, 3929, 70 SMP LTC: https://tests.stockfishchess.org/tests/view/62c08f6f49b62510394be066 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 190568 W: 52125 L: 52186 D: 86257 Ptnml(0-2): 70, 17854, 59504, 17779, 77 LTC: https://tests.stockfishchess.org/tests/view/62c08b6049b62510394bdfb6 LLR: 2.96 (-2.94,2.94) <-2.25,0.25> Total: 48120 W: 13204 L: 13083 D: 21833 Ptnml(0-2): 54, 4458, 14919, 4571, 58 Special thanks to miguel-I, Disservin, ruicoelhopedro and others for analysing the problem, the data, and coming up with the key insight, needed to fix this longstanding issue. Bench: 5182295
If the elapsed time is close to the available time, the time management thread can signal that the next iterations should be searched at the same depth (Threads.increaseDepth = false). While the rootDepth increases, the adjustedDepth is kept constant with the searchAgainCounter. In exceptional cases, when threading is used and the master thread, which controls the time management, signals to not increaseDepth, but by itself takes a long time to finish the iteration, the helper threads can search repeatedly at the same depth. This search finishes more and more quickly, leading to helper threads that report a rootDepth of MAX_DEPTH (245). The latter is not optimal as it is confusing for the user, stops search on these threads, and leads to an incorrect bias in the thread voting scheme. Probably with only a small impact on strength. This behavior was observed almost two years ago, see official-stockfish/Stockfish#2717 This patch fixes #2717 by ensuring the effective depth increases at once every four iterations, even in increaseDepth is false. Depth 245 searches (for non-trivial positions) were indeed absent with this patch, but frequent with master in the tests below: https://discord.com/channels/435943710472011776/813919248455827515/994872720800088095 Total pgns: 2173 Base: 2867 Patch: 0 it passed non-regression testing in various setups: SMP STC: https://tests.stockfishchess.org/tests/view/62bfecc96178ffe6394ba036 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 37288 W: 10171 L: 10029 D: 17088 Ptnml(0-2): 75, 3777, 10793, 3929, 70 SMP LTC: https://tests.stockfishchess.org/tests/view/62c08f6f49b62510394be066 LLR: 2.94 (-2.94,2.94) <-2.25,0.25> Total: 190568 W: 52125 L: 52186 D: 86257 Ptnml(0-2): 70, 17854, 59504, 17779, 77 LTC: https://tests.stockfishchess.org/tests/view/62c08b6049b62510394bdfb6 LLR: 2.96 (-2.94,2.94) <-2.25,0.25> Total: 48120 W: 13204 L: 13083 D: 21833 Ptnml(0-2): 54, 4458, 14919, 4571, 58 Special thanks to miguel-I, Disservin, ruicoelhopedro and others for analysing the problem, the data, and coming up with the key insight, needed to fix this longstanding issue. closes official-stockfish/Stockfish#4104 Bench: 5182295 (cherry picked from commit 2e02dd7)
I was looking at this TCEC game
https://tcec-chess.com/#div=p&game=72&season=18&x=archive
and noticed that on move 67 SF reached our max depth of 245. This isn't so strange on its own except that the depth never went above 68 on any other move. The time used, nodes searched, and TB hits, all look normal. Does anyone have a plausible explanation or could this be an issue?
The text was updated successfully, but these errors were encountered: