Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Professional Chess Engines in C/C++ ???

Author: Russell Reagan

Date: 21:05:52 12/23/02

Go up one level in this thread


On December 23, 2002 at 23:01:22, Anthony Martini wrote:

>         Am I wrong to assume that all professional chess programs are written
>in Assembly rather than C/C++

Yes. Junior is written in C++. Tiger is written in C. I can't say for sure, but
I'm sure many others are also. I think Fritz used to be written in assembly, but
I think it's C with assembler now.

>(or the newer C# - which may be even slower
>runtime wise) ? To get optimum results, wouldn't you have to code in Assembly,
>even with today's hardware? - and let's face it, these engines (not the
>interfaces) are small and compact.

You would not be wise to code in assembly today. If you know what you're doing,
you can write a few things in inline assembly, but a chess program can get quite
complex, especially if you are trying out new algorithms, more complex
evaluation, and so on. Not to mention having to re-write your program every few
years when new processors come out.

Which is better... Write everything in assembly and get a 10% speed increase
(which makes the program negligibly stronger), or to try out new search
algorithms and forward pruning ideas by the barrel and reduce your branching
factor down to 2.5? Now you have a monster, and you wouldn't have been able to
test out ideas as efficiently if you had written all of that in assembler.

>I haven't programed much in years, even
>though I have all the newest compilers (including Visual Studio .NET) - I know
>these new compilers generate compact/fast code, but it can't possibly compare
>with Assembly - or can it, when running time-critical applications? Does anybody
>even code in Assembly anymore, and does anybody even make Assemblers anymore (or
>do they just use the inline ones that come w/the C/C++ compilers)?

I wouldn't write a significant amount of code in assembly unless my engine was
one of the ones that has been around and is quite strong, and the only thing
left for me to do to increase playing strength was to make it a few percentages
faster. Seeing as how it's almost impossible to run out of new things to try, I
can't see myself using too much assembly.

"Speed" really has almost nothing to do with how well a chess program performs,
unless that speed difference is something like Deep Blue compared to a 200 MHz
machine. Even if you made the program twice as fast with assembly, that doesn't
even come out to an extra ply of search, and now you've practically handcuffed
yourself to a specific processor family, and reduced flexibility to try new
ideas.

If you are Frans Morsch (Fritz) and you have spent many years trying out new
ideas AND your program is not likely to change AND you are a genius when it
comes to coding in assembler, then be my guest. My advice is, if you have to
ask, you probably shouldn't be coding your chess engine in assembler.

Russell



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.