1) Standard BB: it is a “typical” one with rotated bitboards, using functions firstOne, takeOne... to get piece positions when generating moves, evaluating. To get piece type of a given position the code needs to check about 7 bitboards.
2) BB with piece list: it is actually (1) + a piece list. The bad point is that it has some extra code to update the piece list when making/taking back moves. It is a bit annoying since I cannot add back pointers from the board to piece list (we could do that for mailboxes) thus the code has to scan the piece list to find positions or empty slots. The good point is that now it can get benefit from piece list when generating moves and evaluating since it doesn’t need to call firstOne/takeOne and many while-loops. To get the piece type of a given position the code needs to check about 16 items in the piece list. For my implementation, look like functions incheck, getPieceType (for a given position) don’t get benefit from that piece list.
3) BB with piece list and evaluation of (1): Since my evaluation function is so simple, just count material and square scores, using only piece list may give 2 too much advantage to 1 (and may be far from real and full evaluations). Thus this implementation doesn’t use the piece list for evaluation, but copy the evaluation code of 1. I just want to make sure the board can get benefit from piece list for move generators / make / unmake instead of mainly from evaluation.
The search function of the test is implemented with straightforward / simple alphabeta, quiescent, hash table, null moves... It searches to depth 7. All statistics are collected after searching 50 game positions (which are randomly picked from real human master games). All search trees are identical (based one numbers of nodes and all other stats). Bellow is elapsed times in seconds:
Code: Select all
1) Standard BB: 7434s (116.6%)
2) BB + a piece list: 6372s (100%)
3) BB + a piece list + eval (1): 7406s (116.2%)
1) Depend on implementation such as using a simple evaluation, bitboards + piece list may gain some performance. Otherwise it may gain very little or almost nothing
2) Look like bitboards + piece list is not a big winner but not a loser either. You may implement and improve it for better performance later