fix(agc): defer Windows exceptions during shader preparation #8592
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8592"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by gohansharma79-svg on 2026-10-20T17:41:55Z.
What
Prevent redirected Windows guest exceptions from entering a handler while the target is acquiring or holding a shader preparation transaction. A handler that prepares shaders can otherwise wait on a writer mutex held by the thread it interrupted. Defer delivery through acquisition and the full transaction lifetime, release staged state before ending deferral, and preserve nesting when a native thread is adopted by
scePthreadSelf.Resubmits #7686, which was closed automatically by the open-PR limit before #7680 merged. The original prerequisite #7652 has also merged. This branch contains only the follow-up fix on current main, preserving main's newer running-code classification and deferred image classification outside the suspended-thread interval.
This is a host deadlock correction. No gameplay FPS improvement is claimed. The existing one-second retry limit remains and throws if a target remains in a protected scope; other host locks and POSIX delivery are outside this change, recorded in the AGC debt file.
Overlap scan: #8512 has merged. This branch incorporates its 50 ms host-code deadline while retaining the one-second limit for protected shader scopes. #8539 also changes the delivery condition, without adding shader-transaction deferral; if merged subsequently it must preserve the guard. #8224 edits the adjacent strided-buffer debt note, unrelated to this fix. Older already-conflicted PRs also share files, as reported by the overlap tool; this is not a claim that those PRs merge cleanly together.
Tested
Windows 11 x64, Ryzen 7 5800X, GCC 15.2 / MinGW, Release,
ANYPS5_ENABLE_SPIRV_TOOLS=OFF.b85d972f42; candidate head16dab33e38. Conventions and whitespace checks pass. Fresh runtime validation after resolving the #8512 merge conflict: mainb85d972f42passes 5/5 focused Vulkan tests; candidate16dab33e38passes all 10 focused shader-deferral, exception, prepared-publication and draw-cache tests. Both used the same machine and validation-layer settings; no newVUID-diagnostics and no missing-layer messages were found. The earlier resubmission head also passed 10/10 on recheck (16.03 s).ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationand the official Khronos Windows x64 validation artifact from main commitaea761f4d54b86682be4099c428dba27b6609940. Neither log reports a missing requested layer. Both logs have zeroVUID-diagnostics; existing unused-fragment-output warnings occur on both.agc_driver_draw_cache_reuselaunch exited before application logging with Windows status0xc0e90002; the other four GPU tests passed. A subsequent complete ten-test run passed, including that test. The first failure is retained in the validation record and its cause is not established. Draft status is retained pending investigation of that startup failure.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:34:30Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed changes have no verified blocking defects; the author reports passing focused tests, but a startup failure remains unexplained and I could not run the checks independently.
What I ran
Reviewed head
16dab33e389a5d398d0184421ab67788085da4c9using the prepared diff andrepo_read.py. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
0xc0e90002) before application logging, with cause undetermined. The later full run reportedly passed, but investigating the initial failure would strengthen confidence in the validation record. Seecore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp:318for the changed deferral lifecycle.Not verified
I did not independently run builds or tests, verify the reported Windows environment, or test Linux runtime behavior or console behavior. The full text of all 10 changed files was included and read:
core/libs/prx/libSceAgcDriver/CMakeLists.txt,core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp,core/libs/prx/libSceAgcDriver/tests/ShaderSignalDeferral.cpp,core/libs/prx/libkernel/Pthread/include/Pthread.hpp,core/libs/prx/libkernel/Pthread/src/Thread.cpp,core/libs/prx/libkernel/System/src/Exception.cpp,core/libs/prx/libkernel/Time/TimedWait.cpp,core/libs/prx/libkernel/Time/include/HostSignalDeferral.hpp,core/libs/prx/libkernel/Time/include/TimedWait.hpp, anddocs/dev/debt/libSceAgcDriver.md.To get this to a good state
Nothing is required. Optionally investigate and document the cause of the reported startup failure.
Pull request closed