Author: José Carlos
Date: 08:09:57 03/31/02
Go up one level in this thread
On March 31, 2002 at 07:22:25, Uri Blass wrote:
>On March 31, 2002 at 07:10:41, José Carlos wrote:
>
>>On March 31, 2002 at 06:17:15, Klaus Friedel wrote:
>>
>>>Has anybody ever tried something like that in his null move code :
>>>
>>>
>>> int nullDepth = depth - (NULL_REDUCE + 1)*DEPTH_BASE;
>>>
>>> if(tryNull){
>>> executeNullMove();
>>> beta -= NULL_BONUS;
>>> value = - search(nullDepth, -beta, -beta+1, ply + 1);
>>> undoNullMove();
>>> if(value >= beta){
>>> beta += NULL_BONUS;
>>> ttStore();
>>> return beta;
>>> }
>>> beta += NULL_BONUS;
>>> }
>>>
>>>
>>>Bigger values of NULL_BONUS increase the count of nodes prunded (but you migth
>>>oversee some tactics). Values of about 30cp made my engine ply slightly better
>>>than the default null-move (NULL_BONUS = 0).
>>>
>>>
>>>Klaus
>>
>> A couple of thoughts:
>> - You can be a bit faster declaring nullDepth inside the "if" and doing "beta
>>+= NULL_BONUS;" just once, before "if(value >= beta){"
>
>The code is going ot be slightly shorter but I do not see
>why is it going to be faster and it seems to me the same speed.
>
>You suggest to replace
>
>if(value >= beta)
>{
> beta += NULL_BONUS;
> ttStore();
> return beta;
>}
> beta += NULL_BONUS;
>
>by the following code:
>
>beta+=NULL_BONUS;
>if(value >= beta)
>{
> ttStore();
> return beta;
>}
>
>In both cases beta+=NULL_BONUS is done exactly once in every case
>so I do not see a reason that the shorter code
>is going to be the faster code.
>
>Uri
As the author said, my "improvement" is wrong because beta is checked within
the "if". If not for this, the idea is:
if (A)
{
B=3;
return;
}
B=3;
With the above code, you always do B=3, but it is twice in memory. With:
B=3;
if (A) return;
You do exactly the same, but B=3 is only once in memory. That gives more
chances for a cache hit. Not a big improvement, but worth noticing.
José C.
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.