Why it matters

Zobrist enables fast position hashing. Foundation for transposition tables.

Advertisement

The architecture

Random 64-bit key per (piece, square).

Board hash = XOR of all present.

Move: XOR out old, XOR in new.

Zobrist hashingRandom keysper piece-squareInitial hashXOR of presentMove updateXOR deltaAlso hash side-to-move, castling rights, en passant for full position
Zobrist.
Advertisement

How it works end to end

Incremental: O(1) per move.

Turn key: XOR on side change.

Castling + en passant keys.