fix(agc): define the device lookup count in the pipeline cache allocation test instead of linking the driver library #15440
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15440"
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 xXPBSXx on 2026-11-03T09:59:40Z.
What
The nightly sanitizer run 41573880531 (job address-undefined, started 2026-11-03 03:43 UTC, head
f6232fcfda) failsagc_pipeline_cache_allocation_startup,_now,_busy,_destructorand_workerwith an AddressSanitizerodr-violationon the globalRecompilerSwitches. The run of 2026-11-02 on926f7dd492passed them.2781d72d18, added in #10764, putlibSceAgcDriveron the link line ofagc_pipeline_cache_allocation_testsso that the test linksAgcDriver::Graphics::DeviceProcLookups(), whichContext.hpp(L149, used at L291) declares andShaderResources.cpp(L5265) defines; without it the test did not link. The test already links the staticshader_recompiler_agc_driver, andlibSceAgcDriveris a shared library (L436) that links the same static library (L465). The generated definition ofRecompilerSwitches(ShaderCacheVersion.cmake L161) is therefore in both the test executable and the shared library.This replaces the link with a thread-local definition of
DeviceProcLookups()intests/PipelineCacheFailures.cpp, and removeslibSceAgcDriverfrom the link line.Overlap
All 1674 open PRs were listed on 2026-11-03 at 09:01 UTC and their changed files read until 09:26 UTC, against
main4f41f4c375; the merge tests below ran with this change applied on thatmain. The files of this change aretests/PipelineCacheFailures.cppandtests/cmake/agc_pipeline_cache_allocation_tests.cmakeundercore/libs/prx/libSceAgcDriver/. Eight open PRs change one of them; each was merged with and without this change (git merge-tree):(Seven of them conflict with
mainwith or without this change; #14330 merges cleanly in both cases.)#11920 changes the same link line, to the one
mainhad atd1ae628bc2(libSceAgcDriverin the link list). It now conflicts withmainitself, so the merge with this change could not be read; when it is rebased, that link must stay out, otherwise the test andlibSceAgcDriverdefineRecompilerSwitchesagain. This change does not depend on #11920: #11920 keeps the definition ofDeviceProcLookups()inShaderResources.cpp, which this test does not compile, so the stub stays needed after it.Tested
Ubuntu 24.04.5 on WSL2 (kernel 6.18.54.1), gcc 13.3.0, Release,
-DANYPS5_ENABLE_ASAN=ON,-g1 -fsanitize=undefined -fno-sanitize=vptr(the flags of the nightly sanitizer workflow),ASAN_OPTIONS=detect_leaks=0, BUILD_TESTING=ON, 2026-11-03 between 06:25 and 06:33 UTC.maind1ae628bc2: the 5agc_pipeline_cache_allocation_*tests: 5 failed of 5.d1ae628bc2: the same 5 tests, 5 passed of 5.Not built on Windows: the only symbol the removed link provided is defined in the test.
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)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T10:14:51Z.
Review: COMMENTED
Reviewed — comments
The fix looks right and the affected tests pass. I'm leaving this as a comment rather than an approval because I couldn't reproduce the ASan
odr-violationhere and couldn't rebuild the negative control: the build tree can't be regenerated in a clean worktree on this machine.What I ran
Head
a2eb0ff251ca40e85d6b0c2f28c61e75a6079b92,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged with--no-ff(tree019cf40daf9e92da426c3b8369a72cdeca72ac9a). Machine: Debian 13 VM, 32 vCPU (Intel Xeon Gold 6136), GCC 14.2.0, Release, Ninja, BUILD_TESTING=ON. No ASan or UBSan in this build.Results
git diff --checkcheck_conventions.pylibs(script)main(unwrap_self_..._destination_directory_group,vector_constant_factor_tininess)agc_pipeline_cache_allocation_{startup,now,busy,destructor,worker}NEEDEDlibc.prxand system libraries;libSceAgcDriver.prxis no longer linkedRecompilerSwitchesD) in the test binary and separately inlibSceAgcDriver.prx, somain's link line put two definitions in one process, as the description saysagc_driver_native_depth_uniform_planes(see below)Symbols
About the VUID: the script reports
VUID-vkCmdDispatch-groupCountX-00386inagc_driver_native_depth_uniform_planes, marked "test not run on main". The validation baseline is an oldermain(d1ae628bc2). That test isn't in that tree; it was added tomainlater, intests/cmake/agc_driver_native_multisample_depth_tests.cmake. This PR changes only the two files of the pipeline cache allocation test, so the VUID comes frommain, not from this change. It should be followed up separately.Negative control
I put back
main's versions of both changed files and rebuilt the target. Ninja's glob check forced a CMake re-run, and that re-run failed in the sandbox: SDL2'sconfigure_filegets "Operation not permitted". So the binary withmain's link line was never rebuilt. In any case, this build has no ASan, so theodr-violationthe PR fixes would not show up here even with a successful rebuild.What I did check is static: the symbol listing above shows that
libSceAgcDriver.prxcarries its own definition ofRecompilerSwitches, so linking it next to the staticshader_recompiler_agc_driverduplicates that global, and the merged binary no longer links the library. I restored the merged files afterwards, andgit status --porcelainis empty.Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.cpp:23-30copies the production definition atcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:5272-5275(head L5265-L5268). The two match today (thread_local std::uint64_t, returned by reference). If the production counter changes (for example to an atomic, or by moving out ofShaderResources.cpp), this copy will drift without anything noticing. An optional follow-up: moveDeviceProcLookups()into its own small source file that bothlibSceAgcDriverand this test compile. This PR doesn't need it.main's link line needed thelibSceAgcDriverDLL at run time, but the test'sPATHsetting only adds thelibcdirectory. Dropping the link removes that dependency, which is a small improvement. I didn't build on Windows, and neither did the author.Not verified
odr-violationfailure, before or after the change: this machine's build has no sanitizer, and reconfiguring for one isn't possible in the sandbox.read-retrytest, which is only registered on Windows.To get this to a good state
Nothing needs to change in the code. The remaining step is evidence: a collaborator's nightly sanitizer run, or a manual Build run with ASan that includes this PR, showing
agc_pipeline_cache_allocation_*passing would confirm the fix the description reports.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T10:51:15Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The implementation addresses the reported duplicate-symbol setup, but this PR and open #11920 change the same test link line in opposite directions without recording an agreed order.
What I ran
Reviewed head
a2eb0ff251ca40e85d6b0c2f28c61e75a6079b92against base4f41f4c375f5abb487dbd184fbc150f31994d762; the current-base merge preview is clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. I did not build locally.Results
avplayer_http_patched_modulesfailed; not among changed files.Commands and unedited output
Negative control
RecompilerSwitchesdefinitionFindings
Blocking
target_link_librariesline as open #11920, in the opposite direction: this PR removeslibSceAgcDriver, while #11920 adds it.CONTRIBUTING.mdrequires authors of overlapping PRs to agree which goes first and record that order withDepends on; this PR currently saysnone. Please agree the order with #11920's author and update the checklist (for example,Depends on: #11920if this PR follows it).Non-blocking
avplayer_http_patched_modules, a test not listed among this PR's changed files. I did not establish whether it also fails on the base; rerun the job or otherwise resolve the check before approval.Sources
Not verified
I did not build or run CTest locally, reproduce the Windows failure, or run the author's reported Linux ASan/UBSan tests. Linux and specialized hosted jobs were skipped. No console or physical-GPU behavior was tested.
To get this to a good state
Agree and record the merge order with #11920, then get the failing Windows check resolved. I will rerun the same precheck, stack/overlap inspection and applicable checks on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T12:37:30Z.
Review: COMMENTED
Re-checked — comments
Nothing in the code changed. The head is still
a2eb0ff251. Since my last review the author replied to MarcZX10's change request about the order with #11920 and about the Windows job. The checks and the five allocation tests still pass. I still can't reproduce the ASanodr-violationhere, so this stays a comment.What changed since my last review
a2eb0ff251 = a2eb0ff251.Depends on: none.avplayer_http_patched_modules) to an existingmainproblem that #15375 fixes.What I ran
Head
a2eb0ff251ca40e85d6b0c2f28c61e75a6079b92,main4f41f4c375f5abb487dbd184fbc150f31994d762, merged with--no-ff. Release, GCC 14.2.0, Ninja, BUILD_TESTING=ON. No sanitizers in this build.git diff --checkcheck_conventions.pymainfailures (unwrap_self_..._destination_directory_group,vector_constant_factor_tininess)layer_missing_inempty, 0 tests with new VUIDs. The VUID I reported last time as coming frommainis gone now that the baseline is the samemain.agc_pipeline_cache_allocation_{startup,now,busy,destructor,worker}NEEDEDlibc.prxand system libraries only; nolibSceAgcDriver.prxgit status --porcelainis empty.Previous findings
DeviceProcLookups()atcore/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.cpp:23-30can drift from the production definition inShaderResources.cpp. The code is unchanged. An optional follow-up is still to put the function in its own source file that both targets compile.libSceAgcDriverDLL on Windows. This is still untested on Windows by me and by the author.About the author's reply to MarcZX10
Depends on: I agree with the author.mainhas hadlibSceAgcDriveron this link line since2781d72d18, and this PR works on currentmainwithout #11920. The test does not compileShaderResources.cpp, so the stub stays needed even after #11920. #11920 is the PR that has to rebase, and that rebase must keep the link out. So the dependency points from #11920 to this PR, andDepends on: noneis correct here. The rule in CONTRIBUTING.md asks for an agreed order; that is up to the two authors and maintainers, and I can't verify it offline.avplayer_http_patched_modules: this PR doesn't touch that test or its CMake. I can't open the cited runs or #15375 offline, so I take the explanation as author-reported. Nothing in this diff could plausibly cause afile COPY_FILEfailure inAvPlayerHttpModules.cmake.New findings
Blocking
None.
Non-blocking
None.
Not verified
odr-violation, before or after the change. This build has no sanitizer, and the sandbox can't reconfigure it. The 5/5 → 5/5 result with ASan ond1ae628bc2is author-reported.To get this to a good state
The code needs no changes. To approve, I still need one piece of evidence: a collaborator's ASan run that includes this PR (nightly sanitizer or a manual Build run) and shows
agc_pipeline_cache_allocation_*passing.