Repository navigation
fix(libkernel): keep Unity GC delivery out of MinGW TLS waits - #1562
Conversation
|
Tested on Windows 11 Pro 26200, WinLibs GCC 15.2.0 (r7), Release, at f6127d3, AMD GPU. Build and tests. Configures and builds. It passes on Same title (PPSA28997), measured as "frames still presented 40 s after start" over 6 runs each:
So on this machine the freeze needs both parts: the interruptible mutex wait (here or in an equivalent form) and #1476. With One more gap of the same kind: Tested with AI assistance (Claude Code). |
|
@merwie thank you for the testing and measurements. I addressed your findings:
The PPSA28997 measurements and the conclusion that both parts are required are recorded in the PR description. |
2092b04 to
6a42efe
Compare
|
Windows measurements of your current head, since I'd compared an older one in #1421's description (I've updated it there). Setup: Windows 10 (19045), GCC 15.2.0 (WinLibs r7), Release,
🤖 Addressed by Claude Code |
|
Please cut this down to the interruptible lock waits that PPSA28997 needs. Four things before it can go in:
|
de12706 to
0761021
Compare
|
@oneandonlydean Done. Reverted Exception.cpp and ools/check_test_registration.py to main. Moved the new test inside BUILD_TESTING in CMakeLists. Limited the 1ms ry_lock polling in Mutex/Rwlock strictly to Windows. |
|
This conflicts with main after today's merges; could you rebase? It's otherwise ready. |
0761021 to
14f5572
Compare
|
@oneandonlydean Rebased onto current main, resolved the conflict, and verified conventions check locally. Ready for merge. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
…dpoint-fls fix(libkernel): keep Unity GC delivery out of MinGW TLS waits
What
Unity's stop-the-world collector can raise
SIGUSR1while a worker is inside a host mutex wait. The previous Windows path could remain blocked in MinGW's TLS implementation: the signal handler re-entered guest thread state, pthread TSD orTimedWaitstate while the interrupted code still held an internal MinGW TLS lock. That left the collector waiting for a thread that could not run its handler and produced repeatedsce::Agc::suspendPointmessages associated with the TRC R5089 watchdog.This change keeps the signal-visible state out of MinGW TLS on Windows:
TimedWaitstate and per-thread timers use the same FLS-backed storage;scePthreadMutexLockuses short alertable waits throughtry_lock, allowing the GC delivery path to run while the mutex owner is still held;thread_localstorage and the existing condition-variable implementation.The default mutex type change (
ErrorChecktoNormal) was removed after it caused aguest_kernel_errorsregression. It belongs in a separate change.A permanent Vulkan
WaitIdlewas intentionally not added. Forcing Vulkan idle did not remove the loading stall, sosuspendPointis fixed at the thread-synchronization layer.This PR complements #1476, which fixes nested
TimedWaitwaiter ownership. The measured PPSA28997 freeze requires both parts.Tests
Added
guest_mutex_raise_exception, a Windows regression test that:scePthreadMutexLock;SIGUSR1on the blocked worker;Tested
God of War: Sons of Sparta (PPSA28997), Windows 10, NVIDIA GeForce RTX 3080.
The game reached the normal menu with the shader cache populated. The repeated
Forcing call to sce::Agc::suspendPoint to avoid TRC R5089 breachloop did not recur during the verified run.Targeted Windows tests:
guest_raise_exception,guest_mutex_raise_exceptionandguest_pthread_key. CI runs the complete platform test suites.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)TimedWaitwaiter ownership@oneandonlydean @adriadam10
This PR addresses the Unity GC/suspendPoint stall by removing MinGW TLS re-entry from the Windows signal path and making contended mutex and rwlock waits interruptible. The Vulkan path is deliberately unchanged because
WaitIdledid not resolve the stall. The fix was verified on Windows 10 with an NVIDIA RTX 3080 while running God of War: Sons of Sparta (PPSA28997).