-
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
Use of bad TTData in search() when ttHit is false #5503
Comments
Regarding this issue, the LTC fix passed https://tests.stockfishchess.org/tests/view/66a243b14ff211be9d4ecd4a |
Hmm I'm even less sure. Maybe open a PR for the fix as an RFC and see what the maintainers and others say? |
Update: return {false, TTData(), TTWriter(replace)}; to constexpr TTData emptyData = {
Move::none(),
VALUE_NONE,
VALUE_NONE,
DEPTH_ENTRY_OFFSET,
BOUND_NONE,
false
};
return {false, emptyData, TTWriter(replace)}; now changes the bench from 959947 to 934447. This proves that we have a not just theoretical bug somewhere in search that is making use of random TTData data even when ttHit is false. I will be submitting a test to return these safe defaults from TranspositionTable::probe(). I'm not an expert on search but that part should be fixed as well. @peregrineshahin Do you plan on opening a PR for your fix above? |
bench: 934447
Oops. I was accidentally comparing benches between different versions of SF. The bug still exists, it's just that bench doesn't change. |
bench: 934447
bench: 934447
Well we recently added is_valid method as an rfc, and as I said for the two places that are left I'm not sure I can provide proof that they do anything functional under any test conditions. |
@peregrineshahin Separately I tried returning variations of things like
from probe and I can't get it to affect bench no matter what I try. |
I think I answered this somewhere, there was a recent patch that removed all checks for ttHit != false, because they were redundent and we still needed to check for |
Well not under all conditions but we have this explicitly in search
Now because the search checks for validity of ttValue this means it must be ttHit, and bounds is not used unless we know it's a ttHit, then the remaining thing is actually the ttDepth
here your depth might have an effect on PvNodes that doen't have ttHits Idk why it doesn't affect it. |
are you sure your numbers, don't even affect this reduction if it's a PvNode and not a ttHit?
I would have guessed that the only reason this is guarded is because we are in search and ttData.depth is 0 so 0 < than any search depth. |
Thanks for the explanations. Yes I have not been able to return anything from probe to make the bench change no matter what I tried. I am no longer convinced we have a bug. |
Describe the issue
As pointed out by @dubslow here #5416 (comment) and @peregrineshahin #5416 (comment) in some places search() uses values from TTData even when ttHit is false.
Expected behavior
Don't use any values from TTData when ttHit is false.
Steps to reproduce
Inspect Search::Worker::search() code.
Anything else?
No response
Operating system
All
Stockfish version
a8401e8
The text was updated successfully, but these errors were encountered: