Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Automatic move sorting with piece list

Author: Dann Corbit

Date: 12:28:27 06/03/05

Go up one level in this thread


On June 03, 2005 at 13:46:25, Pallav Nawani wrote:

>On June 03, 2005 at 13:33:52, Dann Corbit wrote:
>
>>On June 03, 2005 at 13:05:58, Peter Fendrich wrote:
>>
>>>On June 02, 2005 at 22:05:10, Dann Corbit wrote:
>>>
>>>>On June 02, 2005 at 20:51:03, Joseph Tadeusz wrote:
>>>>
>>>>>If I reinsert a captured piece into the piece list it is done
>>>>>so at the beginning. This has the result that the pieces in the
>>>>>heart of the action move to the front of the list.
>>>>>
>>>>>I noticed that the resulting order has much better search
>>>>>performance than without such a list and where pieces are
>>>>>searched randomly.
>>>>>
>>>>>It's an unintended but beneficial LRU sorting.
>>>>
>>>>Separate piece lists by type and color.
>>>>
>>>>Better than a single piece list of all pieces.
>>>>
>>>>IMO-YMMV.
>>>
>>>
>>>Why?
>>
>>Lots of reasons.  The most important is no switching and no branching.
>
>What are the other reasons? :-)

The code is also simplified.  Instead of looking at a piece in the list and
deciding about its color and type, you know what it is a-priori.  Therefore,
move generation, evaluation, and lots of other things have fewer decisions and
are made simpler.

>Ps: I am now thinking of a Glaurung style piece list in my engine. Any better
>way to do that?

There is always a better way to do something, though it is not always easy to
find it.  Once you have improved it, I will be curious to see the result.

I think that C99 style automatic arrays are probably a very good way to make
lists, and I don't see anyone doing it.



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.