Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: late move reductions (and another question)

Author: Paul Clarke

Date: 11:14:15 03/02/06

Go up one level in this thread


On March 02, 2006 at 11:50:56, Robert Hyatt wrote:

>On March 02, 2006 at 02:19:04, Tony Werten wrote:
>
>>On March 01, 2006 at 20:00:40, Robert Hyatt wrote:
>>
>>>Someone had already emailed me this.  I just hadn't looked.  Now I am not quite
>>>sure what is going on:
>>>
>>>static const int HistorySize = 12 * 64;
>>>
>>>That appears to be a dimension for the HistHit[] and HistTot[] arrays, which
>>>leaves me lost since the other code sent to me has:
>>>
>>>index = PIECE_TO_12(board->square[MOVE_FROM(move)]) * 64 +
>>>SQUARE_TO_64(MOVE_TO(move));
>>>
>>>followed by
>>>
>>>   HistHit[index]++;
>>>   HistTot[index]++;
>>>
>>>So I know I am overlooking something.  "index" is clearly a 12 bit value between
>>>0 and 4095 if I understand it correctly.  yet HistHit[] is not nearly that big.
>>
>>How do you get to 4096 ?
>
>I'm looking at from*64+to...  since either is at least 6 bits, that gives 12.
>If piece_to_12 squashes from into 12 bits, that would at least make the index
>correct according to the dimension of the array, although then I would not claim
>to understand the idea of squashing from from 0-63 into the range 0-11...

Are you reading the index calculation as:

index = SQUARE_TO_64(MOVE(from)) * 64 + SQUARE_TO_64(MOVE(to));

? If so then that would explain the confusion: the index calculation is, as Tony
mentions below, using the type of piece that moved rather than the square it
moved from, hence the use of PIECE_TO_12(board->square[MOVE(from)]).

>
>
>>Piece_to_12 most likely has a 0..11 range (6 pieces, 2 colors), square_to a
>>0..63 It's just 12*64=768
>>
>>Tony



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.