I only spent a couple of months on it (before getting distracted again) and adopted a 'keep it simple stupid' approach for my own sanity whilst trying to get my aging brain around bitboards.
Recently I have gotten back into the swing of things again and am now wondering if my current simple design should be improved upon.
My main bitboard storage is a single, two-dimensional array...
UINT64 PiecesBB[Sides][Pieces];
Looking at the Stockfish code they take a different approach...
Bitboard byTypeBB[PIECE_TYPE_NB];
Bitboard byColorBB[COLOR_NB];
(We both reserve a special entry for 'all' pieces within the array.)
I can see the Stockfish approach has an immediate advantage when you need the 'all occupied squares' bitboard...
For Colossus I often have to do...
PiecesBB[0][AllPieces] | PiecesBB[1][AllPieces];
But Stockfish simply has...
byTypeBB[ALL_PIECES]
Also the Stockfish design has the advantage of greater data density as it represents the whole board in fewer bitboards.
What other designs are there? What do you guys use?
Is there a generally accepted 'best' design?
What other advantages might they offer? (I'm loath to rewrite a load of working/tested code for negligible benefit
Many thanks in advance for any pearls of wisdom!
