Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: a question about debugging chess programs

Author: Uri Blass

Date: 15:58:30 12/26/02

Go up one level in this thread


On December 26, 2002 at 18:33:50, Sune Fischer wrote:

>On December 26, 2002 at 17:47:37, Uri Blass wrote:
>
>>Is there a fast way to find what is the first step that 2 similiar programs with
>>source code go different when you ignore specific part.
>>
>>I have 2 programs that are supposed to be the same except the fact that one save
>>time in order of moves.
>>
>>They are not the same.
>>
>>What I need is a third program that run the first 2 programs in the same time
>>and tell me the first step that they are different(difference in the procedure
>>that calculates order of moves does not count).
>>
>>I do not like to spend hours on trying to figure out the exact place that they
>>are different when after finding a place that they are different(can happen
>>after millions of nodes) I find again that they are different for different
>>unknown reason.
>>
>>This is exactly what happened to me now.
>
>This is ugly, but you have basicly narrowed the problem down to the lines you
>are changing.

Not exactly it may be a bug that is not in the lines that I changed and is in my
program before and after the change.

The lines that I changed are not supposed to change the code based on some
assumption that may be wrong.

If the assumption is wrong then it means that I have a bug in another place of
the code.

I found one bug in my extensions but even after correcting the bug there are
still problems and it mean that there are more bugs and I feel sure that the bug
is already in the previous program.


>If it's just an optimization make sure it really does do the same as the code
>it's replacing. I can't think of other ways to do that, than to run both codes
>side by side and compare results; As soon as something differ you print the
>position, the move and whatever else you need to see what exactly is causing the
>difference.

It is not exactly an optimization but part of it is optimization.

I wanted to add some knowledge to my program about tactics for better order of
moves and for better decisions about pruning and extensions but
I test it step after step and I do not hurry to implement all of it.

Movei generates all the moves before ordering them and
First step:I decided that I may generate information about good captures
during the time that I generates move and also count them (of course in this
step I make movei slower without changes in the output)

Second step:I decided that in case that there are no good captures I do not
search for good captures and update the phase of ordering move from good
captures to killer move(except cases that I am in a pv node)
I found in a test that the second step cause different results(The program did
not crush but simply decided not to generate the same number of nodes)

The number was almost the same but not the same and it means that I had a bug in
my program.

Note that the 2 steps together are not supposed to imprve the speed of movei but
I believe that together with other steps it can help.

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.