magic bitboards and nps

Discussion of chess software programming and technical issues.

Moderator: Ras

benstoker
Posts: 342
Joined: Tue Jan 19, 2010 2:05 am

magic bitboards and nps

Post by benstoker »

The engine-that-dare-not-speak-its-name just implemented 'magic bitboards'. This appears to have decreased the nps. I would think the purpose of magic bitboards is to increase nps. Am I mistaken? Is there some other benefit to this beyond increase in search speed?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: magic bitboards and nps

Post by bob »

benstoker wrote:The engine-that-dare-not-speak-its-name just implemented 'magic bitboards'. This appears to have decreased the nps. I would think the purpose of magic bitboards is to increase nps. Am I mistaken? Is there some other benefit to this beyond increase in search speed?
No reason it should slow down. There is essentially no speed difference between rotated bitboards and magic. At least when I converted to Crafty I saw no speed difference at all. There are some flexibility issues that favor magic bitboards, not the least of which is not needing to maintain the rotated stuff, which takes time and makes it easier to generate moves without having to do a lot of work updating 4 boards first.
User avatar
hgm
Posts: 28443
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: magic bitboards and nps

Post by hgm »

Magic bitboards require far larger tables than rotated bitboards, and thus produce a much havier cache load. For an engine with a quite small cache footprint, where all the accesses neded for rotated bitboards would be L1 hits, the rotated bitboards could be much faster than magic.