test(agc): give the draw snapshot table set test texels for its whole surface #9236
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9236"
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 milescoviello on 2026-10-21T16:07:34Z.
What
drawSnapshotTableSetTestsinagc_driver_recorder_tests(theagc_draw_descriptorsentry) reads past its own texel array:std::array<float, width * height>.ShaderResourcesreads the whole surface while it resolves the image tables (cachedTexture→ReadTextureSurface→GuestMemory::ReadCommitted), so the read takes 960 bytes of whatever globals follow the array.An
ANYPS5_ENABLE_ASANbuild reports it as aglobal-buffer-overflow(READ of size 1024) and fails the test. A normal build reads the neighbouring bytes silently, and the test passes because it only counts descriptor writes.The texels are now sized as in the next test in the file (
width * height * (lastSlice + 1u) * 16uthere,width * height * 16uhere). The test also requiresDescribeSurface(DecodeTextureResource(texture)).guestBytes <= sizeof(texels), as that test does, so a smaller array fails the test in any build. Only the test changes.Tested
Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02, on
maincecb540a63.ANYPS5_ENABLE_ASANbuild (RelWithDebInfo,-fno-var-tracking, because GCC 13 crashes in its var-tracking pass onSpirvImageEmitter.cppwith ASan),agc_driver_recorder_tests --draw-descriptors-only:main: fails 3 of 3, each withERROR: AddressSanitizer: global-buffer-overflow ... READ of size 1024incopyCommittedunderdrawSnapshotTableSetTests.agc_driver_recorder_testspass under ASan.agc_draw_descriptorspasses 3 of 3.In the same ASan sweep of the CPU-side tests (1140), 5 other tests fail, none from this code:
the three
net_dontwait_blocking_*tests, which #8917 and #8918 cover;guest_unused_import_dependencies, whose subprocess stops because the ASan runtime is not first in its library list;guest_backtrace("first frame is not in the calling module"), which I haven't looked into.Windows 11 Enterprise 26300, NVIDIA GeForce GT 1030 (driver 582.78), WinLibs GCC 15.2.0 r7 (UCRT), Release:
agc_draw_descriptorspasses 3 of 3 onmainand 3 of 3 with this change. The table-set case runs there (the device has image tables) and passes.Not tested: AMD, Intel (the change is to a test buffer's size).
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