What is Hyatt Hash

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What is Hyatt Hash

Post by bob »

benstoker wrote:
bob wrote:
Graham Banks wrote:
bob wrote:so worrying about who is copying what is pretty much pointless...
I think that as a community, we should surely be condemning it, even if you believe that nothing can be done about it?

Cheers,
Graham.
I don't have any problem with someone copying the hash code from Crafty. Any more than I object to them copying "printf()" from the standard C I/O library. Hashing is not what makes Crafty "crafty". It's the search and evaluation. Not the bitboards, nor input/output, etc.
In any case, here's HYATT_HASH

Code: Select all

00132 #if 0 /* compiler */
00133 #define HYATT_HASH()   asm volatile ("movq (%0),%%r15\n" "movq %%r15,(%1)\n"            "movq 0x8(%0),%%r15\n" "movq %%r15,0x8(%1)\n"           /* "xorq %%r15,(%1)\n" "xorq %%r15,(%1)\n" */           "movq %1,%0\n"          : : "r" (tr), "r" (H) : "%r15");
00134 #define UPDATE_ANNI() (HashTable + (k + i))->age = AGE;
00135 #if 0
00136 #define HYATT_HASH()   H->h1 = ((uint64 *) tr)[0];   H->h2 = ((uint64 *) tr)[1];   H->h1 ^= H->h2;   H->h1 ^= H->h2;   tr = (typeHash *) (H);
00137 #endif
00138 #else /* non funzione ! */
00139 #define HYATT_HASH() /* */
00140 #define UPDATE_ANNI() tr->age = AGE;
00141 #endif


and it's referenced by:

Code: Select all

Information(), MyAll(), MyAllCheck(), MyCut(), MyCutCheck(), MyExclude(), MyExcludeCheck(), MyLowDepth(), MyLowDepthCheck(), MyPV(), MyPVQsearch(), MyPVQsearchCheck(), MyQsearch(), MyQsearchCheck(), MyTop(), MyTopAnalysis(), and OutputBestMove().
That looks more like the older version of hashing from 23.0 and earlier. New version of hashing first appeared in 23.1

The "age" was my original idea and was used in Cray Blitz. The rest should better be called "Belle Hashing" as that basic idea (less the age field) came from Ken Thompson and Belle.