Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How long to build your chess engine

Author: Robert Hyatt

Date: 05:31:02 01/07/04

Go up one level in this thread


On January 07, 2004 at 05:11:07, Matt Thomas wrote:

>Hi Professor Hyatt!
>
>On January 06, 2004 at 23:41:46, Robert Hyatt wrote:
>
>>On January 06, 2004 at 03:09:57, Matt Thomas wrote:
>>
>>>This question is for those who have designed and built their own chess engine.
>>>How long did it take you?
>>
>>So far, it has taken me 35 years.  And counting.
>>
>>:)
>>
>
>It may be back a while, but were you able to take it from concept, thru design
>and into a reasonably functioning chess engine in about a year?  I am just
>trying to get a rough idea, more out of curiousity than anything.

It is really hard to say, it was so long ago and chess programs of 1968
look nothing like chess programs of today..

Crafty, on the other hand, took a month or so to get running, after I had
finished the first cut on bitmaps (non-rotated back in 1995).  It took a
year of part-time fiddling to make it play pretty well.   It played its
first game during Christmas 1994, and was on ICC by January 1995.  It
finished in 4th at the 1996 WCCC event about 1.5 years later...

>
>>It is a project that will likely _never_ be finished, at least from the
>>perspective of _my_ lifetime, since I am 55 years old at present.  I can
>>see at _least_ another 35 years of work, just to call it "a good start".
>>
>>:)
>>
>
>I don't know, I play chess against Crafty and use it for an opponent for
>positional self-analysis in Chesspad and it is awesome!  Seems like it is
>already well crafted and functional.  I'm sure that one never really finishes
>their work because they always have to tweak a little something here or there,
>but it seems to work without problems, which has to be one of the main design
>goals next to playing a good game of chess, which it also seems to have covered
>rather well.
>
><snipped some of my yakking>
>>>On a more technical side, regarding 64 bit integers, how are those handled by a
>>>32 bit hardware development platform running on a 32 bit OS? (P4/VC6/Win98se) It
>>>seemed to me that they would be handled with twice the amount of instruction
>>>cycles because there are only 32 bit registers and each 64 bit value would
>>>likely be broken into two 32 bit values for math operations.  So the appearance
>>>of a single-pass 64 bit math operation really is handled as two 32 bit values
>>>would be handled.  ...unless I am missing something.
>>
>>
>>Two points.  First, you are correct.  To do 64 bit AND/OR/XOR requires two
>>32-bit instructions.  But remember, modern machines have two instruction
>>pipes and most of the time, one is empty.  This gives you something to poke
>>down it and you get it for almost free.  So the extra work is not actually
>>expensive.  And new 64 bit hardware eliminates this criticism.
>>
>>It will take a good long while to become bitmap-literate, of course.  It
>>requires a new way of thinking at first.
>>
>>
>Hmmm. That has me thinking.  So if I use a 64bit integer where I would otherwise
>be using two 32 bit integers, then it would be processed faster under a multiple
>branch pipeline?  Does that mean that the two 32 bit integers would only be
>handled by a single pipeline?  Now I am wishing that i had read a little more on
>the architecture of the modern PC's.  I know that there are pipelines, but I
>really haven't reviewed their operation.  I can see where knowing a few more
>details there would be helpful.

Correct, in general.  However, I am not saying that 64 bit stuff goes faster
than 32 bit stuff, but they can go about as fast.  Somethings don't quite
parallelize as above, such as shifts and arithmetic operations, as the two
32 bit chunks have to be done in serial order.



>
>I feel a need to dig up one of my ASM books to review bitwise math and how it is
>implemented in the registers.  I know its quick, but I really don't remember at
>the moment just why it is so quick. (Visual Basic will dull the senses...)
>


It is quick because things like AND are gate-level operations.  IE you can
buy a chip that simply ANDs two N-bit values with a delay of picoseconds,
because that can be done directly in hardware at the logic level.




>Regarding bitmaps and bitwise operations... I understand where and how I want to
>use the AND and XOR bitwise operators.  What would OR be used for?  Maybe I
>missed something in bitmaps 101. I am using bitmaps for attack/move vectors and
>one each for white and black pieces.   -matt

AND is used to clear a particular bit or bits.  OR is used to set a particular
bit or bits, and XOR is used to toggle a particular bit or bits...




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.