Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: High performance move generation

Author: leonid

Date: 04:49:03 11/17/99

Go up one level in this thread


On November 17, 1999 at 05:43:20, Dan Newman wrote:

>On November 16, 1999 at 18:58:20, leonid wrote:
>
>>On November 16, 1999 at 18:12:48, Dave Gomboc wrote:
>>
>>>On November 16, 1999 at 16:11:55, Dan Newman wrote:
>>>
>>>>On November 16, 1999 at 06:11:48, Alexander Kure wrote:
>>>>
>>>>
>>>>>A few months ago I implemented a movegenerator for 0x88 board and tried to do
>>>>>some performance improvements so I am glad to see this thread starting ;-)
>>>>>My pseudo move-generator app. generates 3 MNodes on a Pentium MMX 233 Mhz in
>>>>>Vincent's position and is app. 2.5 times faster on a Pentium III 550 Mhz giving
>>>>>7.5 MNodes (without sorting and assigning scores for a move). Far away from the
>>>>>high score, I'm afraid ;-)
>>>>>Unfortunately I can not show up with the code, cause I am at work right now.
>>>>>Maybe later if requested.
>>>>>
>>>>>But I doubt if using a switch instead of indexing through a piece array gives
>>>>>any performance improvement. But directly proccessing each direction (e.g. NE,
>>>>>NW, SE, SW for Bishop) for a piece seperately instead of looping and indexing a
>>>>>piece dependent direction array surly yields some performance improvement. While
>>>>>this lacks elegance it improves speed.
>>>>>I will check this out!
>>>>
>>>>The code certainly is ugly.  My 0x88 move generator code is 767 lines long
>>>>and that's with a lot of macros to shorten it.  The bitboard code is at 1168
>>>>LOC--but that also includes a check evasions generator.
>>
>>
>>On what language those 767 code lines are written? And do your "move generator"
>>produce the moves for both sides or for one color? And one last question: What
>>is exactly the "check evasions generator"?
>>
>>Thsnks,
>>Leonid.
>
>I'm using C++, though mostly as a "better" C in the 0x88 program.
>
>The 767 lines is for both colors.
>
>A check evasions generator is called when the side-to-move is in check
>and generates only moves that get it out of check.  Typically these
>are legal move generators, but mine is a pseudo-legal check evasions
>generator that generates only moves that remove the check that was given
>by the last move.  It may still put the king en prise via discovery or
>by moving the king into harms way.  The reason I do this is that I built
>the legality testing into make() and so can't avoid doing it and I don't
>want to do it twice.  I may change this, but it works, so I might not.
>
>It is more desirable to have a check evasions generator that produces
>only legal moves.  Then you can use the move count to decide whether
>to do a one-reply extension or to determine if you've reached a game
>theoretical node without having to try all the moves first.
>
>-Dan.

Very interesting because it is so far from everything that I wrote. So one
billion different ways of writing really existe, like I expected. For sure, my
"move generator" take more that one thousand lines, when I speak about legal
moves logic. In my logic I could not see how to use the same procedures for
different colors. For the sake of speed each side goes after its distinct logic.
Your "pseudo-legal check evasions generator" is the other surprise. Maybe it in
some way resemble to my general procedures for boths colors. This kind of
procedure find in advance from where check goes from the opposite side. Which of
your pieces will leave the king under the fire if they will move from  their
initial places.

Leonid.




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.