Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: movelist insertion question

Author: Robert Hyatt

Date: 22:03:47 01/04/00

Go up one level in this thread


On January 05, 2000 at 00:49:50, Landon Rabern wrote:

>After move generation, when putting a killer/pv/hash table move on top of the
>list I search through the list of moves until I find the move I am looking for,
>shift the whole list down and put the move I wanted on top.  Is there a better
>way to do this? The way I am doing it seems inefficient.

There are multiple answers.

1.  Don't generate moves before you try the hash move.  If it produces a
cutoff you avoid generating anything.  Otherwise, try it, and if it doesn't
cutoff, generate only captures (if you can do this easily).  Try them next.
Before generating other moves, try the killer moves since they can be tried
without generating moves and they too may produce a cutoff that will avoid
move generation.  Otherwise, generate all moves and then for the first pass
to select a history move, delete the killer moves and the hash move.

2.  Don't shift things around. Just make the move you want and zero it in
the list.  no move should be represented as 0, so you can tell that an
entry is a move that has already been tried and cleared...  no point in
shuffling stuff around as it uses a lot of memory bandwith, something the
PC has very little of.




>
>To get the pv out of the search I do this
>value=recurseNextLevel();
>if (value>alpha){
>  pv[depth]=pv[depth+1];
>  pv[depth][depth]=moveList[current];
>  alpha=value;
>}
>
>At the end the pv will be in pv[0].  Now when I use this to order the search, do
>I do I add a pv move everytime, like a killer, or only the first time through.
>I have been adding it everytime, thinking that a pv move at a certain depth with
>a certain preceeding move, will likely be good at that same depth for another
>preceeding move.
>
>Anyone throwing out checks by seeing if the king was captured on the next level,
>how do you make sure you aren't in check at the leaves?



I check for being in check in the full-width part of the search, but not
in the q-search.  There I rely on capturing the king at the next ply and
having that return a special value that says "last move was illegal".




>
>
>Thanks in advance,
>
>Landon W. Rabern



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.