Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: programmers: pawn hash tables

Author: Uri Blass

Date: 10:55:20 03/08/03

Go up one level in this thread


On March 08, 2003 at 09:47:05, Robert Hyatt wrote:

>On March 08, 2003 at 03:17:19, Uri Blass wrote:
>
>>On March 08, 2003 at 01:42:15, Robert Hyatt wrote:
>>
>>>On March 08, 2003 at 01:29:46, Joel wrote:
>>>
>>>>Hey All,
>>>>
>>>>Just wondering what everyone thinks is the best way to implement a pawn hash
>>>>table?
>>>>
>>>>At the moment I am incrementally generating a seperate pair of pawn hash keys,
>>>>and using them to index a table - very similar to how my transposition table
>>>>works.
>>>>
>>>>Is it possible to do _significantly_ better than this? It seems to be somewhat
>>>>expensive to do, although having said that my NPS still went up at least 20% in
>>>>most situations.
>>>
>>>That is what everyone since chess 4.x has done.  Two signatures, one for
>>>all pieces and pawns, one just for pawns.
>>>
>>
>>Not everyone.
>
>I should have said "everyone that does pawn hashing does it the way you are
>doing it..."
>
>
>>There are a lot of programs without pawn hash tables and there are even a lot of
>>chess programs without hash tables.
>
>
>Not "real" programs I bet.  Hashing provides way too much of an advantage to
>never do it.
>
>
>
>>
>>I remember that I found something like 10% speed reduction in nps from adding
>>bitboards for passed pawns,isolated pawns and protected passed pawns by pawns
>>and I earned more than it in speed from other changes.
>>
>>I still do not evaluate passed pawns when they are not protected by a pawn and I
>>think that the question how to evaluate passed pawns relative to the kings and
>>other things is more important than pawn hash tables(Maybe it is good to give
>>some small static bonus for passed pawns but I did not like this idea because I
>>know that there are cases when passed pawns are trapped and these cases are not
>>rare).
>>
>>Another point is to evaluate king relative to pawns and not only passed pawns
>>because one of the problems of movei in endgames is that it always assumes  that
>>the best place for the king is the centre and it may be a problem also in case
>>when there are no passed pawns.
>
>I do that and it doesn't interfere with pawn hashing at all.
>
>>
>> >
>>>
>>>
>>>
>>>>
>>>>I am not really worried about effeciency as much as some other people here, so I
>>>>guess I am really asking whether I am missing something major.
>>>
>>>Doesn't sound like it.  But you will end up storing more than just a score for
>>>the position.  IE passed pawn locations, weak pawn locations (or bitmaps that
>>>feature them).  Etc...
>>
>>How many bits do you need to do it?
>
>8 bits per feature per side.  Passed pawns are flagged with a "1" on the file
>they stand on.  Weak pawns the same.  Open files the same.  Etc.  My pawn hash
>table entry is 19 bytes, you can see what's in there in "chess.h".

Not so easy
After some find next for the word hash
I find the following:

typedef struct {
  BITBOARD key;
  short    p_score;

  unsigned char allb;
  unsigned char black_defects_k;
  unsigned char black_defects_q;
  unsigned char passed_b;
  unsigned char candidates_b;

  unsigned char allw;
  unsigned char white_defects_k;
  unsigned char white_defects_q;
  unsigned char passed_w;
  unsigned char candidates_w;

  unsigned char protected;
  unsigned char outside;
  unsigned char open_files;
} PAWN_HASH_ENTRY;


I do not understand the meaning of all the varaibles inspite of the fact that
I can guess part of them(char allb probably give the files of the pawns but I do
not understand the definition of black_defects_k and not the exact definition of
candidates_b that I guess to be candidates to be passed pawns)

If someone tries to make a dictionary for crafty varaibles then it may be
productive.

In that case people can use the dictionary to see things like meaning of
varaibles or meaning of functions.

I read that modifying cradty is easy
I wonder how many people who modify crafty tried to understand the exact meaning
of most of it's varaibles.

I do not like the idea of trying to modify something that I do not understand
most of it but again I think that some file with explanation what people need
to know in order to do some modification for Crafty may be productive.

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.