Editing Emulation accuracy

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
;It's important to know that emulation accuracy and compatibility are two different things; while how closely an emulator mimics the original hardware is important, don't mistake that for compatibility. Whether games run properly is a separate concern, accuracy can sometimes influence it. See [[#Perfection.3F|"perfection"]] and [[#Controversy|"controversy"]] sections.
 
;It's important to know that emulation accuracy and compatibility are two different things; while how closely an emulator mimics the original hardware is important, don't mistake that for compatibility. Whether games run properly is a separate concern, accuracy can sometimes influence it. See [[#Perfection.3F|"perfection"]] and [[#Controversy|"controversy"]] sections.
  
;In the world of computing, terms like "[[Hypervisors|hypervisors]]", "[[Simulators|simulators]]", "[[Compatibility_layer|compatibility layers]]", "[[Wrappers|wrappers]]", "[[FPGA|FPGA-based hardware cloning]]" and "[[:Category:Emulators|software emulators]]" are often used interchangeably, leading to confusion. While they share some similarities, each technology serves a distinct purpose and operates at different levels.
+
;In the world of computing, terms like "[[Hypervisors|hypervisors]]", "[[Simulators|simulators]]", "[[Compatibility_layer|compatibility layers]]", "[[Wrappers|wrappers]]", "[[FPGA|FPGA/Hardware emulators]] and "[[:Category:Emulators|software emulators]]" are often used interchangeably, leading to confusion. While they share some similarities, each technology serves a distinct purpose and operates at different levels.
  
Within the realm of computer science, emulation occupies a niche distinct from virtualization or other techniques. Whereas hypervisors usually used for partitioning physical hardware resources among multiple guest operating systems, and simulators where developers build virtual replicas of specific environments or processes, emulation endeavors to recreate an entire historical architecture. This digital reconstruction seeks to faithfully capture the instruction set, timing behaviors, hardware features and even peripheral nuances of a bygone hardware platform. Unlike compatibility layers, which translate software instructions to a native format, emulation builds a virtual stage upon which the software itself can perform authentically. Emulation's intricate tapestry sometimes intertwines with threads of other technologies though. Notably, certain emulators leverage hypervisors for a more efficient handling of resource allocation and isolation. Additionally, some emulators employ compatibility layers as subcomponents, acting as translators for specific libraries or APIs that might otherwise be incompatible with the host environment. Think of these layers as linguistic bridges, allowing the emulated software to converse fluently with the modern system hardware. By strategically merging these techniques and the help of skilled use of [[High/Low_level_emulation|HLE and LLE or Hybrid]], [[Dynamic_recompilation|compiler techniques]] and using specific features such as Fast Memory Access[https://github.com/PCSX2/pcsx2/pull/5821][https://github.com/PCSX2/pcsx2/pull/7295][https://yuzu-emu.org/entry/yuzu-fastmem/#what-is-fastmem][https://dolphin-emu.org/blog/2016/09/06/booting-the-final-gc-game/] and instruction set support (such as [https://whatcookie.github.io/posts/why-is-avx-512-useful-for-rpcs3/ AVX-512 for RPCS3]) and other various optimizations[https://yuzu-emu.org/entry/yuzu-progress-report-dec-2023/#android-adventures-and-kernels-with-benefits], certain emulators achieve impressive levels of performance and compatibility, further unlocking the doors to historical software [[Preservation_projects|preservation]].[https://youtu.be/cCXri4yDHmU]
+
Within the realm of computer science, emulation occupies a niche distinct from virtualization or other techniques. Whereas hypervisors usually used for partitioning physical hardware resources among multiple guest operating systems, and simulators where developers build virtual replicas of specific environments or processes, emulation endeavors to recreate an entire historical architecture. This digital reconstruction seeks to faithfully capture the instruction set, timing behaviors, hardware features and even peripheral nuances of a bygone hardware platform. Unlike compatibility layers, which translate software instructions to a native format, emulation builds a virtual stage upon which the software itself can perform authentically. Emulation's intricate tapestry sometimes intertwines with threads of other technologies though. Notably, certain emulators leverage hypervisors for a more efficient handling of resource allocation and isolation. Additionally, some emulators employ compatibility layers as subcomponents, acting as translators for specific libraries or APIs that might otherwise be incompatible with the host environment. Think of these layers as linguistic bridges, allowing the emulated software to converse fluently with the modern system hardware. By strategically merging these techniques and the help of [[Wikipedia:Category:Emulation_software#Pages_in_category|compilation/recompilation techniques]] and other optimizations, certain emulators achieve impressive levels of performance and compatibility, further unlocking the doors to historical software [[Preservation_projects|preservation]].
  
 
So in summary, an accurate emulator is when an instruction given to both the program and the hardware results in both outputting the same result. That means accurate emulators produce much fewer audio and video glitches, usually at the cost of more processing power needed. It's often achieved by using tighter synchronization. The more accurate an emulator is, the lesser deviations there is from real hardware behavior but the more demanding it is. Ironically, that aspect might at times be at odds with how authentic the experience is, when it introduces [[Input lag]]. A similar debate surrounds CRT shaders as well. Not to mention the hardware intensive nature of very accurate emulators for later consoles may be at odds with the emulator's usability, especially with the recent collapse of Moore's Law (in layman's terms, you can't just "buy a better PC" if semiconductor technology does not catch up fast enough with what it takes for accurate emulation that makes zero compromises for optimizing speed). As a result, accuracy and emulator authenticity continue to be controversial subjects and highly a matter of opinion depending on what aspect of the experience the user values more.
 
So in summary, an accurate emulator is when an instruction given to both the program and the hardware results in both outputting the same result. That means accurate emulators produce much fewer audio and video glitches, usually at the cost of more processing power needed. It's often achieved by using tighter synchronization. The more accurate an emulator is, the lesser deviations there is from real hardware behavior but the more demanding it is. Ironically, that aspect might at times be at odds with how authentic the experience is, when it introduces [[Input lag]]. A similar debate surrounds CRT shaders as well. Not to mention the hardware intensive nature of very accurate emulators for later consoles may be at odds with the emulator's usability, especially with the recent collapse of Moore's Law (in layman's terms, you can't just "buy a better PC" if semiconductor technology does not catch up fast enough with what it takes for accurate emulation that makes zero compromises for optimizing speed). As a result, accuracy and emulator authenticity continue to be controversial subjects and highly a matter of opinion depending on what aspect of the experience the user values more.
Line 19: Line 19:
  
 
===High accuracy===
 
===High accuracy===
High accuracy is a level of precision that emulator developers strive for when achieving [[#Cycle_accuracy|cycle accuracy]] or even [[#Partial cycle-accuracy|partial-cycle accuracy]] is not practical or necessary. This approach focuses on replicating the original system's components as closely as possible, aiming to faithfully reproduce its behavior while staying mindful of hardware demands. Though it may demand more processing power compared to lowly accurate emulators, pursuing a more accurate emulation experience can pay off in the form of fewer audio/visual glitches and better handling of niche scenarios that creative programmers often implement. Though they don't mimic every clock cycle as precisely as cycle-accuracy, highly accurate emulators capture the essence of the original hardware very well. Also achieving 100% compatibility with commercially released games is a common goal for emulators with high accuracy. Some of these emulators represent an even more meticulous level of precision in replicating the original system compared to other highly accurate emulators, this heightened level of accuracy often involves more sophisticated techniques, demanding increased computational resources.
+
High accuracy is a level of precision that emulator developers strive for when achieving [[#Cycle_accuracy|cycle accuracy]] or even [[#Partial cycle-accuracy|partial-cycle accuracy]] is not practical or necessary. This approach focuses on replicating the original system's components as accurately as possible, aiming to faithfully reproduce its behavior while staying mindful of hardware demands. Though it may demand more processing power, pursuing a more accurate emulation experience can pay off in the form of fewer audio/visual glitches and better handling of niche scenarios that creative programmers often implement. Though they don't mimic every clock cycle as precisely as cycle-accuracy, highly accurate emulators capture the essence of the original hardware very well. Also achieving 100% compatibility with commercially released games is a common goal for emulators with high accuracy. Some of these emulators represent an even more meticulous level of precision in replicating the original system compared to other highly accurate emulators, this heightened level of accuracy often involves more sophisticated techniques, demanding increased computational resources.
  
 
===Cycle accuracy===
 
===Cycle accuracy===
Line 29: Line 29:
  
 
====Partial cycle-accuracy====
 
====Partial cycle-accuracy====
This focuses on replicating the timing of instructions and key internal operations, while simplifying or skipping some less critical details. This can lower the performance requirements compared to full cycle accuracy. Remember, just because an emulator is partially cycle-accurate doesn't necessarily make it more accurate than a highly accurate emulator. For example, CEN64 only emulates the CPU pipeline cycle-accurately and that's all, on the other hand Simple64 is more accurate in terms of timing for specific tasks like certain DMA transfers, even though it doesn't achieve partially cycle-accurate emulation.
+
This focuses on replicating the timing of instructions and key internal operations, while simplifying or skipping some less critical details. This can lower the performance requirements compared to full cycle accuracy. Remember, just because an emulator is partially cycle-accurate doesn't necessarily make it more accurate than a highly accurate emulator. For example, CEN64 only emulates the CPU pipeline cycle-accurately and that's all, on the other hand Simple64 is more accurate in terms of timing for specific tasks like certain DMA transfers, even though it doesn't achieve partial cycle-accurate emulation.
 
:Examples of partially cycle-accurate emulators are [https://old.reddit.com/r/emulation/comments/vy8cg7/ares_v129_has_been_released_crossplatform/ig4da06/ bsnes] and [https://discord.com/channels/976404869386747954/976463759935696977/1106700321222299762 CEN64].
 
:Examples of partially cycle-accurate emulators are [https://old.reddit.com/r/emulation/comments/vy8cg7/ares_v129_has_been_released_crossplatform/ig4da06/ bsnes] and [https://discord.com/channels/976404869386747954/976463759935696977/1106700321222299762 CEN64].
  
 
====Cycle-based accuracy====
 
====Cycle-based accuracy====
 
This type of emulation accuracy aims to reproduce the system's functional behavior within a specified number of cycles without necessarily adhering to the exact  
 
This type of emulation accuracy aims to reproduce the system's functional behavior within a specified number of cycles without necessarily adhering to the exact  
timing of each individual cycle. Since this method doesn't go out of its way to mimic the precise timing and execution of each cycle, it may not be able to handle all hardware edge cases.
+
timing of each individual instruction. Since this method doesn't go out of its way to mimic the precise timing and execution of each instruction, it may not be able to handle all hardware edge cases.
 
:An example of a cycle-based emulator is jgnes with its cycle-based emulation of the Ricoh 2A03 and PPU.
 
:An example of a cycle-based emulator is jgnes with its cycle-based emulation of the Ricoh 2A03 and PPU.
  
Line 68: Line 68:
  
 
==Perfection?==
 
==Perfection?==
While it may be theoretically possible to have a 100% perfect emulator, that feat is very rare (if not nearly impossible), even for some highly regarded emulators such as [[higan]] or kevtris's work on the various FPGA-based consoles by Analogue. Just because an emulator claims to be "cycle accurate" or "100% compatible" does not mean that said emulator is flawless. This even includes situations in which all emulator accuracy tests (i.e. [[PS1 Tests]]) are passed, as these tests cannot cover every single edge case, and some of these tests may even fail on real hardware, leading to even more confusion. Some things are nearly impossible to perfectly emulate, such as some of the illegal opcodes of the [[wikipedia:MOS_Technology_6502|6502]], where the results are completely unpredictable on hardware, and different hardware revisions have different results and different illegal opcodes. The closest one could get to writing a perfect emulator would be if someone were to exactly copy an original ASIC map or a decap onto an FPGA, and even then, that isn't always a magic bullet.
+
While it may be theoretically possible to have a 100% perfect emulator, that feat is very rare (if not nearly impossible), even for some highly regarded emulators such as [[higan]] or kevtris's work on the various FPGA-based consoles by Analogue. Just because an emulator claims to be "cycle accurate" or "100% compatible" does not mean that said emulator is flawless. This even includes situations in which all emulator accuracy tests (ie. [[PS1 Tests]]) are passed, as these tests cannot cover every single edge case, and some of these tests may even fail on real hardware, leading to even more confusion. Some things are nearly impossible to perfectly emulate, such as some of the illegal opcodes of the [[wikipedia:MOS_Technology_6502|6502]], where the results are completely unpredictable on hardware, and different hardware revisions have different results and different illegal opcodes. The closest one could get to writing a perfect emulator would be if someone were to exactly copy an original ASIC map or a decap onto an FPGA, and even then, that isn't always a magic bullet.
  
 
While any given emulator may not be perfect, that does not mean that the emulator is bad by any means. Writing an accurate emulator is extremely hard work, and while perfection may be nearly impossible at the moment, that doesn't mean that games can't be enjoyed. Work on archival via emulation has come a very long way since the emulators of the 1990s, and things are only getting better from here, with excellent emulators such as the previously mentioned [[higan]] and kevtris's [[FPGA]] cores being available to use right now. In other words, "good enough" goes a long way.
 
While any given emulator may not be perfect, that does not mean that the emulator is bad by any means. Writing an accurate emulator is extremely hard work, and while perfection may be nearly impossible at the moment, that doesn't mean that games can't be enjoyed. Work on archival via emulation has come a very long way since the emulators of the 1990s, and things are only getting better from here, with excellent emulators such as the previously mentioned [[higan]] and kevtris's [[FPGA]] cores being available to use right now. In other words, "good enough" goes a long way.
Line 75: Line 75:
 
The accuracy debate has very clearly split into two sides.
 
The accuracy debate has very clearly split into two sides.
  
The ones that don't favor accuracy argue that emulators do not need to be as accurate as possible if it can play all the games they need. And because these games tend to be the most recognized alongside the console, there shouldn't really be an interest in making more games work since those do. A more compelling point is that as long as an emulator plays the majority of games at full speed on most computers and devices without too many obvious glitches, it doesn't matter how accurately it replicates the original hardware and its many quirks and functions. The faithfulness of the emulator to the console it's emulating comes second to its overall ability to play games.
+
The ones that don't favor accuracy argue that emulators do not need to be as accurate as possible if it can play all the games they need. And because these games tend to be the most recognized alongside the console, there shouldn't really be an interest in making more games work since those ones do. A more compelling point is that as long as an emulator plays the majority of games at full speed on most computers and devices without too many obvious glitches, it doesn't matter how accurately it replicates the original hardware and its many quirks and functions. The faithfulness of the emulator to the console it's emulating comes second to its overall ability to play games.
  
 
The ones that favor accuracy explain their view in that when playing a game with inaccurate emulation the experience may sometimes be quite different to the real thing, particularly with games focused on split-second reactions. There is also an entirely different reason: archival. Emulator projects should ultimately strive to recreate the hardware as much as possible; that's the only way for it to be compatible, and that's the only way to preserve the hardware. Speed and scalability to most devices is a lower priority to accuracy to the real console, both for purposes of compatibility and preservation.
 
The ones that favor accuracy explain their view in that when playing a game with inaccurate emulation the experience may sometimes be quite different to the real thing, particularly with games focused on split-second reactions. There is also an entirely different reason: archival. Emulator projects should ultimately strive to recreate the hardware as much as possible; that's the only way for it to be compatible, and that's the only way to preserve the hardware. Speed and scalability to most devices is a lower priority to accuracy to the real console, both for purposes of compatibility and preservation.

Please note that all contributions to Emulation General Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Emulation General Wiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)