Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: MoveGenerator(Bitboard) ~~ Speed ?!

Author: Roberto Waldteufel

Date: 16:01:32 11/05/98

Go up one level in this thread



On November 05, 1998 at 16:43:21, John Coffey wrote:

>On October 29, 1998 at 11:41:15, Hristo wrote:
>
>>What is the best speed that one can achieve generating moves using bitboards?
>>Cycles per ply. Not including eval !!! :))
>>For instance, in very good(middle game...where the pieces are mopved arround)
>>conditions my program can generate 1 ply every 21.7 cycles. This includes all
>>attacks and all squares possible to get to.
>>
>>best regrads.
>>hristo
>
>Why would you use bitboards for generating moves?

By using bitboards you can generate your moves in the right order, ie hashed
move, captures in MVV/LVA order, killer/history  move(s),castling, then
non-captures.

> i.e. at some point you have to get a move list from your bitboard patterns?

I only generate a move list at the root and when side to move is in check (only
then because I want to know how many replies to the check I have for extension
decisions). At other times I never generate a list of moves at all: I just
generate one move at a time, so if one of them gives me a cut-off then I have
saved the effort of generating all the other unsearched moves at that node. Of
course, this is only a practical option if you can generate the moves in the
right order

>If so that involves some
>sort of looping?  If so then I can generate chess moves with a simple loop
>i.e. move the rook right one square I just add one to its position.
>

Yes, you generate moves very fast this way, but they will be in a terrible
ordering that would kill your search, so you have to sort them. It would be more
appropriate to time how long it takes your program to generate *and sort* all
the moves, because with bitboards you essentially do both of these at once, and
you generate multiple moves in parallel as well. I expect that the bitboard
approach will be slower if you don't count your sorting overhead, but they will
be much faster when you count in your sorting overhead as well.

>I can understand using bitboards for evaluation instead.

Yes, they are very handy here as well. Also for check detection, for efficiently
generating all legal replies to a check without ploughing through all the
illegal moves that leave the king in check, and for generating that subset of
legal moves that administer check (useful for futility pruning).

Best wishes,
Roberto

>
>John Coffey



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.