Computer Chess Club Archives




Subject: Re: Improvements in BF makes my MoveGen suck =(

Author: Uri Blass

Date: 00:47:16 06/28/03

Go up one level in this thread

On June 27, 2003 at 15:02:40, Christophe Theron wrote:

>On June 27, 2003 at 08:13:53, Albert Bertilsson wrote:
>>Just wanted to share my latest findings and warn you from making the same
>>mistake (or maybe I just point out the obvious).
>>I've always been proud to have a very fast movegen, doing perft calculations
>>very fast. I optimized the movegen alot, and always saw playing strength
>>increasing. I use a legal move generator and always saw the cost of verifying
>>legality to be minor. Lately however I've noticed that the engine performance
>>isn't that great (compared to other engines) inspite of the fast movegen. So I
>>started digging today and the numbers struck me as lightning...
>>As I've improved moveordering very much with hashtable/iterative deepening,
>>killer moves and history tables the effective BF is now much lower. The lower BF
>>now means that very few moves of all the generated ones are actually ever made.
>>This means that the cost of generating legal moves have increased incredibly
>>It's really anoying to notice that something you though was very good now is on
>>the list of improvements again =(.
>>/Regards Albert
>You have just discovered something that took me years to understand:
>>>> in a chess program, do not compute something if you do not have an immediate need for it. <<<
>>>> Do not compute something that you are going to use later if there is the slightest chance that you will not use it. <<<

****if there is a slightest chance that you will not use it then think how to
change it by using the information****

>That's why I think that basically the idea of generating lists of legal moves
>only is flawed. You are wasting time computing something that in general you are
>not going to use.

I think that your assumption that in general you are not going to use it may be

>Generating lists of moves in general is sub-optimal. It's much better to
>generate move lists incrementally (moves should be generated on demand, a
>complete list is never generated).
>I have the same opinion about attack tables, but it depends on what you are

I think that attack tables is also something that in general I am going to use

It is also possible that generating the information later may be more expensive
because things are dependent so saying not generate information that you are not
sure that you are going to use them is wrong.

A simple example:
If I want to generate only one move of the rook then I need first
to look in the piece list to find the square of the rook.

If I want to generate many moves of the rook then I need to do it only for the
first move and I do not need to look in the table again and again.


This page took 0.03 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.