Live data from Hacker News

I found a bug in Intel Skylake processors

gallium.inria.fr

61–70 of 104 posts

Re: I found a bug in Intel Skylake processors

#61

One amusing thing about this epic tale is Serious Industrial OCaml User disregarded direct, relatively easy to implement, very sound advice from Xavier Leroy about how to debug their system! I would like to think that, were I in a similar situation being advised by an expert of that calibre, I would at least humor his suggestions. Why seek the expert if not for his advice? It brings to mind people disregarding doctor…

I know nothing of OCaml culture or why the author is deemed worthy of having his name italicized, but the doctor comparison is upsetting. If the guy who wrote this: I was tired of this problem, didn't know how to report those things (Intel doesn't have a public issue tracker like the rest of us), and suspected it was a problem with the specific machines at SIOU (e.g. a batch of flaky chips that got put in the wrong s…

His name is italicized because he is the primary author of OCaml (and a plethora of other great tools, like CompCert, the first fully-verified compiler). Overall, an exceedingly competent and productive programmer and scientist.

The doctor metaphor isn't perfect; what I was going for is, when you are seeking out an expert's advice and you ignore it, why do you go to see the expert in the first place?

Re: I found a bug in Intel Skylake processors

#62

Earlier quoted context omitted.

I know nothing of OCaml culture or why the author is deemed worthy of having his name italicized, but the doctor comparison is upsetting. If the guy who wrote this: I was tired of this problem, didn't know how to report those things (Intel doesn't have a public issue tracker like the rest of us), and suspected it was a problem with the specific machines at SIOU (e.g. a batch of flaky chips that got put in the wrong s…

His name is italicized because he is the primary author of OCaml (and a plethora of other great tools, like CompCert, the first fully-verified compiler). Overall, an exceedingly competent and productive programmer and scientist. The doctor metaphor isn't perfect; what I was going for is, when you are seeking out an expert's advice and you ignore it, why do you go to see the expert in the first place?

Thanks, that makes sense. I don't disagree about taking expert advice! I was just really disappointed to read the part of the article where the author doesn't bother to figure out how to navigate Intel support and report the bug.

Re: I found a bug in Intel Skylake processors

#63

A comp.arch poster said: > The errata refers to the problem showing up on short loops of less than 64 instructions that use AH, BH, CH or DH. > Looking at the Skylake microarch, the instruction decode queue is 128 uOps thread, 2*64 uOps when threaded. The Loop Stream Detector "can stream the same sequence of µOPs directly from the IDQ continuously without any additional fetching, decoding, or utilizing additional cac…

>> Looking at the Skylake microarch, the instruction decode queue is 128 uOps thread, 2x64 uOps when threaded.

No. Skylake does not have 128 μops with HT disabled. Skylake indeed was a big jump from Broadwell where the loopback buffer has 56 entries, 28 per hyperthread or 56 with HT off. Skylake has 64 μops per thread, HT on or off.

64 μops is a lot.

Re: I found a bug in Intel Skylake processors

#64
post #20
post #12

Earlier quoted context omitted.

Who can clarify? Google says: Qbvious - easily perceived or understood; clear, self-evident, or apparent.

The confusion is between "the assembly clang generates is the obviously correct assembly for this operation" (true) and "the obviously correct behaviour for a compiler is to generate the assembly that clang does" (disputable, as while the assembly GCC generates is less clear, there may be advantages to doing it that way in e.g. performance). "Clang does the obvious, correct thing." is ambiguous between these two mean…

I disagree with "ambiguous", you sneakily changed "obvious" to "obviously" in the second sentence.

  obvious, correct != obviously correct

Re: I found a bug in Intel Skylake processors

#65

> I worked from the executable provided by SIOU, first interactively under GDB (but it nearly drove me crazy, as I had to wait sometimes one hour to trigger the crash again), then using a little OCaml script that ran the program 1000 times and saved the core dumps produced at every crash. rr can often be a time-saver in situations by providing deterministic replays up to the point of a crash, whereas coredump analysi…

As much as I love RR, I am not sure it would've helped here, as the bug requires multiple threads to concurrently run? Also, RR is based on achieving deterministic replay IIRC, so I am not sure it'd be the first choice for a nondeterministic hardware bug?

You can do multiple concurrent rr recordings. A non-deterministic cpu bug would generally cause a divergence in the recording vs replay, so rr would be a decent way to go about this. The way I'd have probably used rr when faced with this is to bisect the recording to find which code is responsible.

Re: I found a bug in Intel Skylake processors

#66

Earlier quoted context omitted.

"smaller but not optimal" is not really true. It depends on what you're optimising for. In my experience, optimising for size overall, and then speed in the really performance-critical parts (with some expected expansion), gives the best results. Even the non-performance-critical code will have a noticeable effect if its larger size causes more cache misses. Making use of the "partial registers" (I see them more as s…

I don't disagree with you, but then use EAX, not AH (which would also produce a smaller code as you don't need to use a 64-bit constant) Optimizing for size is good, but what GCC did there made sense in the 32-bit days, but not that much today Some code snippets use AH/AL as 2 separate registers hence the processor might rename them to different internal registers. But then when reading EAX the processor needs to upd…

TFA says clang actually uses an encoding of AND which operates on RAX but takes only 32b of constant so it is pretty much the solution you propose. And BTW, operating directly on EAX itself fucks up the upper half of RAX.

Re: I found a bug in Intel Skylake processors

#67

> That would not be the first time that GCC treats undefined behaviors in the least possibly helpful way, Oh compilers. Like VC++6.0 initializing uninitialized memory to 0xCDCDCDCD in DEBUG.

Err, that's on purpose? It's so you can tell your writes apart, which is helpful while debugging.

They used to use, uh, more obvious patterns but the PC brigade called them on it so they settled on 0xcd.

Re: I found a bug in Intel Skylake processors

#68

Earlier quoted context omitted.

Do you know for a fact that Clang's code is faster here, i.e., have you measured it on actual hardware? Armchair performance estimation about "the potential" for something is often wrong...

It might not, but the GCC code has a potential issue in how it does things https://stackoverflow.com/a/41574531 (curiously the question is about GCC not doing it, apparently not always)

It's a performance trade off. It's not really surprising that GCC would make different performance trade offs when optimizing for different microarchitectures. (let alone most likely across different versions of GCC)

Why would you expect GCC to optimize for Pentium 4 (Netburst) in this day and age? (Especially given that the article is talking about Skylake.)

Re: I found a bug in Intel Skylake processors

#69

> That would not be the first time that GCC treats undefined behaviors in the least possibly helpful way, Oh compilers. Like VC++6.0 initializing uninitialized memory to 0xCDCDCDCD in DEBUG.

Err, that's on purpose? It's so you can tell your writes apart, which is helpful while debugging. They used to use, uh, more obvious patterns but the PC brigade called them on it so they settled on 0xcd.

Um, what was it? You can paste in decimal to avoid triggering the PC brigade ;)

Re: I found a bug in Intel Skylake processors

#70
post #69

Earlier quoted context omitted.

Err, that's on purpose? It's so you can tell your writes apart, which is helpful while debugging. They used to use, uh, more obvious patterns but the PC brigade called them on it so they settled on 0xcd.

Um, what was it? You can paste in decimal to avoid triggering the PC brigade ;)

Wikipedia has a list that includes some used values: https://en.wikipedia.org/wiki/Hexspeak
Post reply on HN