Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: boundschecking

Author: Peter McKenzie

Date: 12:21:26 11/04/02

Go up one level in this thread


On November 03, 2002 at 23:06:06, Uri Blass wrote:

>On November 03, 2002 at 19:56:38, Peter McKenzie wrote:
>
>>On November 03, 2002 at 13:50:41, Uri Blass wrote:
>>
>>>On November 03, 2002 at 13:37:33, Vincent Diepeveen wrote:
>>>
>>>>On November 03, 2002 at 13:07:07, Uri Blass wrote:
>>>>
>>>>>On November 03, 2002 at 11:50:01, Vincent Diepeveen wrote:
>>>>>
>>>>>>On November 03, 2002 at 11:26:42, Brian Kostick wrote:
>>>>>>
>>>>>>for windows there is numega boundschecker.
>>>>>>
>>>>>>for linux there is the excellent free boundschecker (C only)
>>>>>>see for example: http://web.inter.nl.net/hcc/Haj.Ten.Brugge/
>>>>>>
>>>>>>however you can also go to the homepage from gcc and then go
>>>>>>to 'extensions' and download any boundschecker you need for
>>>>>>use with gcc. it's very good.
>>>>>
>>>>>Thanks
>>>>>I see that I can download a trial version of numega boundchecker so
>>>>>I guess that I am going to try it tomorrow.
>>>>>
>>>>>I use only windows.
>>>>>
>>>>>Note that inspite of the unequal number of nodes in debug mode and in release
>>>>>mode the bug does not seem to prevent it to play well in games.
>>>>
>>>>?? you don't have deterministic number of nodes?
>>>>
>>>>Debug it!
>>>
>>>I have deterministic number of nodes in release mode or in debug mode but the
>>>numbers are not equal.
>>>
>>>The first different number is more than 100000.
>>>
>>>>
>>>>no need for a boundschecker even to debug that.
>>>>
>>>>>The difference is small and I see it only after more than 100000 nodes so maybe
>>>>>the problem is that the random numbers in debug mode are not the same as the
>>>>>random numbers in release mode.
>>>>
>>>>wait a minute. are you telling me that you use the rand() function
>>>>in your program to evaluate?
>>>>
>>>>Comon you gotta be joking?
>>>
>>>Only for my hash tables
>>>
>>>I have
>>>for (fil=0;fil<6;fil++)
>>>		for (i=0;i<2;i++)
>>>			for (j=0;j<64;j++)
>>>				zobrist[fil][i][j]=rand64();
>>
>>A long time ago, instead of doing this I decided I wanted an absolute guarantee
>>that I always used the exact same set of random numbers regardless of compiler
>>version/library version/operating system platform etc etc.
>>
>>The simple solution was to write a little program which generated the C++ source
>>code which initialises a large array of random numbers.  Then I just pasted that
>>code segment into my program.  Now I have one less thing to worry about :-)
>
>Yes
>
>It may be a good idea
>
>Unfortunately I do not know what is the algorithm that is used by the computer
>to generate random numbers.
>
>A possible solution is simply to copy the numbers that rand64 generates to
>a text file and have a long function to initialize it by some hundreds of lines
>
>zobrist[0][0][0]=
>zobrist[0][0][1]=
>zobrist[0][0][2]=

Right, nice and simple.  You can use array initialisation notation if you prefer
that.  The main point is: do it once and forget about it FOR EVER regardless of
what compiler/library/OS you might use in the future.  Then you can use your
brain power to solve more interesting problems.

Of course, however you do it you should have a program generate the source code.
 Of course the generating program doesn't have to be C/C++, it can be any
language and you can generate the random numbers using any language you like
too.

>
>It may make my code longer

So what?  Just put it in a separate source code file and forget about it.

>I do not know if it is a problem that may make it slower relative to the case
>of having a special function.

Who cares if initialising your zobrist array takes .001 seconds or .0001
seconds?  It won't impact the performace of your engine.

>
>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.