AndrewGrant wrote: ↑Tue Aug 10, 2021 6:37 pm
amanjpro wrote: ↑Tue Aug 10, 2021 6:29 pm
I agree with you, relying on zoibrist key alone for hashmove legality is somewhat risky. But I have been using hash moves without any checks for pseudo legality, and I have never had issues with that. The risk might be just too small to bother, at least for now.
If you are blindly taking the move from the TT, and applying it to the current board state, I highly suggest you implement a pseudo legality check immediately. Your engine will almost certainly crash given the right series of unfortunate events, which is extremely common with smaller key sizes, and still not out of the realm of possibility with 64bit keys.
So far, I was using the full 64 bit Zoibrist key the table. So, I was reasonably confident that the hash move belongs to a position that produces the same key. I know, it is risky, but the risk is small enough, that I am not really too worried about it.
I intend to add move pseudo legality check later, so I can use killer moves before generating quiet moves, but I feel like introducing LazySMP and the check at the same time is too much, to debug/test
The question, that I should ask is: using the Xor approach, I'll be storing checksums not keys, does this mean the chance of pseudo illegal moves go higher? I have no idea