hgm wrote:As long as you err on the save site, there is no need to be fully correct. The only consequence of assigning phantom-e.p. rights for a capture that was not legal after all, is that two separate hash entries will now be made for what formally is the same position. That could lead to a probe miss and search, while in fact there was already something in the table that could have cause a hash cutoff. No big deal, as e.p. captures in itself are already rare, let alone e.p. captures with pinned pieces or while in (discovered) check. And in practice you will get a hash hit then on the next ply, where the (phantom) rights have again disappeared.
Wait, what? That's not the ONLY consequence at all.
My first post in this thread, and a bunch of the rambling post afterwards, was about the other consequence: when the approximation is wrong (i.e. when there is a pawn next to the e.p. square but that pawn is pinned, so it has no LEGAL moves) then your rep detection algorithms will think they are two different positions when in fact they are not. I agree it should be extremely rare, so thats why I think the approximation is reasonable to do. But in this admittedly rare case, it affects
correctness, not just transposition table efficiency. You might think you are winning, but allow the opponent to claim a 3-fold rep draw, and your engine might not believe its a claimable draw when it is.
Anyway, for those who set out to write a zero-bug engine which always plays correct chess, its worth considering all the implications before they choose which way to implement this.
OTOH I've never seen an example of an engine-engine game that was drawn because of this extremely rare situation. If anyone can find one that would sure be interesting!