PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.3k stars 1.58k forks source link

[BUG]: Input Playback desyncs if built with MSVC #11549

Open sestain opened 1 month ago

sestain commented 1 month ago

Describe the Bug

Input playback seems to desync because emulation is a bit different between MSVC and Clang builds.

Reproduction Steps

Have "Pause on Start" enabled and turn off fast-boot for a good measurement with all memcards ejected. Create a input recording that is around 4900 frames (this should be plenty if fast boot is turned off for desyncs to occur, so 98 seconds of gameplay for 50fps and 81.67 seconds for 60fps), and try to playback it after restarting the whole emulator. With my any% tas of Crash Twinsanity, a desync occured a bit before 4900 frames because camera movement was different.

Expected Behavior

Input playback/emulation should be the same on both compilers.

PCSX2 Revision

v2.0.3

Operating System

Windows 11

If Linux - Specify Distro

No response

CPU

i5-12400F

GPU

RTX 2080Ti

GS Settings

No response

Emulation Settings

Pause On Start: Enabled Fast Boot: Disabled Memory Card Slots 1 & 2: Ejected + Disabled Pause On TLB Miss: Enabled

GS Window Screenshots

No response

Logs & Dumps

clang.txt msvc.txt

TheLastRar commented 1 month ago

So I attempted to repo this issue myself, using the PAL version of Jak X (recording the tutorials).

Tested on commit cd3e11bff77bb5a7f44c5a39cb534b670c09abd7 (Tagged v2.0.3)

For a recording performed on MSVC (Release AVX2 build) Playback on MSVC will de-sync faster, failing to pass the second tutorial. Playback on Clang stays in sync until reaching the 3rd tutorial.

For a recording performed on Clang (Release Clang AVX2 build) Playback on MSVC stays in sync until reaching the 3rd tutorial Playback on Clang will de-sync faster, failing to pass the second tutorial.

I have no clue what's going on

kage2051 commented 1 month ago

How does it behave when using the Cmake builds instead of AVX2 or SSE4 versions?

TheLastRar commented 1 month ago

How does it behave when using the Cmake builds instead of AVX2 or SSE4 versions?

Turns out my issues was that there was run to run variance with how Jak X was emulated, see https://github.com/PCSX2/pcsx2/issues/11607

TheLastRar commented 1 month ago

Managed to repo with Crash Twinsanity

For me the game hitched for a frame on the official builds, this hitch didn't occur on a MSVC build for me, which caused a desync for playback.

This behaviour seems consistent run to run

kage2051 commented 1 month ago

Managed to repo with Crash Twinsanity

For me the game hitched for a frame on the official builds, this hitch didn't occur on a MSVC build for me, which caused a desync for playback.

This behaviour seems consistent run to run

Was it with a recording done on the MSVC build?

TheLastRar commented 1 month ago

Managed to repo with Crash Twinsanity For me the game hitched for a frame on the official builds, this hitch didn't occur on a MSVC build for me, which caused a desync for playback. This behaviour seems consistent run to run

Was it with a recording done on the MSVC build?

Recording was made (and plays correctly) on the official clang builds