PieceLists ?
Moderators: hgm, Rebel, chrisw
-
- Posts: 234
- Joined: Sat Jan 17, 2015 11:54 pm
PieceLists ?
Is there any advantage to using a piece list based position representation alongside bit boards ? anyone who tested the speed difference with/without ?
-
- Posts: 7216
- Joined: Mon May 27, 2013 10:31 am
Re: PieceLists ?
Bit boards fine. Magic bit boards probably waste of time.MahmoudUthman wrote:Is there any advantage to using a piece list based position representation alongside bit boards ? anyone who tested the speed difference with/without ?
-
- Posts: 199
- Joined: Sun Nov 03, 2013 9:32 am
Re: PieceLists ?
I added piece lists to my x088 engine with very good results.
Somethings work well with one data structure, somethings with the other,
so you can combine the best of both worlds.
Somethings work well with one data structure, somethings with the other,
so you can combine the best of both worlds.
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: PieceLists ?
A bitboard performs essentially the same function as a piecelist anyway. What would adding a piecelist give you that bitboards don't do already?
-
- Posts: 433
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
Re: PieceLists ?
Bitboards are a way to represent piecelists, so they are redundant with another representation. A redundant piece lists may be worth on system where bitboards are not very performant (32 bit system), though.MahmoudUthman wrote:Is there any advantage to using a piece list based position representation alongside bit boards ? anyone who tested the speed difference with/without ?
Richard Delorme
-
- Posts: 7216
- Joined: Mon May 27, 2013 10:31 am
Re: PieceLists ?
When looking up what piece is on a particular square it is probably faster to look it up in an array than in a set of bit boards. How many bit boards are there ? Five or six perhaps.abulmo2 wrote:Bitboards are a way to represent piecelists, so they are redundant with another representation. A redundant piece lists may be worth on system where bitboards are not very performant (32 bit system), though.MahmoudUthman wrote:Is there any advantage to using a piece list based position representation alongside bit boards ? anyone who tested the speed difference with/without ?
-
- Posts: 433
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
Re: PieceLists ?
Yes, this the weak point of bitboards and a piece array is usually used to store the content of the chess board. Note that piece lists alone suffers from the same problem.Henk wrote:When looking up what piece is on a particular square it is probably faster to look it up in an array than in a set of bit boards. How many bit boards are there ? Five or six perhaps.abulmo2 wrote:Bitboards are a way to represent piecelists, so they are redundant with another representation. A redundant piece lists may be worth on system where bitboards are not very performant (32 bit system), though.MahmoudUthman wrote:Is there any advantage to using a piece list based position representation alongside bit boards ? anyone who tested the speed difference with/without ?
Bitboard are good at storing the position of each pieces, thanks to cpu instructions like bsf or bsr and very usefull to do fast move generation, with magic bitboard, kindergarten, or whatever algorithm.
Richard Delorme
-
- Posts: 1434
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: PieceLists ?
I don't think there is a winner between checking 16 item-array and 6 bitboards since the number of IFs is about 3 times as many.Henk wrote: When looking up what piece is on a particular square it is probably faster to look it up in an array than in a set of bit boards. How many bit boards are there ? Five or six perhaps.
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: PieceLists ?
Actually, it's very hard to beat the raw performance of a well-written mailbox move generator. Bitboard serialisation is not particularly fast and magic bitboards consume a fair chunk of cache space. A mailbox uses a very tight inner loop and little memory access (just the board).abulmo2 wrote: Bitboard are [...] very usefull to do fast move generation, with magic bitboard, kindergarten, or whatever algorithm.
Where bitboards shine is in letting you intersect the piece list with particular sets: all rooks that are on open files, all enemy queens that align with our king. All knights that are able to fork two pieces. Or doing bulk operations on pawns, or detecting evaluation patterns.
-
- Posts: 373
- Joined: Wed Mar 22, 2006 10:17 am
- Location: Novi Sad, Serbia
- Full name: Karlo Balla
Re: PieceLists ?
Piece list and board array are two different things. Piece list is list of piece coordinates (max 32). Board array is array of squares.Henk wrote:When looking up what piece is on a particular square it is probably faster to look it up in an array than in a set of bit boards. How many bit boards are there ? Five or six perhaps.abulmo2 wrote:Bitboards are a way to represent piecelists, so they are redundant with another representation. A redundant piece lists may be worth on system where bitboards are not very performant (32 bit system), though.MahmoudUthman wrote:Is there any advantage to using a piece list based position representation alongside bit boards ? anyone who tested the speed difference with/without ?
Best Regards,
Karlo Balla Jr.
Karlo Balla Jr.