Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: annoying en passant x-ray

Author: Uri Blass

Date: 04:36:06 12/01/03

Go up one level in this thread


On December 01, 2003 at 06:58:41, Sune Fischer wrote:

>On December 01, 2003 at 02:56:17, Uri Blass wrote:
>
>>On November 30, 2003 at 19:43:00, Sune Fischer wrote:
>>
>>>On November 30, 2003 at 18:50:07, Gerd Isenberg wrote:
>>>
>>>><snip>
>>>>>>The rule I would follow is:  "You cannot play a move which puts your own king
>>>>>>into check."  I hope that was built into all chess engines.
>>>>>>
>>>>>>Bob D.
>>>>>
>>>>>Sure, but if you want to implement legal move generation,
>>>>>to avoid making/unmaking invalid moves, you need some other conditions.
>>>>>Ep is a bit annoying, all others are easier to implement.
>>>>>Pinned piece determination is required, but also fine for other purposes.
>>>>>
>>>>>Gerd
>>>>
>>>>There are always these pathological positions.
>>>>This one to get the idea of legal move generation ;-)
>>>>
>>>>[D] 8/5p2/pP2k2p/P3q3/1p2Q3/rR2K1Rr/3B3P/2b3n1 w - -
>>>
>>>No pun intended, but what is it that is so clever about legal move generation?
>>>
>>>It seems faster to put off the expensive legality check until the last moment
>>>just before you make the move.
>>>That way you save a lot of legality checking if/when you fail high.
>>
>>I do not have legality checks in many cases.
>>
>>If the knight is pinned then I do not generate moves of it and I never need to
>>check for every move if it is legal.
>>
>>if the rook is pinned then I can generate only moves of the rook to the pin
>>direction.
>
>Yes I can see how you get some discount if you need all the moves.
>Typicly you only have to concern yourself with the 'from' square of each piece,
>then you can generate a batch of moves with no extra checking.
>
>But the slowdown, I think, is in that you have at least one check for each
>moving piece.

Yes

I solved this problem by having a flag that tell me if pieces are pinned and if
there are no pinned pieces I do not have one check for every moving piece.

>
>Perhaps it is not that slow if done right, maybe I should give it a try sometime
>:)
>
>>The knowledge about pins can also be used for better pruning.
>>
>>Even in case of king move there is no expensive legality checks because finding
>>if the square is under threat is done by one look in the table.
>>
>>Of course I waste time for updating the tables but the tables can be productive
>>for other things.
>
>The eternal issue of tables :)
>
>Have you tried doing this stuff on the fly?
>For me it is faster to have an ordinary and 'slow' attack routine because I only
>need it for a few squares and not the whole board.

Maybe it is faster to do it different but I worked a lot on my move generator
and I am too lazy to rewrite everything.

I also believe that the big improvement that I can get in the future are
exponential improvement from things like better order of moves and not linear
improvements but the next planned improvement (hashing my heavy qsearch is
probably going to give only a linear improvement).

>
>The main speed up is in the endgame, I don't do king safety there so I don't
>need attack info around the king (I also think there are other ways to do king
>safety, btw:).
>
>-S.

I also do not use my attack tables today much in the endgame
but there are still cases when I use it(for example to decide if a promotion is
a good promotion or bad promotion for order of moves).

I think that it should be used for extensions(for example extending moves when a
weak pawn is attacked and not defended in the right cases).

I plan to be able to find information by functions but I still did not implement
all the relevant functions and SEE is still not implemented.

Another thing that is still not implemented is internal iterative deepening.
I understand the idea but I still did not think exactly how to implement it
and after reading a post that suggested that it did not help much I decided to
look for other ideas.

It is also possible that the task could be easier in case of writing the code in
a different way.

Uri



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.