Author: Stuart Cracraft
Date: 16:13:53 07/11/04
Go up one level in this thread
On July 11, 2004 at 16:00:43, Eric Oldre wrote:
>On July 11, 2004 at 15:36:54, Dieter Buerssner wrote:
>
>>On July 11, 2004 at 14:35:50, Eric Oldre wrote:
>>
>>>a) did I just not let it search deep enough?
>>>b) does the fact that it took 3:51 to reach depth 21 indictate a issue with my
>>>tranposition table?
>>
>>Yes. I tried this pos with only 1000 hash entries. It was solved in no time.
>>Independent of the hashing scheme you are using (say depth preferred or always
>>replace or more sophisticated), your hashing probably does not work well. I
>>assume, you have null move disabled.
>
>I did not originally have null move disabled, but it should be trying null moves
>on this position due to the lack of material, just to be safe i tried compiling
>with no null move. but i got the same results.
>
>>
>>>it was running at 1,200,000 nodes/sec.
>>
>>From this speed, I guess you are generating the hash keys incrementally (in your
>>makemove/undomove?). A first start might be to check if they are correct, by
>>comparing the incremental keys with ones you generate from start. You might also
>>want to describe your hash struct, how you store/probe, when you cutoff, ...
>>
>
>yes i am updating the hash keys incrementally. I'll add some code to also
>generate them from scratch from a given position and compare to the
>incrementally generated one.
>
>I'll report some results when i have them.
>
>>>if there is a issue with my transposition table, could it be due to not having
>>>random enough keys? here is the code i'm using to generate the numbers.
>>>
>>>U64 rand64(){
>>> U64 retval = 0;
>>> retval = (retval <<15) | rand();
>>> retval = (retval <<15) | rand();
>>> retval = (retval <<15) | rand();
>>> retval = (retval <<15) | rand();
>>> retval = (retval <<15) | rand();
>>> return retval;
>>>};
>>
>>This will work with many implementations, and will be very poor with other
>>implementations (all those, which have a RAND_MAX >= 2^15-1). A fast fix is to
>>use xor instead of or, to paste together the rand() returns. I prefer to use my
>>own pseudo random number generator. Not necessarily, because I expect better
>>results. It makes debugging easier, when you compare runs in different
>>environments (the C-library can have different implementations of rand(), and
>>then you cannot reproduce node counts, search trees, ...)
>
>I'm using MSVS.Net. I've also tried xor'ing the results from 5 calls to this
>function together, to see if that might help any problems i'm having, hasn't
>made a difference though.
>
>Thanks for the ideas Dieter!
>
>Eric
>
>>
>>Regards,
>>Dieter
I was using something like that but picked up this from Knuth
by way of GNU & Crafty (and, I suspect, Bob Hyatt)... The question is
will this suffice for the new 64-bit machines becoming more commonplace
amongst computer chess programs...
unsigned int Rand32 (void)
/***************************************************************************
*
*
* A 32 bit random number generator. An implementation in C of the
* algorithm given by Knuth, the art of computer programming, vol. 2,
* pp. 26-27. We use e=32, so we have to evaluate y(n) = y(n-24) + y(n-55)
* mod 2^32, which is implicitly done by unsigned arithmetic.
*
***************************************************************************/
{
/*
* Random numbers from Mathematica 2.0
* SeedRandom = 1;
* Table[Random[Integer, {0, 2^32 - 1}]
*/
static unsigned int x[55] =
{
1410651636UL,
3012776752UL,
3497475623UL,
2892145026UL,
1571949714UL,
3253082284UL,
3489895018UL,
387949491UL,
2597396737UL,
1981903553UL,
3160251843UL,
129444464UL,
1851443344UL,
4156445905UL,
224604922UL,
1455067070UL,
3953493484UL,
1460937157UL,
2528362617UL,
317430674UL,
3229354360UL,
117491133UL,
832845075UL,
1961600170UL,
1321557429UL,
747750121UL,
545747446UL,
810476036UL,
503334515UL,
4088144633UL,
2824216555UL,
3738252341UL,
3493754131UL,
3672533954UL,
29494241UL,
1180928407UL,
4213624418UL,
33062851UL,
3221315737UL,
1145213552UL,
2957984897UL,
4078668503UL,
2262661702UL,
65478801UL,
2527208841UL,
1960622036UL,
315685891UL,
1196037864UL,
804614524UL,
1421733266UL,
2017105031UL,
3882325900UL,
810735053UL,
384606609UL,
2393861397UL
};
static int init = true;
static unsigned int y[55];
static int j, k;
unsigned int ul;
if (init)
{
int i;
init = false;
for (i = 0; i < 55; i++)
y[i] = x[i];
j = 24 - 1;
k = 55 - 1;
}
ul = (y[k] += y[j]);
if (--j < 0) j = 55 - 1;
if (--k < 0) k = 55 - 1;
return (ul);
}
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.