Skip to content

fix(agc): flush the shared logger from native clients - #7709

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Scramblrrrr:codex/agc-shared-log-flush-main
Oct 19, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Scramblrrrr:codex/agc-shared-log-flush-main

Conversation

@Scramblrrrr

Copy link
Copy Markdown
Contributor

What

FlushAsyncLog_nid_no_patch is inline and reaches the header-local AsyncLog::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 with libc: 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.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 Pro build 26200
  • AI-assisted: yes (Codex)

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 6457 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 6479 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 6730 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 7622 core/libs/prx/libSceAgcDriver/Execution/include/AsyncLog.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp

@github-actions github-actions Bot added the agc libSceAgc* label Oct 19, 2026

@karimibrahim07 karimibrahim07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows run of head 88c8320e3, merged onto main ccbd40240 together 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_TESTS with PreparedShaders and ShutdownThreads added.

  • All 29 cases you list pass (the 19 agc_driver_prepared_shaders*, the 8 agc_driver_shutdown_threads*, agc_async_log and agc_async_log_fatal), --repeat until-fail:3.
  • Negative control: with main's AsyncLog.hpp and Lifecycle.cpp, the same six cases as in your description fail: abi_deferred_pixel, _stages, _undecodable_state, _registration_failure, _vertex_inputs and _rectangle_pairs, each with libc: end flush already registered (0xc0000409). abi_deferred_compute and abi_deferred_rectangle pass either way. Here all six were 0xc0000409; I didn't see the access violation you got on one of them.

Code: an inline function whose body calls the header-local AsyncLog::Get() gives each PE image its own logger, so a native test exe and libSceAgcDriver each register an end-flush callback. The out-of-line definition in Lifecycle.cpp matches HoldAsyncLog() just below it, which already does this. InstallAsyncLog_nid_no_patch and FlushAsyncLogAtEnd_nid_no_patch stay 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants