A Timely Discovery: Examining Our AMD 2nd Gen Ryzen Results
by Ian Cutress & Ryan Smith on April 25, 2018 11:15 AM ESTA Timely Re-Discovery
Most users have no need to worry about the internals of a computer: point, click, run, play games, and spend money if they want something faster. However one of the important features in a system relates to how they measure time. A modern system relies on a series of both hardware and software timers, both internal and external, in order to maintain a linear relation between requests, commands, execution, and interrupts.
The timers have different users, such as following instructions, maintaining video coherency, tracking real time, or managing the flow of data. Timers can (but not always) use external references to ensure their own consistency – damage, unexpected behavior, and even thermal environments can cause timers to lose their accuracy.
Timers are highly relevant for benchmarking. Most benchmark results are a measure of work performed per unit time, or in a given time. This means that both the numerator and the denominator need to be accurate: the system has to be able to measure what amount of work has been processed, and how long it took to do it in. Ideally there is no uncertainty in either of those values, giving an accurate result.
With the advent of Windows 8, between Intel and Microsoft, the way that the timers were used in the OS were changed. Windows 8 had the mantra that it had to ‘support all devices’, all the way from the high-cost systems down to the embedded platforms. Most of these platforms use what is called an RTC, a ‘real time clock’, to maintain the real-world time – this is typically a hardware circuit found in almost all devices that need to keep track of time and the processing of data. However, compared to previous versions of Windows, Microsoft changed the way it uses timers, such that it was compatible with systems that did not have a hardware-based RTC, such as low-cost and embedded devices. The RTC was an extra cost that could be saved if the software was built to do so.
Ultimately, any benchmark software in play has to probe the OS to determine the current time during the benchmark to then at the end give an accurate result. However the concept of time, without an external verifying source, is an arbitrarily defined constant – without external synchronization, there is no guarantee that ‘one second’ on the system equals ‘one second’ in the real world. For the most part, all of us rely on the reporting from the OS and the hardware that this equality is true, and there are a lot of hardware/software engineers ensuring that this is the case.
However, back in 2013, it was discovered that it was fairly easy to 'distort time' on a Windows 8 machine. After loading into the operating system, any adjustment in the base frequency of the processor, which is usually 100 MHz, can cause the ‘system time’ to desynchronise with ‘real time’. This was a serious issue in the extreme overclocking community, where world records require the best system tuning: when comparing two systems at the same frequency but with different base clock adjustments, up to a 7% difference in results were observed when there should have been a sub-1% difference. This was down to how Windows was managing its timers, and was observed on most modern systems.
For home users, most would suspect that this is not an issue. Most users tend not to adjust the base frequencies of their systems manually. For the most part that is true. However, as shown in some of our motherboard testing over the years, frequency response due to default BIOS settings can provide an observable clock drift around a specified value, something which can be exacerbated by the thermal performance. Having a system with observable clock drift, and subsequent timing drift, is not a good thing. It relies on the accuracy and quality of the motherboard components, as well as the state of the firmware. This issue has formally been classified as ‘RTC Bias’.
The extreme overclocking community, after analysing the issue, found a solution: forcing the High Performance Event Timer, known as HPET, found in the chipset. Some of our readers will have heard of HPET before, however our analysis is more interesting than it first appears.
Why A PC Has Multiple Timers
Aside from the RTC, a modern system makes use of many timers. All modern x86 processors have a Time Stamp Counter (TSC) for example, that counts the number of cycles from a given core, which was seen back in the day as a high-resolution, low-overhead way to get CPU timing information. There is also a Query Performance Counter (QPC), a Windows implementation that relies on the processor performance metrics to get a better resolution version of the TSC, which was developed in the advent of multi-core systems where the TSC was not applicable. There is also a timer function provided by the Advanced Configuration and Power Interface (ACPI), which is typically used for power management (which means turbo related functionality). Legacy timing methodologies, such as the Programmable Interval Timer (PIT), are also in use on modern systems. Along with the High Performance Event Timer, depending on the system in play, these timers will run at different frequencies.
The timers will be used for different parts of the system as described above. Generally, the high performance timers are the ones used for work that is more time sensitive, such as video streaming and playback. HPET, for example, was previously referred to by its old name, the Multimedia Timer. HPET is also the preferred timer for a number of monitoring and overclocking tools, which becomes important in a bit.
With the HPET timer being at least 10 MHz as per the specification, any code that requires it is likely to be more in sync with the real-world time (the ‘one-second in the machine’ actually equals ‘one-second in reality’) than using any other timer.
In a standard Windows installation, the operating system has access to all the timers available. The software used above is a custom tool developed to show if a system has any of those four timers (but the system can have more). For the most part, depending on the software instructions in play, the operating system will determine which timer is to be used – from a software perspective, it is fundamentally difficult to determine which timers will be available, so the software is often timer agnostic. There is not much of a way to force an algorithm to use one timer or another without invoking specific hardware or instructions that rely on a given timer, although the timers can be probed in software like the tool above.
HPET is slightly different, in that it can be forced to be the only timer. This is a two stage process:
The first stage is that it needs to be enabled in the BIOS. Depending on the motherboard and the chipset, there may or may not be an option for this. The options are usually for enable/disable, however this is not a simple on/off switch. When disabled, HPET is truly disabled. However, when enabled, this only means that the HPET is added to the pool of potential timers that the OS can use.
The second stage is in the operating system. In order to force HPET as the only timer to be used for the OS, it has to be explicitly mentioned in the system Boot Configuration Data (BCD). In standard operation, HPET is not in the BCD, so it remains in the pool of timers for the OS to use. However, for software to guarantee that the HPET is the only timer running, the software will typically request to make a change and make an accompanying system reboot to ensure the software works as planned. Ever wondered why some overclocking software requests a reboot *before* starting the overclock? One of the reasons is sometimes to force HPET to be enabled.
This leads to four potential configuration implementations:
- BIOS enabled, OS default: HPET is in list of potential timers
- BIOS enabled, OS forced: HPET is used in all situations
- BIOS disabled, OS default: HPET is not available
- BIOS disabled, OS forced: HPET is not available
Again, for extreme overclockers relying on benchmark results to be equal on Windows 8/10, HPET has to be forced to ensure benchmark consistency. Without it, the results are invalid.
The Effect of a High Performance Timer
With a high performance timer, the system is able to accurately determine clock speeds for monitoring software, or video streaming processing to ensure everything hits in the right order for audio and video. It can also come into play when gaming, especially when overclocking, ensuring data and frames are delivered in an orderly fashion, and has been shown to reduce stutter on overclocked systems. And perhaps most importantly, it avoids any timing issues caused by clock drift.
However, there are issues fundamental to the HPET design which means that it is not always the best timer to use. HPET is a continually upward counting timer, which relies on register recall or comparison metrics rather than a ‘set at x and count-down’ type of timer. The speed of the timer can, at times, cause a comparison to fail, depending on the time to write the compared value to the register and that time already passing. Using HPET for very granular timing requires a lot of register reads/writes, adding to the system load and power draw, and in a workload that requires explicit linearity, can actually introduce additional latency. Usually one of the biggest benefits to disabling HPET on some systems is the reduction in DPC Latency, for example.
242 Comments
View All Comments
RafaelHerschel - Thursday, April 26, 2018 - link
It's extremely disappointing. The original benchmarks should not have been published. But since that happened, they should have been removed or at the very least, there should have been a far more obvious (and stronger) disclaimer.Even their mea culpa isn't very strong. The article is well written, but should have started with: "We made a mistake". I dislike the misleading statement that other publications did not all install the latest patches. Some publications did, others gave a good reason why they didn't.
Mistakes happen, but after days of showing incorrect benchmarks people started speculating and even now there are still people spreading misinformation based on the AnandTech article.
This is an editorial problem. I feel very ambivalent about at this. AnandTech supplied some really interesting information, but if they can't redact wrong information in timely fashion, then AnandTech is not trustworthy.
I have reached my personal conclusion, but it is with regret. A few extra lines in the original version of the review would have made all the difference.
Ryan Smith - Thursday, April 26, 2018 - link
"This is an editorial problem. I feel very ambivalent about at this. AnandTech supplied some really interesting information, but if they can't redact wrong information in timely fashion, then AnandTech is not trustworthy."Ultimately that sits with me. Ian was able to repeat the earlier numbers again and again and again. Which indicated, at least initially, that it wasn't a mere fluke with our testing. The numbers we were getting were correct for the scenario we were testing. It just wasn't the scenario we thought we were testing.
It wasn't until he found the HPET connection a couple of days later that we even began to understand what was going on. And a couple of days later still until we had enough data to confirm our hypothesis.
As far as the original review goes, while it's been updated a few times since then, once we decided to audit our results, we did post a note on several pages about it. Which I hope was plainly visible. But if not, then that is very good feedback to have.
eva02langley - Friday, April 27, 2018 - link
Your methodology was good, it is just that an important factor... that should not be a factor... is actually crippling the competition.My question now is, odes HPET should be forced in today systems? For example, for security or other stability issues?
I mean, by playing in the lab, you did discover a huge problem and Intel needs to address IMHO.
Now it is coming back to the use of HPET and the requirements behind it.
Also, is this a problem with only older games? If this is the case, changing your bench suites should be a priority.
Tchamber - Thursday, April 26, 2018 - link
It's too bad you're so upset by this. Their first results, while not representative of peak performance, are indeed valid for the way they were achieved. They are not "wrong," so much as parallel. I hope they keep the results. As this review is the first one to have this issue, I'm glad to see they discovered the cause of the performance scores in such a short time. Keep up the good work, Ian!AdditionalPylons - Thursday, April 26, 2018 - link
Fascinating!MDD1963 - Thursday, April 26, 2018 - link
All that's really missing is the admission that tinkering with the HPET settings crippled Intel performance, and gave AMD the lead which they would not have without having done so...; correct? :) (Nice attempted deflection with the 'someone at Intel told us it would not matter' spiel....!) :)BikeDude - Friday, April 27, 2018 - link
As a current Intel user, I'm more worried about what software is using this timer and how often I have been exposed to this sort of non-stellar performance.My next upgrade will take this into consideration. Best of luck to you all.
_mat - Thursday, April 26, 2018 - link
Seems like the HPET bug finally gets the right momentum. Great!I finally wrote an English article about the HPET bug. There are a lot of misconceptions going on right now about that the bug is and what it's not. It also explains what the HPET timer problem was once, why it matters again today and which platforms are affected. Sadly this shows the way Intel handles bug reports like this as well.
https://tinyurl.com/ybz8qygj
Be sure to try TimerBench as well, my Windows timer benchmark! It has already been posted here so I won't bother you again (and the download is in the article).
Maxiking - Thursday, April 26, 2018 - link
Good job, needs more attention so this Meltdown/Spectre bullshits die ASAP.The video was published on 23 Jul 2017.
AndrewJacksonZA - Thursday, April 26, 2018 - link
You raised an important, IMHO, point:Do game engines use HEPT information in their logs, their AI calculations, their gfx calculations, and whatever else they do inside?
Why this is important in my opinion, is because what will the users' experience be out of the box? They build their PC, they install Windows, they install the game, and then... do they disable or enable HEPT before they play? No, they run the darn game!
We trust you to give us review results that would typically represent what we will get. Non-technical users also trust you to give them review results that would typically represent what they will get, no fiddling around because they don't know how and aren't interested to do so. Please take this comment into account when deciding if you're going to be flipping HEPT switches with every game on both CPU brands.
______________________________
And hey, I didn't see it, but did you do any comparisons on if GPU maker makes a difference to the HEPT impact on CPU maker?
Nvidia GPU + Intel CPU
Nvidia GPU + AMD CPU
AMD GPU + Intel CPU
AMD GPU + AMD CPU
AMD + AMD APU
AMD + Intel APU
Intel + Intel APU