An improvement to classic Chess4.5 style bitboards

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

An improvement to classic Chess4.5 style bitboards

Post by Michael Sherwin »

Classic bitboards get bits one ray at a time then ors them together into one complete bitboard. This process is not the slow part of bitboards. The slow part is then using BSF or BSR to make a move list out of them. An alternative to BSF would be to use the single (adjusted) ray bits as a pointer into a table of to-squares. One 64 bit integer unioned as 8 bytes is enough to store the number of to-squares in the ray as well as each to-square. So 64sq * 8dir * 8byte * 128 = 524,288 bytes max if I calculated correctly.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through