Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: a question about debugging chess programs

Author: Sune Fischer

Date: 15:33:50 12/26/02

Go up one level in this thread


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

I had to do the same when I made my check evade rutine, there were a few bugs
ie. one was in a en passent move for black which eluded me for some time. Only
way was to generate all moves and then generate the check evasions, next compare
if all the moves on the fully legal move list were also there on the check
evasion list. That cought it, finally (of course it was a one character typo :)

Good luck,
-S.
>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.