hgm wrote:Indeed, this is what I also remarked above, except that it was not clear to me that they are just using Zobrist hashing with hand-made keys. (Or rather, I could not believe they would propose something so obviously flawed.)
One idea is, if your keys are "hand-made", as you put it, and you have found a flaw with how you had made them, then you can relatively quickly come up with a way to get rid of the flaw. (Admittedly, that fix may sometimes introduce another flaw, so some trial-and-error cycle is guaranteed to take place, until most issues are hammered out.) But if you have decided to rely upon a good pseudo-random generator, then, even though you are already guaranteed to have good luck most of the time, there is no easy way to deal with the remaining bad luck. It just has to be accepted as the cost of doing business this way.
Another underlying idea is, not all collisions are created equal. Some of the positions that could be generated, given enough time, by trying different options for each square (empty, white pawn, back pawn, ..., white king, black king, en passant square where available) are simply illegal and/or unreachable. They will never occur in our search trees, so it doesn't matter if their hash keys collide with those of legal positions. Ideally, we would like to generate the keys so that legal reachable positions wouldn't collide with each other. Pseudo-randomness interferes with this intent.
The initial observation is, a human player does not have a collision problem, because each different piece is distinctly marked right where it is located. The implication of that being that the player recognizes where each piece could potentially move to and when its turns are. While we cannot achieve that with 64 bits, we can certainly separate the occupied squares from the unoccupied ones. This seems important, in order to ensure that when a piece moves, we won't arrive at a collision right away.
Then we can observe that we start out with only 32 pieces, so the board is half-empty to begin with, and then the number of pieces can only decrease as the game progresses, so all collisions with positions that have more than 16 pieces of any given color are inconsequential. From that, given that we are not allowed to have any additional marking at the piece's exact location, the temptation naturally arises to introduce extra marking around the location and make that marking vary from one piece type to another.
It's natural to correlate this outside marking (the piece's "halo") with how the piece can move/capture. The remaining problem to address is how white pieces can be distinguished from black ones with the same movement ability. We should be able to solve this problem by introducing some asymmetry into the "halo" (which, together with the piece's location, forms its "footprint").
The other observation is, no individual move introduces a board wide pattern (or a half-board wide pattern, for that matter). In fact, no natural sequence of moves is likely to "inject" a regular global pattern. Such patterns can be used to take care of castling rights and SideToMove.