Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about speed and bitboard

Author: Uri Blass

Date: 20:39:21 09/16/04

Go up one level in this thread


On September 16, 2004 at 22:22:24, Michael Henderson wrote:

>On September 16, 2004 at 21:20:50, Uri Blass wrote:
>
>>What is faster doing a loop on the 1's of a bitboard or doing a loop on array of
>>integers
>>
>>I simply consider to change my knight move generator to bitboards
>>
>>Today I have array
>>int knightmove[64][8] and the question is if getting
>>knightmove[c3][0],...knightmove[c3][7] is faster or slower than getting the same
>>squares by calculating the 1's of knightoption[c3] in order to get the squares
>>that the knight can go.
>>
>>I also consider to have bitboard knightcapturewhite[64] knightcaptureblack[64]
>>and knightquietmoves[64] that are going to be updated incrementally after every
>>move and the question is what is the price of this in speed.
>>
>>Do people who use bitboards have experience with it?
>>
>>Uri
>
>I have never tried that with my bitboard program but here are my thoughts:
>knightmove[64][8] would take at least two lookups and at most eight, but
>probably the extra memory traffic won't matter.  knightoption[c3] stuff is
>probably better for cache.  Also important is the fact that you want the
>bitboard representation of the moves so you can do binary operations with them
>i.e. knightmoves[c3] & blackPieces -- if no captures, no further work required
>(not the case with knightmove[0][a] strategy).  That makes it a win for qsearch
>and capture generation.

I have no function to generate only captures and my qsearch is simply based on
generating all legal moves and looking for the moves that were marked as
captures (in the first plies also checks are considered).

Writing a function to generate only captures is not very simple because I
generate only legal moves and I am not sure if it is going to help much.

Generating all legal moves is part of the evaluation that is using the number of
moves and the number of moves of the opponent in previous ply when I go backward
2 plies in case that one of the sides was in check(I may try to replace it by
different mobility that is not based on counting moves but still did not do it).
>
>I don't think that updating the knightmoves won't gain you any noticeable
>improvement if at all, maybe just overhead.  I would just do bitboard lookup and
>binary operation which is very fast.
>
>hope that helps,
>Michael

Thanks for your thoughts.

Movei is not a bitboard program and today I do not have Bitboard for
blackpieces and whitepieces.

Today I simply have piece lists like
int knights[10][2] that gives me the white knights and the black knights.

Knightmove[64][8] seems big array relative to the piece lists and I thhought
that the size of it may be a problem.

I may consider to use a bitboard of white pieces and black pieces that is
updated every move but I am not sure if it is a good idea.

I do not plan to go for 0x88 or mailbox.

Uri



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.