~/talk

Optimizing Bishop, Rook, and Queen Move Generation in a Chess Engine

Talkat C++Now 2026 · 2026-05-04..05-08· [software-architecture]
links:none on file
slides:none on file

Claim: sliding-piece generation drops from ~20+ ns to ~1 ns by using magic bitboards implemented in software as a portable alternative to PEXT. Implementation lives in FollyChess, with build-time table generation wired into Bazel because consteval RNGs fail. Microbenchmarks show bishops ~1.23 ns, rooks ~1.30 ns, queens ~1.96 ns; finding magic constants takes many random attempts but the generator runs in ~1 s during build. End-to-end search sees ~1.2–1.3× speedups and stable ~2.5M nodes/sec on test positions.

AI-written summary · about

  1. 0:00Introduction
  2. 4:29Chess engine data structures
  3. 15:50Knight moves with bitboards
  4. 20:01Sliding pieces basics
  5. 26:28Bishop rook queen challenges
  6. 44:02Fast sliding piece generation
  7. 59:22Magic bitboards
  8. 1:18:09Performance benchmarks
  9. 1:32:16Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.