🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.chess
Article #5225

Re: Book disabled after loading game, why ?

#5225
From: Chua Kong Sian
Date: Sun, 23 Jan 1994 04:50
43 lines
2463 bytes
Patrick Wendt (root@chamber.in-berlin.de) wrote:
: HI,

: I just noticed that after re-loading a started game the opening book
: will not be used anymore. This is a little strange, 'cause the best
: moves may not be found. Example: 1. c4 Nf6, 2. Nf3 g6, 3. g3 Bg7 ;
: now saving the game (computer is white). When reloading the game,
: that next move is 4. Nc3, not 4. Bg2. When re-entering the moves
: with force and 'go', the 4th move is Bg2 taken from the opening
: book. - So, is there a possibility to use the opening book after
: re-loading a stored game ? In GetGame() the Book-variable is set
: to BOOKFAIL (=8), so the book should be used up to the 8th move,
: or what does it mean ? - Is there a fix for that problem ?

:  Regards, Pat !

Hi Pat.

This problem arises because of the way gnuchess calculates a hash
value for a position.  At the start position, gnuchess sets the
hash value (actually hashbd & hashkey variables) to zero.  When a
move is made, the hash value is updated incrementally.

However, if you were to save a position and reload it, gnuchess
calculates the hash value using the algorithm in InitializeStats ().
This new hash value is NOT calculated incrementally and it will be
different from the hash value when the position is saved.  Therefore
any search of the book will almost certainly fail.

The best way to fix this problem will be to forget about setting
the hash value to zero for the initial position, but instead calculate
it from InitializeStats().  This will guarantee that a position will
always yield a unique hashvalue.  Of course, if this fix is applied,
the binary book will have to be regenerated again.

I have sent a patch to Stuart to fix this problem.  Hopefully it will
be incorporated into patchlevel 66. 

Regards.


Kong Sian
kongsian@nsrc.nus.sg
Technical Details
Message-ID: <2hsvnh$qod@nuscc.nus.sg>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!raffles.technet.sg!nuscc.nus.sg!nsrccks
References: <5KALB97K@chamber.in-berlin.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d71d,3c08bd9c08868d27
X-Google-Attributes: gid10d71d,public
X-Google-ArrivalTime: 1994-01-23 03:48:42 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!raffles.technet.sg!nuscc.nus.sg!nsrccks
From: nsrccks@leonis.nus.sg (Chua Kong Sian)
Newsgroups: gnu.chess
Subject: Re: Book disabled after loading game, why ?
Date: 23 Jan 1994 04:50:57 GMT
Organization: National University of Singapore
Lines: 44
Message-ID: <2hsvnh$qod@nuscc.nus.sg>
References: <5KALB97K@chamber.in-berlin.de>
NNTP-Posting-Host: leonis.nus.sg
X-Newsreader: TIN [version 1.2 PL0]