Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Generator

Author: Gerd Isenberg

Date: 05:00:31 12/20/02

Go up one level in this thread


On December 20, 2002 at 07:26:12, Sune Fischer wrote:

>On December 20, 2002 at 06:40:45, Gerd Isenberg wrote:
>
>>>Hi Uri,
>>>
>>>but a pseudo legal move generator is faster. You have to check if the king is in
>>>check only if you must evaluate a position.
>>>What is the advantage of a slower legal move generator?
>>>
>>>Andreas
>>
>>Hi Andreas,
>>
>>Not sure about that. Detecting pinned pieces is a rather fast and loopless  task
>>with bitboards, specially with mmx-fill routines (unrolled for each of eight
>>directions). In the same run one could also detect possible covered checkers fo
>>the opposite side.
>>
>>eg. for one direction:
>>
>>// rooks or queens
>>if ( enemyRookMover & allRaysFromSquare[ownKingSquare])
>>{ // scan four staight directions
>>  dirBB    = getLeftAttacks(ownKingBB) & getRightAttacks(enemyRookMover);
>>  pinned  |= dirBB & ownPieces;
>>  covered |= dirBB & enemyPieces;
>>  ...
>>}
>>
>>Of course it's a bit overhead but the gained information is also usefull for
>>other things, as Uri already pointed out.
>>
>>If there are pinned pieces, one safes making/unmaking invalid moves and there is
>>no need (may be only for debug purposes) to look whether a king may be captured.
>>
>>Gerd
>
>The overhead of making/unmaking pinned pieces is extremely small.
>I count about 0.5-1.5% pinns, the make/unmake move rutines take maybe 20% (in my
>case) but I only need to do half a move to see if the move is legal, in total
>that's about 0.075% overhead because of illegal pinned moves!!
>
>I'm pretty sure there is _no way_ you can detect pinns faster and improve on
>this overhead.

Hi Sune,

I'm not sure, specially if we consider hammer or SSE2. I use dumb6fill for 2 or
3 directions simultaniously (8 mmx-registers). With SSE2 or hammer it can be
done for all 8-directions in parallel, with sliders and king in one 128-bit-xmm
register.

>
>I agree, there are other reasons to do it. It must be good for extensions, as
>Uri says a pinned queen might be reason to extend.
>
>One of the best things though, must be if you generate all moves all the time,
>that would be real nice for extensions and threat detections.
>
>But I didn't think any bitboarders generated all moves since bitboards are so
>good at incremental generation, is this what you do?
>
>-S.

I guess yes, but incremental generation is possibly the wrong term. I don't look
to previously generated moves two plies before. It's a finite state machine move
generator, trying to generate as less as possible, hoping for a cutoff. But my
final approach with hammer in mind is quite unclear so far.

Gerd



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.