-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fail-soft search but Fail-hard transposition table look up? #19
Comments
Hi @kubpica, You're correct; I am using the fail soft version of the alpha-beta algorithm. That comment should be corrected; thanks for the heads-up! For the rest of your questions I'm going to try to answer as best I can although I have to be honest that it's been a while since I looked at my own code, so my analysis will be going off of quickly scanning back through things. As for the transposition table, I believe I'm using As for storing a best move, scanning back through my code and if I remember correctly, although I'm storing a best move at fail-low nodes, it's never actually used. If you look back at the search code, whenever I stored a best-move at a fail-low node, the score for that TT entry will also be lower than alpha. And in the transposition table code, if we ever visit this entry again, it's stored score will be less than alpha, and since it is an alpha node we're going to be ending the search early, returning that score and never using the best move. It's been a while since I've worked with the code as I've said, but in hindsight right now, I don't think I had a good reason for doing things the way I described above, and I should be explicit in my code about not storing best moves for nodes that failed low, since clearly no move searched was good enough to raise alpha. I appreciate your comment a lot! In the coming months I'm hopefully going to get back in the mood to re-write Blunder from scratch, improving upon some past mistakes, so whenever I revisit this particular section of and if you're still interested, I'll be sure to try to give a better answer! |
@algerbrex As for storing a best move, correct me if I'm wrong, but I think alpha and beta may be different when we encounter the same position (but maybe in different way), so it's not guaranteed that stored score will always be less than alpha. So I think that it may happen that storedScore will be bigger than new-alpha and then ttMove ("bestMove") will be used. If alpha was always the same for the same entry why would we need to check Thank you very much for your response! I am eager to hear your conclusions as you redo this part of engine. I will check what works best in my draughts engine so I can also share if I find anything interesting ;) |
hi, maybe i can inspire. i follow this Issue with interest .. i'm a programmer myself, but not yet of any engine .. i'm a bit familiar with the terms you use here, like alpha beta TT etc .. overall i like the way you help eachother by describing technical issues in detail by clear wording ! While reading this Issue i have these thoughts :
|
Hi, I noticed you are using the Fail-soft version of Alpha-beta algorithm.
In search.go there is this comment:
But I think that "bestScore" is not always alpha here, in Fail-soft Alpha-beta it can be lower than alpha (for so called "All-Nodes" where every move fails-low). Fail-soft is supposed to be optimization of alphabeta, in fail-soft version you don't clamp returned values to alpha/beta. But I noticed that you do clamp values returned from transposition table to alpha/beta in case of AlphaFlag/BetaFlag:
Shoudn't you just always do
adjustedScore = score
? I checked source code of Stockfish and I think they don't clamp values returned from tt.Another interesting topic is whether we should store "bestMove" for "All-Nodes" (AlphaFlag) or not. I noticed that you do store it, but Stockfish don't (they store "MOVE_NONE" in case of AlphaFlag).
For more details look here: https://stackoverflow.com/questions/72252975/transposition-table-look-up-for-fail-hard-vs-fail-soft-alpha-beta-how-do-they-d
I am new to this stuff so I may be wrong, but it's very interesting, what you think?
The text was updated successfully, but these errors were encountered: