• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

amd (64-bit) chips, in chess engines

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

ookabooka

Member
Joined
Sep 22, 2002
Location
root@ localhost.localdomain
I have searched the net and cannot find anything about how AMD's 64bit chips perform in chess engines. a chess board is 8x8 64 squares. Pretty much all chess engines have to use the long long function to send 64-bit operations to the processor. I assume that with AMD's 64-bit, the performance should increase dramatically (2-fold?).

edit: specifically I am curious about crafty, the best opensource engine out there. Designed after the engine on Cray's supercomputers.
 
I took a look at crafty-19.8 ftp://ftp.cis.uab.edu/pub/hyatt/v19/crafty-19.8.tar.gz

The "make amd64" builds a crafty with 4 threads, presumably for a quad opteron?

Crafty does store piece / board positions in 64 bit words, even on x86, and uses inline asm to determine the bit positions. The amd64 cpus can do that in 5 instructions using bsr & bsf -- bit scan reverse / bit scan forward. The x86 cpus take 10 instructions... They do a cmp hiword, 1 and use the resulting flag as an index into the 2x32bit words before doing the bitscan (with sbbl eax, eax and mov edx, esp + eax * 4 -- neat trick).

I've only been playing on an amd64 system + linux for a couple of days now, but I'm impressed with the extra speed from the addition registers in the full instruction set.
 
thnx for the info, i assumed that crafty would take advantage of 64-bit processors, they already do it for Sparcs. The only problem is you would have to make sure everything is compiled right, with 64-bit memory addressing, as well as using different source files (which is what i assume the make amd64 does) that are specifically designed to work with the 64-bit architecture. Ill play around with crafty on my sparc box, see if i can compile 64-bit and 32-bit and compare the two.

eidt: i really want to see some documentation on how crafty can be tailored for the 64-bit processor, like if there are requirements, like how the kernel needs to be compiled. For some bizzare reason there just doesn't seem to be that much documentation for crafty. . . its probably all hidden on IRC lol
 
One other note... Last year about this time I hand tuned the inflate (decompression) algorithm of gzip to take advantage of the weird x86 string instructions. The result is this:

On a 2ghz P4 (512 cache version, 266 mem, Asus P4B-266C), the bandwidth of inflate is 93MB/s, with the hand tuning of the algorithm, it runs at 120MB/s (for this particular data set).

On a 2ghz AMD64 (512 cache version, 266 mem, Gigabyte KT800), the bandwidth of inflate in 32 bit mode is 159MB/s, with the hand tuning, it runs at 206MB/s. In 64 bit mode, the bandwidth is 173MB/s.

Even though the compiler (gcc) has 8 more registers to work with, it still can't compete with the hand tuned x86 asm. I suspect this will be the same for games. Until the game companies target the amd64 instruction set, the x86 code will outperform the 64 bit compiled stuff on the same platform.
 
Exactly, that is the biggest problems with software today, none of it is for the athlon64. However, as I said before, I think that it is entirely possible that crafty has some alternative header files or functions, specifically designed for the AMD64, these would include commands that gcc would interpret as AMD64-specific commands. I thought about writing Dr. Hyatt, but i chickened out :)

edit: after reading through that site, it looks like crafty gets a significant boost in performance up to 91%, when compiled in 64-bit mode in a 64-bit OS. It also stated that performance boosts from 64-bit processors would only be noticed in programs specially compiled/written for 64-bit architecture. Luckily this translates to changing a few flags on gentoo(my distro of choice). Though all it really adds is the memory addressing, all the programs are still written with 32-bit processors in mind with the exception of a select few(hopefully crafty).
 
Last edited:
A google groups search for "hyatt crafty" turns up 17,000 articles :)

He posts to rec.games.chess.computer a lot and gets into flame fests, some of them are pretty vicious.

I was suprised that crafty got that much out of the 64 bit compiler. I'm not sure, but I got the impression that he wasn't finished optimizing it for the opteron because the asm that he wrote for it was ifdef-ed out in the latest version, which was updated a couple of days ago.

--

I take that back, he does define the symbol in the Makefile to use the inline asm.
 
It says that a quad opteron 1.8ghz machine can get 7 Million nodes. So a single 1.8opteron should get 1.75million(slightly more due to the lack of multi-proc overhead). This is quite a bit better than what I can do now. With a fully optimized version of crafty, I can get 1.2 million nodes on a dual 1700+ XP, only half a mil per processor. Obviously the 64-bit gives the chip an advantage, as it can do 3.5 times as many nodes as my dual system can! Perhaps i should look into getting a dual opteron. . . .lol
 
Back