Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Q. Why might node count differ between DEBUG and RELEASE

Author: Scott Gasch

Date: 20:52:10 12/13/04

Go up one level in this thread


On December 13, 2004 at 06:21:24, David B Weller wrote:

>Hi,
>
>Inspired by a post over in the WB forum, I tried doing a 9 ply search from start
>position. The DEBUG version searched fewer nodes.
>
>I am currently trying to switch off opt flags but so far I cant seem to pinpoint
>the culprit.
>
>Any ideas what this means?
>
>using vc 2005 express beta
>
>Thank you.
>

With everyone giving you the normal "uninitialized variable" story I was trying
to remember all day what the issue was back when I had this problem and I
finally did.  Maybe it's better that I didn't tell you right away because I'm
sure by now you've spent some quality time looking over your code.

Anyway a while ago I had the same problem you described.  It turned out to be
this: in my DEBUG build I was validating moves by making them then unmaking
them.  These make/unmakes were not present in the normal release code.

This shouldn't affect the search tree... but I have a little piece list in the
POSITION struct that is largely unsorted (with a couple of exceptions).  So what
was happening was these extra make/unmake moves was changing around the order of
these piece lists.

The different orders in turn affected the order in which I generated moves down
the road.

Then if two moves got the same score but were generated in different orders they
would cause their subtrees to be searched out of order... and you can see what
happened.

I only did these extra make/unmakes in a couple of places and I ended up just
biting the bullet and doing a memcpy instead of an unmake move to restore the
board to the old position AND make sure the piece lists stayed in the right
order.

Anyway, just another thing to think about if you are still stuck.

Scott



This page took 0.01 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.