Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Let the king capture or generate legal moves

Author: Michel Langeveld

Date: 12:16:28 11/20/04

Go up one level in this thread


On November 20, 2004 at 13:24:26, Pallav Nawani wrote:

>On November 20, 2004 at 08:51:46, Michel Langeveld wrote:
>
>>I decided to investigate something:
>>
>>TSCPGothic NORMAL
>>=================
>>This program generates moves, and after a move is played, it checks if the own
>>king is brought into check. If this was the case, then it undoes the move
>>without searching futher, and continues with another move.
>>
>>TSCPGothic KINGCAP
>>==================
>>This program generates moves, plays them all despite legalness, and let the king
>>get captured (Crafty makes this too).
>>
>>I hoped for a faster program with KINGCAP.
>>I found out that this was not true (Note *2)
>>
>
>The way it is supposed to be done:
>
>1. Do it only in qsearch. No point in doing it in main search, it is already
>doing some heavy lifting, checking move legality there is not such a big strain.
>Also, if you have a crafty like incremental move generator, you may try many
>moves before finding the king capture.
>Net result: you loose time.
>
>2. After you recurse to the next ply (in qsearch), check the moves you have
>generated. If one of them is a king capture, return beta or Mate score
>immediately. Again, this won't work if you have an incremental move generator.
>Crafty generates all the moves in one shot while in qsearch.
>
>So, No eval is needed, and you don't check the move is illegal or not & thus you
>save time. The assumption, of course, being that most of the moves are legal and
>by not checking move legality immediately we may save some time.
>
>Also, if your qsearch is heavy, that is, it has SEE + Checks in qsearch + etc
>etc, then the benefit of KingCap approach will be low.
>
>Best regards,
>Pallav

Thanks a lot! I did it this way.
The positions with KINGCAP go now few % faster as without.

So I keep it:

============================================================================
KINGCAP:
11*   7864  28631090    266  h2g1q f1g1 h7h6 d1d3 i8j6 h3f4 g8i6 j8h6 e8f6
g1f1f6h6 c3e4

NORMAL;
11*   7940  28599916    266  h2g1q f1g1 h7h6 d1d3 i8j6 h3f4 g8i6 j8h6 e8f6
g1f1f6h6 c3e4
============================================================================

============================================================================
KINGCAP:
11*   4192  13613673     11  b1c3 b8c6 d2d4 i8h6 d4d5 c6e5 d1d4 d7d6 c1d2 h6f5
d4e4

NORMAL:
11*   4251  13607954     11  b1c3 b8c6 d2d4 i8h6 d4d5 c6e5 d1d4 d7d6 c1d2 h6f5
d4e4
============================================================================



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.