Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Starting to optimize

Author: David Mitchell

Date: 01:07:18 02/29/04

Go up one level in this thread


On February 28, 2004 at 22:25:33, Matthias Gemuh wrote:

>On February 28, 2004 at 21:24:21, Andrew Wagner wrote:
>
>>Ok, so I've got my engine playing legal moves now. But it still only manages a
>>couple of ply depth. I've implemented hash tables, null move, futility pruning,
>>stand pat, history heuristic, and PVS cutoffs, plus simple MVV/LA move ordering.
>>Any suggestions on how I figure out what's causing the bottleneck? I think it
>>*should* be able to see a few ply deeper now, but it's still very slow. Any
>>suggestions appreciated. Andrew
>
>
>
>
>You have just described my 3-year-old engine, except that mine can SEE.
>How I wish it could see some good moves.
>
>/Matthias

Have you profiled your program, yet? That should give you some good suspects for
such criminal behavior! ;)

When you step through it, slowly, do you notice calls to functions being
repeated unnecessarily? For instance, in my program, I have the first function
check that the game isn't over from the last move that was made. To do that, it
generates _all_ the moves for the next ply, and checks each move until it finds
the first legal move.

Now that the game isn't over, it again generates all pseudo legal moves,
repeating the work it just did. Since it happens pretty fast, it wasn't real
easy to see that was happening at first.

Before you get into issues of cache efficiency, etc., be sure to check out the
overall logic loops in the big picture. It's easy for a chess program to hide
their devious ways. :)

dave




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.