Zobrist Hashing

Zobrist Hashing What problem Zobrist hashing solves In a chess engine, we constantly need to: Identify identical positions reached via different move orders Detect threefold repetition Cache evaluations in a transposition table (TT) But: Comparing full board state is too slow Copying board state is too expensive The Core Idea Goal: Convert a chess position into a single 64-bit number (the “hash” or “key”) that: Uniquely identifies the position (with very high probability) Can be incrementally updated when making moves Enables O(1) position comparison What a Zobrist key represents A Zobrist key is a 64-bit integer (Key in Stockfish) representing: ...

January 10, 2026 · 6 min · Sanketh