Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: for compiler and CPU experts: a very MYSTERIOUS problem!

Author: Gerd Isenberg

Date: 11:02:58 12/11/03

Go up one level in this thread


On December 11, 2003 at 12:06:53, F. Huber wrote:

>Hello!
>
>Since more than one week I´ve now a problem, which is really _strange_:
>
>Immediately after the release of my new ChestUCI version 3.0 I´ve got
>a response of some chess friends, that this new version is constantly
>slower than the last one (ver.2.8) by 8-10%. So I tested it myself on
>my new system (Pentium-IV 2.66), but I couldn´t confirm that - I got
>_absolutely identical_ solution times with this new version as with
>all previous ones!
>After some more tests we found out, that this 10% slowdown ONLY occurs
>on AMD-processors - NOT on Intel-CPUs !?
>And furthermore: the ´reason´ for this mysterious behaviour is not in
>my own ´ChestUCI´ (written in Borland Delphi), but in ´Chest´ itself
>(from Heiner Marxen),  which is written in ANSI-C and modified by me
>(only some additional file output!) for better communication with my
>UCI-interface and compiled with MS-VC++ 6.0.
>
>So what has changed in ´Chest´ from 2.8 to 3.0?
>
>1) I´ve included a few improvements and corrections from newer source
>files, which Heiner has sent me some time ago - but these were really
>_minor_ changes: absolut nothing that could explain a slowdown of Chest!
>(I´ve already emailed Heiner, but he also has no idea, how his small
>changes could have such an effect - and furthermore _only_ on AMD-CPUs)
>
>2) I´ve added a few additional commands (file output) to Chest, but normally
>these are not even executed at all - only if you really request them by
>setting a special engine option. So also my own changes could not explain
>this slowdown.

Hi Franz,

todays processors behave a bit chaotical due to lot of internal heuristics which
may greatly affect performance. Maybe some Athlons are more sensible about some
very special code or data movements/replacements. There are register stalls,
load-store stalls, code and data size and alignment issues, code and data
caches, branch prediction heuristics, virtual to physical memory mapping with
4KByte pages etc. Some minor changes may result in exceeding of some critical
thresholds.

Sometimes changing the order of some data members of a struct/class or the
placement of global variables inside modules has enormous effect, sometimes
negligible.

Did you perhaps change the order you link your modules?
Did you renamed some source files?


>
>What has NOT changed?
>
>1) I´ve _definitely_ NOT changed ANY compiler options!
>I tested this again and again, and I´m absolutely sure about this.
>Furthermore (since I´m not an expert in ´C´) I always compile(d) Chest
>with the compilers default settings (of course ´optimized for speed´,
>but that _is_ the default setting).
>
>2) The size of the EXE-file (´WinChest.exe´) has NOT changed - not even
>a single byte! (no big surprise, since all changes were rather small)
>
>3) And most important: as I mentioned above - the execution times on
>Intel-processors did NOT change at all !!
>
>Now, what have I tried?
>
>Within the last week I´ve exactly compared the new source code with the
>old one and searched for any possible errors - no success!
>Since I´ve no actual AMD-system I took my old one (AMD-K6/200MHz), which
>showed the same ´slowdown´ effect, made dozens of small changes in Chest
>(e.g. taking back some of the new changes) and recompiled it - no success!
>Once it seemed that I had found a solution (at least on my old K6 it was
>much faster again), but after having sent this new version to my friends,
>they said: "NOT faster, even slower!" - so this AMD-K6 seems not to be
>comparable with modern Athlons at all.
>
>And now I´ve really reached a point, where I have no further ideas, what
>else I could try. :-((
>Since here are lots of experts, maybe someone will know a solution for
>this strange problem - or at least could give an explanation for this
>mysterious slowdown effect on AMD-CPUs.
>(What I´m really angry about is not this slowdown itself - because those
>AMD´s are anyway faster for chess than Intel´s - but the fact, that I
>don´t know ´WHY?´. And as long as this question is not answered, there´s
>still the bad feeling of ´maybe I´ve indeed made some error anywhere?´.)
>
>So hoping to get some ´good´ answers, ;-)
>my best regards,
>Franz.


Seems you need that hardware first to reproduce the effects by your self.
You have to reproduce the previuos and faster Chest-version.

Generate map-files (project-settings/Link/general) with symbols and their
addresses - compare them. Profiling both versions may give some hints...
And comparing debug versions and probably several kinds of optimizations.
I often found size optimization was faster than speed optimization.

Good luck,
Gerd



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.