Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: SEE checking

Author: Christophe Theron

Date: 13:23:27 12/01/00

Go up one level in this thread


On December 01, 2000 at 03:31:19, Tony Werten wrote:

>On December 01, 2000 at 02:49:54, Christophe Theron wrote:
>
>>On November 30, 2000 at 02:33:06, Scott Gasch wrote:
>>
>>
>>
>>What you are doing is the right thing to do.
>>
>>I have the same overly paranoid debug code spread all over Chess Tiger's
>>sources. After so many years of chess programming, it turns out that it is not
>>paranoid at all. It is just enough to catch very nasty bugs.
>>
>>So from time to time, without any special immediate need, I add paranoid
>>checking code. I have #if (DEBUG_xxx) conditionals all over the sources
>>(DEBUG_xxx allowing to turn on checking code for a specific thing).
>>
>>A very efficient way to find bugs is to have several versions of the same
>>routine. For example, generate moves in several different ways, collect the
>>resulting moves lists, and compare them. That's what I do in "debug genmove"
>>mode. I have also a code that compares the incrementally computed hash codes to
>>hash codes computed from scratch in every position. An obvious thing to check, I
>>would say.
>>
>>From time to time I launch a big test. The program has to compute a given number
>>of fixed positions to a given ply depth with all the debug code turned on. It
>>runs 20 times slower than the normal version, but I feel more comfortable once I
>>have run this test and no error has been found. The goal is not to check if the
>>program finds the right moves for the positions, but just to check that the
>>debug code does not catch a problem.
>
>For some sort of stupid reason, by bugs are ( by far ) in de checking code. This
>means I spend a lot of time trying to fix my original code to find out I was
>just comparing the wrong stuff.
>
>Tony



It's an investment. You have first to find bugs in your debug code (which sounds
crazy). But once it works, this debug code can stay there, and will be available
at any time later. And it WILL catch bugs. Because in the normal course of
developpement you will have to change the other parts of the code (the non-debug
parts) and it's likely that bugs will slip into them anyway.

Spend one day on debug code now, it will save you 10 days later this year.

I think that well thought debug code can slash the developpement time by two in
many cases. In a chess program it is particularly critical.



    Christophe



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.