Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Single Reply Extension

Author: martin fierz

Date: 04:17:17 09/20/04

Go up one level in this thread


On September 20, 2004 at 06:11:49, Renze Steenhuisen wrote:

>On September 20, 2004 at 06:00:21, martin fierz wrote:
>
>>On September 20, 2004 at 05:28:54, Renze Steenhuisen wrote:
>>
>>>Hi all,
>>>
>>>I have to confess that this is a very said thing, but I have to ask...
>>>
>>>My moveGen() generates pseudo-legal moves, in a similar way as is done in
>>>Crafty. I want to add the single-reply extension (of course), but I find it hard
>>>to grasp how to do this efficiently (because I might need to generate more moves
>>>than needed, right?)
>>>
>>>Or someone could please explain in words what is done in Crafty:
>>>
>>>        if (tree->in_check[ply] && tree->last[ply]-tree->last[ply-1] == 1) {
>>>          tree->one_reply_extensions_done++;
>>>          extended+=onerep_depth;
>>>        }
>>>
>>>What is this "tree->last[]" thing doing exactly?
>>>
>>>Thanks!
>>>
>>>  Renze
>>
>>i never studied the crafty code very thoroughly so i might be wrong. i think
>>tree->last[ply] is the move stack pointer, which means that if the condition
>>tree->last[ply] - tree->last[ply-1] == 1
>>is true, there is exactly one move at ply. so basically this doesn't answer your
>>question how to do it efficiently - it's just part of crafty's housekeeping that
>>bob is using here. the (efficient) generation of the check evasions is being
>>done somewhere else (and i have no idea where!)
>
>Aha! Check! of course, that's it. (STUPID ME)
>
>So Crafty is only doing one_rep extension when in check!
>
>But, isn't the idea of the extension to extend all situations where there is
>merely ONE LEGAL REPLY?

i don't think so. in fact, it would be extremely easy to add such an extension
(just remove the 'tree->in_check[ply]' part in crafty). but i would guess that
99.999% of all situations where there is only one move are checks. i can't
remember seeing any position ever in my games where there was only one reply
without checks. perhaps in some kind of study it might happen, but not in normal
games.

so the whole point of bob's code is that it runs 0.01% faster if he first checks
for in_check and only then checks the (a-b == 1) thing, because he saves the
a-b. at least that's what i assume when looking at it.

cheers
  martin


>
>Can anyone tell something about his or her findings?
>
>Thanks!
>
>Renze



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.