Swaps out old 3fold detection code for a version that is more efficient, better explained, and less awful to look at.
Improvements include not looking further than the last null move, since that too is irreversible, scanning backwards instead of forwards since repetitions are more likely to have happened in recent plies and only checking positions with a matching side to move.
Bench: 6645600
Swaps out old 3fold detection code for a version that is more efficient, better explained, and less awful to look at. Improvements include not looking further than the last null move, since that too is irreversible, scanning backwards instead of forwards since repetitions are more likely to have happened in recent plies and only checking positions with a matching side to move. Bench: 6645600