fix(agc): flush the shared logger from native clients #7709
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7709"
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 Scramblrrrr on 2026-10-19T02:07:47Z.
What
FlushAsyncLog_nid_no_patchis inline and reaches the header-localAsyncLog::Get. A Windows executable that calls it creates its own logger instead of flushing the driver's logger. When the other PE image initializes its logger, libc rejects its different end-flush callback withlibc: end flush already registered; the new ABI-deferral tests abort before checking shader behavior.Define this existing helper in the driver's lifecycle translation unit and leave its declaration in the header. Native clients then flush the same logger as the driver. The async logger, shutdown hook and test assertions keep their existing behavior.
Tested
Windows 11 Pro build 26200, MinGW-w64 GCC 15.2.0, Release, SPIRV-Tools OFF; RTX 5070 Ti / NVIDIA 617.42 / Ryzen 7800X3D.
324e0e48e, original production code and unchanged existing fixtures: all sixagc_driver_prepared_shaders_abi_deferred_{pixel,stages,undecodable_state,registration_failure,vertex_inputs,rectangle_pairs}cases fail. Five report0xc0000409, one reports an access violation during the failing logger initialization; the control captures the duplicate end-flush diagnostic.88c8320e3: 29/29 pass (19.92 s) across all registeredagc_driver_prepared_shaders*,agc_driver_shutdown_threads*,agc_async_logandagc_async_log_fatalcases. This includes all six original failures, with no fixture changes.7bdb95886: 114/114 native checks pass (52.81 s), including serialization, image-table reuse, indirect draws, HDR, APR and the logger/shutdown checks.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 github-actions[bot] on 2026-10-19T02:19:35Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/include/AsyncLog.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppImported from boykopovar/AnyPS5. Originally posted by karimibrahim07 on 2026-10-19T03:17:27Z.
Review: COMMENTED
Windows run of head
88c8320e3, merged ontomainccbd40240together with #7669, #7670, #7717 and #7680 (each merge clean, built once). Windows 11 Pro (26300), Ryzen 5 3600, NVIDIA GeForce RTX 3060 (driver 610.88), WinLibs GCC 15.2.0 r7, Ninja Release,BUILD_TESTING=ON,ANYPS5_AGC_EXECUTION_TESTSwithPreparedShadersandShutdownThreadsadded.agc_driver_prepared_shaders*, the 8agc_driver_shutdown_threads*,agc_async_logandagc_async_log_fatal),--repeat until-fail:3.main'sAsyncLog.hppandLifecycle.cpp, the same six cases as in your description fail:abi_deferred_pixel,_stages,_undecodable_state,_registration_failure,_vertex_inputsand_rectangle_pairs, each withlibc: end flush already registered(0xc0000409).abi_deferred_computeandabi_deferred_rectanglepass either way. Here all six were0xc0000409; I didn't see the access violation you got on one of them.Code: an
inlinefunction whose body calls the header-localAsyncLog::Get()gives each PE image its own logger, so a native test exe andlibSceAgcDrivereach register an end-flush callback. The out-of-line definition inLifecycle.cppmatchesHoldAsyncLog()just below it, which already does this.InstallAsyncLog_nid_no_patchandFlushAsyncLogAtEnd_nid_no_patchstay inline. Their callers are inside the driver, so that's fine. I have no requests.AI-assisted: yes. I ran the build, the tests and the negative control above.