Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: about the meaning of unmake in the discussion of the need to unmake

Author: Robert Hyatt

Date: 14:12:15 09/05/03

Go up one level in this thread


On September 05, 2003 at 07:11:20, Uri Blass wrote:

>Does unmake means doing the opposite calculation
>that were done in make?
>
>I assume that makemove updates the hashkey(and the pawn hashkey).
>Does unmake move update the same information again to its previous
>value or does the program remember it in an array.

It is up to you.  IE for Crafty, I copy the hash key before updating it
so I can restore the previous copy without doing the XOR stuff.  But for
other things I actually do the required XOR stuff to update the bitboards
when a move is retracted.


>
>If it remembers it in an array then there is something that it does
>not unmake.
>I am interested to know if there is more information that unmake does not unmake
>except hash keys.

The issue is time.  If something is hard to update, then it will be hard to
undo the update.  That is a candidate for copying/updating.  If it is easy
to update, then it will be easy to undo, and might be cheaper than the copy.





>
>
>Note that movei until today updated the hash key both in make and
>unmake(it still does not have a pawn hash key but it is going to have it).
>
>Changing it was not a 5 minute change because both make and unmake
>called the same functions to add piece to the board and
>this function updated the hash key so I could not delete updating
>the hash key from unmakemove without deleting updating the hash key
>from make move and I had first to change the function that makemove
>calls in order to update the hashkey in makemove and not in functions that it
>calls.
>
>I have both a global varaible zob and an array zobkey[1000]
>when I assume not more than 1000 plies in a game.
>
>I think that only now I understand a good reason to get rid of the global
>varaible zob like Hyatt suggested me long time ago.
>If I get rid of it then it means that I do not need to do
>zob=zobkey[hply] in my undo move.
>
>I should have a local varaible zob only in my makemove.
>It was not possible in the past because my makemove called some functions
>that updated zob.
>
>Using a global varaible for the zobrist key could be logical in case that
>I use it a lot out of makemove but the only place when I use the zobrist key
>of the current position is in probehash and recordhash
>and I probably can use it also in my repetition detection but practically I use
>an array.
>
>I guess that the price of updating the global varaible in unmake move and
>the price of using a global varaible instead of local varaible in make move is
>probably higher than the advantage of the possibility to use
>global varaible instead of an array in probehash and recordhash.
>
>Uri



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.