Computer Chess Club Archives


Search

Terms

Messages

Subject: New BB idea

Author: Bas Hamstra

Date: 14:27:52 05/15/00


I have an idea but no time to measure it's performance. Maybe Dan and/or Bob can
comment.

With rotated bb's you keep 4 rotated bb's, that let you determine the "state" of
a "ray". Knowing square and state you look up the attacked squares in an array.

I have an alternative. Isolate a certain ray in Occupied, using a raymask, and
AND it with OccupiedAll. Compute LastBitOfRay() and FirstBitOfRay() of the
result in one run, returning as follows:

     RetVal = (FirstIdx<<3)|LastIdx;

Lookup RayMask[Square][RetVal] in a table.

Pro:

a) no shifting of unsigned __int64's needed
b) no need to keep rotated BB's
c) lookuptables reduced to 25% of normal size, so supposedly better cash
performance

Con:

a) cost of the FirstLastRay()'s. You would start with a combined
FirstOne()/LastOne(), and then, for instance for the RankRay, do a FILE() extra
to compute the FirstBitOfRay. Ditto for Diag's, and for the FileRay you do a
RANK().

Intuition says the cost of FirstLast() is considerable, but still worth to try?


Regards,
Bas Hamstra.











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.