test(agc): keep the packed image table guard programs at different addresses #21255
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21255"
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 fernandomcrsilva on 2026-11-16T02:17:33Z.
What
agc_driver_image_table_packed_guardsfails on every run on a machine whose allocator hands a freed block to the next request of the same size (glibc 2.44 here):Guardsruns four opcodes (2, 0x42, 0x70, 10) against a poisoned table entry and requiresimage table:in the captured log each time. That line is written byLogCoalescedStderr_nid_no_patchinRecorder.cppand carries the program's address, andAsyncLog::Admitprints an identical line onlyPrintedRepeats= 3 times per 10 s. Each program was a local freed at the end of its iteration, so the next one got the same address, the four lines were identical, and the fourth was suppressed.The four programs now live in a vector until the loop ends, so their addresses differ and every line is printed. Test only; no product code changes.
Evidence that it is the coalescing and not the opcode or the GPU:
main(74696a08b2and579e4a0e6a), default allocator: 30 of 30 runs fail, and the log has three identicalshader 0x... stage 4 pc 0x68lines.{10, 2, 0x42, 0x70}on74696a08b2, opcode 10 passes and 0x70 fails: the failure follows the fourth position.GLIBC_TUNABLES=glibc.malloc.tcache_count=0on74696a08b2: the fourth program gets another address, four lines are printed, andmainpasses 6 of 6.mainalso passes with the validation layer loaded, which changes the allocation pattern too.Tested
CachyOS (glibc 2.44, GCC 16.2.1), Release,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.agc_driver_image_table_packed_tests guards, 30 runs each:main579e4a0e6afails 30 of 30; this PR passes 30 of 30 with the default allocator and 30 of 30 withGLIBC_TUNABLES=glibc.malloc.tcache_count=0. The log now has four lines with four addresses.ctest -R '^agc_driver_image_table': 29 of 29 pass (agc_driver_image_table_vouched_lookupsskips itself, as onmain).agc_driver_image_table_packed_guardsunderVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationwithVK_LOADER_DEBUG=layer(layer 1.4.363, inserted, not reported missing),mainand this PR: noVUID-line in either log.python3 tools/check_conventions.py --base upstream/main: passed.tools/pr_overlap.py --branchdid not run in my environment; withghthe only open PR I found touchingImageTablePacked.cppis #16321, inUnsupportedStores, not inGuards.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T02:40:00Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this test-only change; the targeted source review supports its stated fix.
What I ran
Reviewed head
79e34a5581b3c077de7b5b153048b0335b325124usingrepo_read.pyagainst the prepared review bundle. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No build or test execution was performed. The description’s reported test runs were not independently verified. The manifest lists one changed file,
core/libs/prx/libSceAgcDriver/tests/execution/ImageTablePacked.cpp, and marks its full text as included; that file was read. No files were excluded according to the manifest.To get this to a good state
Nothing is required.