Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: legal move generator that is 20 times faster than Crafty

Author: Andrew Williams

Date: 06:23:30 07/02/01

Go up one level in this thread


On July 02, 2001 at 07:39:11, Uri Blass wrote:

>On July 02, 2001 at 05:12:48, Andrew Williams wrote:
>
>>On July 01, 2001 at 18:50:55, Uri Blass wrote:
>>
>>>On July 01, 2001 at 18:07:48, Andrew Williams wrote:
>>>
>>>>On July 01, 2001 at 17:52:48, Bruce Moreland wrote:
>>>>
>>>>>On July 01, 2001 at 13:21:04, Uri Blass wrote:
>>>>>
>>>>>>On July 01, 2001 at 12:58:40, Bruce Moreland wrote:
>>>>>>
>>>>>>>On July 01, 2001 at 06:44:23, Uri Blass wrote:
>>>>>>>
>>>>>>>>On July 01, 2001 at 05:09:45, stefan wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>see also
>>>>>>>>>
>>>>>>>>>http://members.tripod.com/~RyanMack/hypertech.htm
>>>>>>>>
>>>>>>>>If it is truth than it seems that we are going to see a progress of more than
>>>>>>>>200 elo in comp-comp games only because of better software for the PIII
>>>>>>>>hardware.
>>>>>>>>
>>>>>>>>I have not enough knowledge to understand if he is right
>>>>>>>>
>>>>>>>>Uri
>>>>>>>
>>>>>>>If the move generator in my own program took zero time it would increase in Elo
>>>>>>>points by maybe 20 or 30, and that's probably high.
>>>>>>>
>>>>>>>bruce
>>>>>>
>>>>>>You are right that only move generation is not enough but the point is that I
>>>>>>understand that the data structure helps to do everything faster.
>>>>>>
>>>>>>He suggests in the last 3 lines when you click on the link that the program can
>>>>>>see 10,000,000 nodes per second with the evaluation function
>>>>>>
>>>>>>If you rememeber that nodes is only legal move because he talked about legal
>>>>>>move generator then the result is more impressive.
>>>>>>
>>>>>>We need to wait and see if he is right.
>>>>>>
>>>>>>Uri
>>>>>
>>>>>I looked at it and I think there's a good chance he's full of beans.  I don't
>>>>>think he has the first clue about how to build a chess program, and I think that
>>>>>he thinks that if he gets the first small part of it done perfectly, the rest
>>>>>will just naturally follow.
>>>>>
>>>>>I don't know if there is a name of this kind of thing, but I see this attitude
>>>>>expressed often.  On the one hand, we have builders, on the other, we have
>>>>>visionaries.  But this kind of person is neither.  You have someone who knows
>>>>>nothing about a problem, but is confident that the problem is trivial and can be
>>>>>easily solved (by them in particular), and when you question them about the
>>>>>aspects they haven't considered and can't cope with, they blow smoke and make
>>>>>promises they can't keep.
>>>>>
>>>>>Perhaps a term for these people is "marketing".
>>>>>
>>>>>bruce
>>>>
>>>>.. Or "children"  ->  http://members.tripod.com/~RyanMack/aboutme.htm
>>>>
>>>>:-)
>>>>
>>>>Andrew Williams
>>>
>>>Even if his assumptions are wrong I find his knowledge very impressive for a 16
>>>years old(assuming that he is not lying).
>>>
>>
>>I agree. He wouldn't be the first teenager who was clever but not wise.
>>
>>>I also work on a legal move generator but I know nothing of assembler and
>>>nothing of optimizations for pIII.
>>>
>>>My legal move generator is not perfect(it does not consider legal en passant
>>>moves in replies to check and it considers every illegal en passant capture when
>>>the pawn is not pinned)  but it is good enough to calculate perft 6 in the
>>>initial position and perft 5 in another poisition correctly.
>>>
>>>I have some ideas how to improve significantly the speed of my move generator
>>>but I have no estimate exactly how much it is going to be faster and my ideas
>>>are only about the algorithm.
>>>
>>>Today it is about 10 times slower than Crafty in calculating the perft function.
>>>
>>>I do not think to continue with a chess program before I will be satisfied with
>>>the speed of calculating the perft function.
>>>
>>>Uri
>>
>>I wouldn't care too much about that. Suppose you have loads of stuff in your
>>makemove() that makes it possible to achieve very good move-ordering. Or that
>>makes it very quick to evaluate a node (because much of the work has been done
>>earlier). Then your perft speed will be terrible, but your program could be
>>excellent.
>>
>>Andrew
>
>Thanks, but I know that there are programs that generate only legal moves that
>are faster than Crafty in calculating perft because they do not have to make the
>last move.
>
>My program does not have to do the makemove() in order to know the number of
>legal moves in the last ply because this number is calculated in the gen()
>function but inspite of this it is about 10 times slower than Crafty.
>
>The main problem of my program is the fact that my function of updating the
>arrays is not good and I calculate again a lot of information that is not
>changed.
>
>An example: after a pawn move like a2-a4 the directions that c4 is seen and the
>square that c4 is seen are the same but my program does not know it.
>
>Note that you need to update this information after b2-b4 beacuase it is
>possible that there is a Rook in a4 before the move but my program in this case
>also does a lot of other calculations that are not relevant.
>
>It does not construct all my arrays from scratch except after enpassant move or
>castling(this is also something that needs to be corrected) but it does a lot of
>useless computations.
>
>Uri

My program keeps its attack boards up to date in the makemove function. In
the example you give, it looks at all the pieces that attack a2 (denoted by
a 32-bit unsigned int) and all the pieces that attack a4 (denoted by another
32-bit unsigned int). These ints are ORed together. My program then inverts
this int (if the move was a capture, I clear the bit for the captured piece at
this stage) and runs through all 64 squares masking out these bits. It then
iterates through the set bits in the un-inverted int and re-calculates the
attacks of those pieces. I would think I could improve this a lot by
*calculating* the attacks that I want to mask out, but I've not tried this.

Andrew





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.