fix(agc): share a table's rejection messages instead of copying each #10150
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10150"
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-23T10:50:48Z.
What
ShaderResources::rejectTableElementrecords a poison entry and a reason for each image or sampler table element the driver rejects. It kept that reason as its ownstd::stringper element. A sampler table's rejections mostly repeat one reason (an opaque-black border, a border that needs numeric-class pairing), so a table with many such samplers held one heap copy of the same text per element. Building the image table faults copied every string again. Each cachedShaderResourceskeeps its tables, so these copies stay in memory.In Ghost of Tsushima Director's Cut (PPSA02225), those strings and their copies were about 590 MiB of the heap in the opening.
How
TableStage::messagesandBdaResources::ImageTableFaults::messagesholdstd::shared_ptr<const std::string>instead ofstd::string.Tested
Ubuntu 26.04.1 (kernel 7.0), GCC 15.2, NVIDIA RTX 4070 Ti, driver 615.71.09, Release.
Ghost of Tsushima Director's Cut (PPSA02225).
maindoesn't take this title through its opening yet, so these runs use a GoT stack onmain30ecc1b7b3: @EagleBearerYS's #9742 and #9717 (their branches merged withmain0db47b263d), #8121, #8213, #9318, #9396, #9989, #9991, #7803, #9129, and @EagleBearerYS'sfix/agc-3d-view-committed-slices-v2branch. The base and this change are that stack without and with this commit. This commit doesn't touch the recompiler, so both use the same warm shader cache. Each run is one jemalloc heap profile (lg_prof_sample19) under a 20 GiB cap, until the cap ends the opening.ShaderResources::rejectTableElement(<addSamplerTable)ShaderResources::finishImageTablesEverything else in the top 10 is the same code in both runs: the NVIDIA driver, specialized modules, plan decoding, materialized results and shader registration. The run with this change has the smaller live heap at a later point.
Tests
tests/execution/ImageTable.cpp(agc_driver_image_table) rejects two sampler table entries, which differ only inMAX_LOD, for the same reason (an opaque-black border), and samples each one. Both faults must report the reason.mainand with this change.image_table|image_sample_border|emulated_color_compare|image_converted_unorm|image_sample_unnormalized|^agc_driver_graphics$|guest_samplerpass 3 of 3.mainb3e42bd1ebagainst this branch over the same 13 tests: both pass, and neither reports a VUID.ANYPS5_REQUIRE_VULKAN=1): the same 13 tests pass 3 of 3 onmainb3e42bd1eband 3 of 3 on this branch.Overlap: #8963 (@EagleBearerYS) adds includes to
BdaResources.hppat the same line as this PR's#include <memory>. Whichever lands second keeps both.Checklist
main; no other open PR implements the same functions (a textual include conflict with #8963: see Overlap)NotImplemented_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-10-23T11:00:03Z.
Review: CHANGES_REQUESTED
The correctness diff and focused regression are convincing, and hosted conventions/intake/label/report checks pass. Before approval, please resolve the open automated performance-report request: the PR’s jemalloc profiles are useful memory evidence, but the bot asks for
aps5-summary.jsonllines formainand this change on the same title, scene and machine, plus both traces andtools/trace_digest.pyoutput. The performance-report template and repository policy require that capture format for a PR labeledperf. If the change is intended to claim memory reduction only and not a speed change, please clarify that with maintainers and have theperflabeling/request corrected; otherwise attach the requested comparable captures. I did not run local Vulkan tests; the description reports 13 focused tests on Linux and Windows, repeated three times, with validation-layer runs.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T11:04:13Z.
Review: APPROVED
Thanks for clarifying the claim and updating the title. The change reports heap reduction only, makes no frame-time claim, and the automatic
perf/perf numbers missinglabels are now absent, so the trace-format request does not apply. I reviewed the code and regression diff, and the author reports the focused 13-test Linux and Windows suites with validation-layer comparison. Hosted conventions, intake, labels and report checks pass; product jobs were skipped by policy. No blocking issue found.