You can keep the position if your hash function can cause collisions. You must also keep the depth of the position, as you noticed, to make sure that the rating is obtained from a deeper search. and, of course, you must keep the score.
As for your second question ... which is called beta clipping. Prerequisite - your opponent has already found the best line for himself earlier in the search and initialized this rating for the beta version (negative alpha, which passed as beta for you) ... when testing your moves, if you can beat Beta at any time, he doesn't care how much you can beat, and he just drops the rest of the search in this thread. The easiest way to do this is to simply return the beta.
source
share