Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Generator

Author: Sune Fischer

Date: 04:26:12 12/20/02

Go up one level in this thread


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.

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.



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.