Avoiding Rotated Bitboards with Direct Lookup
Sam Tannous

TL;DR
This paper introduces a method to directly access attacked squares of sliding pieces in chess using hash tables, eliminating the need for rotated bitboards and simplifying move generation.
Contribution
The paper presents a novel hash table-based approach for attack detection that avoids the complexity of rotated bitboards in chess engines.
Findings
Direct hash table lookup is faster than rotated bitboard methods.
The approach simplifies move generation by removing the need for rotated bitboard updates.
Performance benchmarks show improved speed in move generation.
Abstract
This paper describes an approach for obtaining direct access to the attacked squares of sliding pieces without resorting to rotated bitboards. The technique involves creating four hash tables using the built in hash arrays from an interpreted, high level language. The rank, file, and diagonal occupancy are first isolated by masking the desired portion of the board. The attacked squares are then directly retrieved from the hash tables. Maintaining incrementally updated rotated bitboards becomes unnecessary as does all the updating, mapping and shifting required to access the attacked squares. Finally, rotated bitboard move generation speed is compared with that of the direct hash table lookup method.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMusic Technology and Sound Studies · Multimedia Communication and Technology
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] \harmsbibitem Adelson-Velskii et al. Adelson-Velskii et al. 1970 bitman 70Adelson-Velskii, G., Arlazarov, V., Bitman, A., Zhivotovskii, A., and Uskov, A. (1970). Programming a computer to play chess. Russian Mathematical Surveys , Vol. 25.
- 2[2] \harmsbibitem Czech, Havas, and Majewski Czech et al. 1992 czech 92Czech, Z. J., Havas, G., and Majewski, B. S. (1992). An Optimal Algorithm for Generating Minimal Perfect Hash Functions. Information Processing Letters , Vol. 43, pp. 257–264.
- 3[3] \harmsbibitem Heinz Heinz 1997 heinz 97Heinz, E. A. (1997). How Dark Thought Plays Chess. ICCA Journal , Vol. 20, pp. 167–176.
- 4[4] \harmsbibitem Hyatt Hyatt 1999 hyatt 99Hyatt, R. (1999). Rotated Bitmaps. ICCA Journal , Vol. 22, pp. 213–222.
- 5[5] \harmsbibitem Hyatt, Gower, and Nelson Hyatt et al. 1990 hyatt 90Hyatt, R., Gower, A., and Nelson, H. (1990). Chapter 7: Cray Blitz in Computers, Chess, and Cognition, T.A. Marsland and J. Schaeffer (eds.) . Springer. ISBN 0387974156.
- 6[6] \harmsbibitem Knuth Knuth 1998 knuth 98Knuth, D. E. (1998). The Art of Computer Programming, Volume 3, Sorting and Searching . Addison Wesley. ISBN 0201896850.
- 7[7] \harmsbibitem Krogius Krogius 1980 krogius 80Krogius, N. (1980). Encyclopedia of Chess Middle Games . Batsford. ISBN 0713434740.
- 8[8] \harmsbibitem Leiserson, Prokop, and Randall Leiserson et al. 1998 leiserson 98Leiserson, C. E., Prokop, H., and Randall, K. H. (1998). Using de Bruijn Sequences to Index a 1 in a Computer Word. \url http://citeseer.ist.psu.edu/leiserson 98using.html.
