Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPU Analyzer/Savestates: Usability improvements, Reduce LLVM compilation of garbage data #14547

Merged
merged 2 commits into from Aug 25, 2023

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Aug 24, 2023

Previously, savestates 99% of the time caused a second, and much longer (!) PPU LLVM compilation in addition to the already existing cache because it is scanning the whole segment 0. This was done in order to support analysis of patches applied within the savestate file on instructions located outside of registered code regions in executable.
Now, why savestates do not simply allow patches to be reused and re-register them instead? because applying patches after boot (on savestates for example) and before boot (normal patches) is not the same operation and may have different and unexpected consequences on farther execution.

The idea here is simply to avoid this and compile segment 0 at all times, so there won't be a second compilation for savestates. In order to avoid compiling garbage data, I added some more constraints in PPU Analayzer.

Please test if PPU LLVM compilation is being signficantly prolonged by this pr and remove previous PPU cache before testing.
I improved constrainsts further and made the "anti-optimization" affect only when patches are applied.
So in turn it may actually improve PPU LLVM compilation time when patches are not applied.

@cipherxof
Copy link
Contributor

Pretty much no difference compiling MGS4 (without PPU precompilation). 27.4s (master) vs 27.9s (pr)

@elad335 elad335 force-pushed the savestate-fix branch 3 times, most recently from 53c4398 to 7a21d95 Compare August 25, 2023 04:27
@elad335 elad335 added Enhancement Bugfix Savestates Anything that involves savestates CPU labels Aug 25, 2023
@elad335 elad335 force-pushed the savestate-fix branch 3 times, most recently from ba343cf to 867a27e Compare August 25, 2023 05:14
@elad335 elad335 changed the title [TESTERS NEEDED] PPU Analyzer/Savestates: Usability improvements PPU Analyzer/Savestates: Usability improvements Aug 25, 2023
@elad335 elad335 force-pushed the savestate-fix branch 2 times, most recently from 483cb58 to bd6e203 Compare August 25, 2023 07:09
@elad335
Copy link
Contributor Author

elad335 commented Aug 25, 2023

I improved constrainsts further and made it affect only when patches are applied.

@elad335 elad335 force-pushed the savestate-fix branch 4 times, most recently from 72930e3 to 7101b64 Compare August 25, 2023 07:45
@Ordinary205
Copy link
Contributor

Causes fatal error if I try to boot up the emulator.
Error 1

RPCS3.log.gz

@elad335
Copy link
Contributor Author

elad335 commented Aug 25, 2023

Fixed.

@elad335 elad335 changed the title PPU Analyzer/Savestates: Usability improvements PPU Analyzer/Savestates: Usability improvements, Reduce LLVM compilation of garbage data Aug 25, 2023
@Ordinary205
Copy link
Contributor

Ordinary205 commented Aug 25, 2023

And it just hangs there after building the SPU caches.
Had to use Task Manager to shut down the emulator, due to a deadlock issue.
Hangs there
RPCS3.log.gz

@elad335
Copy link
Contributor Author

elad335 commented Aug 25, 2023

And it just hangs there after building the SPU caches. Had to use Task Manager to shut down the emulator, due to a deadlock issue. Hangs there RPCS3.log.gz

·F 0:02:20.221796 {PPU[0x1000008] Thread ([MC] Render Thread) [0x00512a60]} SIG: Thread terminated due to fatal error: Assertion Failed! Vulkan API call failed with unrecoverable error: Device lost (Driver crashed with unspecified error or stopped responding and recovered) (VK_ERROR_DEVICE_LOST)
(in file C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\rpcs3\Emu\RSX\VK\vkutils\sync.cpp:610[:5], in function wait_for_event)
(in file C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\rpcs3\Emu\RSX\VK\vkutils\shared.cpp:114[:24], in function die_with_error)

Vulkan crash seems unrelated, maybe try again.

@Ordinary205
Copy link
Contributor

Oh sorry I didn't realized that I had VK_ERROR_DEVICE_LOST.
But yes it does boot up correctly after retesting.
Midnight club los angeles

RPCS3.log.gz

@elad335
Copy link
Contributor Author

elad335 commented Aug 25, 2023

You can open an issue if you catch it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix CPU Enhancement Savestates Anything that involves savestates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants