BCH Hashing

Home * Search * Transposition Table * BCH Hashing



BCH Hashing, a fast incremental Hash function to transform a board position into a number of a set length, quite similar to Zobrist Hashing. It was proposed by Tony Warnock and Burton Wendroff in 1988, relying on BCH codes invented by Alexis Hocquenghem in 1959 , and independently by Raj Chandra Bose and Dwijendra Kumar Ray-Chaudhuri in 1960. They used a BCH signature length of 81 (or more) bits to protect 16 bits from the full position string of 749 (64*12 - 2*2*8 + 4 + 8 + 1) bits, which is sufficient to avoid collisions within an 8 ply search. They stored 63 bits of the BCH signature as "lock" inside the table, and used 18 (or more) lower bits as index. Rainer Feldmann elaborates on BCH codes inside his thesis as well, and refers Elwyn Berlekamp's Algebraic Coding Theory.

=Quotes=

Tony Warnock
on Search Tables in Computer Chess : The following paper describes a method of generating the numbers for a hash table. By using error correcting codes, we ensure that positions that are close on the board are not close in the hash space. Some experiments showed that we got an improvement in collision rate compared to using a random set of numbers.

MacWilliams and Sloane's book on error correcting codes has the glory details about the theory and programming.

Kathe and Dan Spracklen
excerpt from their Oral History : Well, first explain what a hash table is... You want to spread your positions out over a large data area so you need random numbers that will distribute a Chess position over, you know, a lot of different, you know, memory maps or memory locations.

So BCH random numbers were something that some people had developed at the University of New Mexico. Those people had a Chess program. They wrote an article on it and ... I think it's three different people that developed it. Anyway, it's a coding scheme that gives the maximal distance between... Bit adjacent numbers so that you spread your positions over - more uniformly over the hash table area. They don't tend to bunch up as much that way.

So, anyway, they wrote an article on how to do that and I had - in fact, I even got the book that they recommended and read it and figured it out how to do it because they didn't really tell you how to do it. They just said that they were using them and they were... So I tried it and, sure enough, they worked a lot better than the old method of getting random numbers.

=See also=
 * Hash Table
 * Zobrist Hashing

=Publications=
 * Alexis Hocquenghem (1959). Codes correcteurs d'erreurs. Chiffres, Paris 2, pp. 147–156 (French)
 * Raj Chandra Bose, Dwijendra Kumar Ray-Chaudhuri (1960). On A Class of Error Correcting Binary Group Codes. Information and Control Vol. 3, No. 1, pp. 68–79, ISSN 0890-5401, pdf
 * Elwyn Berlekamp (1968). Algebraic Coding Theory. New York: McGraw-Hill. Revised ed., Aegean Park Press, (1984), ISBN 0894120638. amazon
 * Jessie MacWilliams, Neil Sloane (1981). The Theory of Error-Correcting Codes. North-Holland Mathematical Library, amazon
 * Tony Warnock, Burton Wendroff (1988). Search Tables in Computer Chess. ICCA Journal, Vol. 11, No. 1
 * Rainer Feldmann (1993). Game Tree Search on Massively Parallel Systems. Ph.D. Thesis
 * Jean-Christophe Weill (1995). Programmes d'Échecs de Championnat: Architecture Logicielle Synthèse de Fonctions d'Évaluations, Parallélisme de Recherche. Ph.D. Thesis. Université Paris 8, Saint-Denis, zipped ps (French)
 * J. P. Grossman, Levente Jakab (2004). Using the BCH construction to generate robust linear hash functions. Information Theory Workshop, 2004. IEEE

=Postings=
 * Re: Hash tablesClash!!!-What happens next? by Tony Warnock, rgcc, March 17, 1994
 * Re: Hash functions for use with a transition table by Ronald de Man, rgcc, March 7, 1997
 * How gracefully do BCH codes degrade by Eb Oesch, Science Forum, math, May 20, 2008
 * Re: Overlapped Zobrist keys array by Rémi Coulom, CCC, October 06, 2009

=External Links=
 * BCH codes from Wikipedia
 * Berlekamp–Massey algorithm from Wikipedia
 * Berlekamp–Welch algorithm from Wikipedia
 * Coding theory from Wikipedia
 * Coding Theory by Andrew Thangaraj, Department of Electronics & Communication Engineering, Indian Institute of Technology Madras, YouTube Videos
 * Cyclic code from Wikipedia
 * Error detection and correction from Wikipedia
 * Finite field from Wikipedia
 * GF(2) from Wikipedia


 * Forward error correction from Wikipedia
 * MinT - Cyclic Codes (BCH-Bound)
 * Root of unity modulo n from Wikipedia
 * Hux Flux - Calculus, Cryptic Crunch, YouTube Video

=References= Up one Level