Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Odd behavior in lazy eval

Author: Anthony Cozzie

Date: 07:25:43 10/19/04

Go up one level in this thread


On October 19, 2004 at 08:24:45, Rick Bischoff wrote:

>I am still struggling with my huge node count in WAC #Iforgotthenumber-- anyway,
>I am trying out lazy evaluation, e.g., only counting material and seeing if I
>can get a cutoff from there..  Here is the code in the evaluation function:
>
>	//int x = whiteScore - blackScore;
>	//extern bool wtm;
>	//if ( !wtm ) x = -x;
>	//if ( x + 200 <= alpha ) return alpha;
>	//else if ( x - 200 >= beta ) return beta;
>
>When this code is off, as shown above, I have the following stats from a depth-7
>search:
>
> 6     157     295     112333 1. Ne5 Qxb3 2. Nxd7+ Kc8 3. axb3 Kxd7 4. Rxa7
> 7     153    1132     397249 1. Ne5 Qxb3 2. Nxd7+ Kc8 3. axb3 Kxd7 4. Rxa7 Nd5
>1294061 nodes (1041179, 0.804583) 31.162 seconds (41526.9 NPS)
>4000 nullmove try 1330 nullmove succeed (%33.25)
>
>OK, so when I turn on the lazy evaulation:
>
> 6      53     403     198712 1. Ne5 Rf6 2. Bg5 Qxb3 3. axb3 Re6
> 7     141    1720     752626 1. Ne5 Qxb3 2. axb3 Bxb5 3. Nxg6 Nxg6 4. Be3
>move Ne5
>3314059 nodes (2830629, 0.854128) 66.653 seconds (49721.1 NPS)
>171058 nullmove try 66872 nullmove succeed (%39.0932)
>
>So you can see, not only has the PV in the last two iterations changed
>drastically, the node count has also increased by a factor of 2 or more!
>
>Clearly, this has to be a bug?    From the opening with lazy eval off:
>
> 6       0      50      24360 1. d4 d5 2. Bf4 Bf5 3. Nf3 Nc6
> 7      10     263     107854 1. d4 d5 2. Bf4 Nc6 3. Nf3 Bf5
>move d4
>278745 nodes (225693, 0.809676) 6.184 seconds (45075.2 NPS)
>5307 nullmove try 2870 nullmove succeed (%54.0795)
>
>With it on:
>
> 6       0      48      24099 1. d4 d5 2. Bf4 Bf5 3. Nf3 Nc6
> 7      10     257     110823 1. d4 d5 2. Bf4 Nc6 3. Nf3 Bf5
>move d4
>348815 nodes (289003, 0.828528) 6.985 seconds (49937.7 NPS)
>9995 nullmove try 3934 nullmove succeed (%39.3597)
>
>So, I am still getting a node increase here, but the PV has remained the same.
>What gives!?

I am now going to give you the biggest secret in chess programming.  If you want
the magic bullet for a good search, this is it.

YOU HAVE NO IDEA WHAT THE HECK YOUR ENGINE IS DOING.

You are getting a lot of nodes - but you have no idea why.  Zappa has an option
to create a logfile (usually some GB in size) of every node.  I have a specially
written GUI that can then view this and show every move it considered and what
the depths and alphas and betas and scores were.  If you do this, you will be
_amazed_ at what stupidities you find.  If you don't feel like writing a GUI,
you can write a logfile and grep through it, although if you are serious about
getting a strong program I think a GUI is worth it.

For example

$ grep 000000142234

000000142234 hash: s=30, T=FH, D=8
000000142234 trying null [23,24] child=0000001422344
000000142234 null returned 23 [1234 child nodes]
000000142234 Trying child Nf3 [20,24] d=8 cid=00000022232344

...

You get the point.

anthony



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.