perf(agc): track per-slice attachment hazards in PassHazards #27254
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27254"
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 birdmarty on 2026-11-25T15:46:56Z.
What
PassHazardspreviously tracked render-pass attachments only by(VkImage, written). When consecutive passes write to disjoint mip levels or disjoint slice ranges of the same 3D volume or array image (for example, UE4's48x48x48Translucent Lighting Volume steppingdepthSlice = 0, 8, 16, 24, 32, 40withlayers = 8),PassHazards::Checktreated every slice step as an attachment-to-attachmentPassHazard::Imagecollision and forced an unnecessary barrier /Close.imagebreak.Changes
core/libs/prx/libSceAgcDriver/Graphics/include/PassHazards.hpp,Graphics/src/PassHazards.cpp:PassAttachment { image, written, mip, firstSlice, sliceCount }(sliceCount == 0retains whole-image matching).PassHazards::Check, only report an attachment-to-attachment hazard across passes when both attachments overlap in(mip, [firstSlice, firstSlice + sliceCount))(or either is whole-image). Image-to-attachment hazards remain whole-image.core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp: populatePassAttachmentwith each color target'smip,firstSlice, andsliceCountinrecordDraw.core/libs/prx/libSceAgcDriver/tests/PassHazards.cpp: addtestAttachmentSlicescovering disjoint slice ranges, different mips, overlapping slice ranges, and whole-image attachments.Tested
Windows 11 Pro (build 26300), i9-9900K, MinGW-w64 GCC 15.3.0, Release build, AMD Radeon RX 6800 (
vendor=0x1002,device=0x73bf), AMD proprietary driver26.10.1(Windows driver32.0.21045.16010, Vulkan1.4.315).Unit tests on
205937ad7e(baseorigin/mainc032ba7c52) withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK1.4.363.0),VK_LOADER_DEBUG=layer:ctest -R "^(agc_pass_hazards|agc_driver_recorder)$": 2 / 2 passed,Insert instance layer "VK_LAYER_KHRONOS_validation"confirmed, 0VUID-errors.tools/check_conventions.py --base origin/main: passed.tools/debt_fold.py --check: passed.Lies of P (
PPSA10621,v01.012.000,3200x1800, Krat Central Station Plaza):61250ca018showed93.0%(14,075 / 15,141) ofClose.imagebreaks wereatt-atton consecutive 3D volume slice passes (depthSlice = 0, 8, 16, 24, 32, 40).61250ca018with coarse scoped proofs, shared mesh windows, and split-set skip):9.37 → 9.94 FPS(p50 103.9 → 99.9 ms,p90 117.1 → 108.9 ms,gpu 68.9 → 66.3 ms/f,Graphics.Draw 72.8 → 65.7 ms/f).Performance captures (
APS5_TRACE_SECONDS=120:30, clean warm shader cache, no extraAPS5_TRACE_*orAPS5_PROFILE_*switches)Same machine, title (
PPSA10621,v01.012.000,3200x1800, Krat Central Station Plaza), and flags (APS5_DRAW_PIPELINE=1 APS5_NO_DRAW_STAGING=1 APS5_PIPELINE_DISPATCH=1 APS5_PIPELINE_DISPATCH_MISSES=1 APS5_FAST_F32=1):main,c032ba7c52):9.00 FPS,p50 110.5 ms,p90 117.7 ms,max 151.1 ms,gpu 70.31 ms/f,Graphics.Draw 72.33 ms/f(aps5-trace-c032ba7c5273-23148.json.gz).205937ad7e):8.97 FPS(-0.03),p50 110.8 ms(+0.3 ms),p90 119.0 ms(+1.3 ms),max 161.0 ms,gpu 69.47 ms/f(-0.83 ms/f),Graphics.Draw 71.77 ms/f(-0.56 ms/f),Graphics.RenderPass.Close.image48,617 → 6,553(-86.5%),Graphics.Barrier.draw200,066 → 156,685(-21.7%) (aps5-trace-205937ad7ead-14356.json.gz).Baseline
aps5-summary.jsonl(c032ba7c52):Candidate
aps5-summary.jsonl(205937ad7e):Series context & interleaved ablation
This PR is part of a general AGC/libc performance series measured on Lies of P (
PPSA10621,v01.012.000,3200x1800, UE4) covering #27249, #27250, #27251, #27252, #27253, #27254, #27268, #27269, #27270, #27271, and #27273 (tested together with #20130, #18757, #26778, #27117, and now-merged #26581 and #26681). Combined on base61250ca018(plus remaining unsplit stack changes), steady-state performance rose from7.25 FPS(p50 135.6 ms,gpu 92.7 ms/f, default settings) to12.15 FPSaverage (12.00/12.30 FPS, peak12.33 FPS,p50 81.5 ms,gpu 57.12 ms/f,+67.6%to+70.1%).Because five of the smaller PRs (#27253, #27254, #27270, #27271, and #27273) looked like they slightly lost average FPS (
-0.03to-0.31 FPS) in single isolated runs onc032ba7c52, we ran an interleaved 4-run ablation (A1 -> B1 -> A2 -> B2,APS5_TRACE_SECONDS=120:30, identical warm shader cache and flags) on the full stack to test whether removing those 5 PRs helped or hurt:61250ca018(WITH all 11 PRs): #27249, #27250, #27251, #27252, #27253, #27254, #27268, #27269, #27270, #27271, #27273 + #20130, #18757, #26778, #27117, #26581, #26681 + remaining unsplit stack changes (per-64 KiB proof/pending tracking and ShapeRecipe).61250ca018MINUS the 5 PRs (#27253, #27254, #27270, #27271, #27273): keeps #27249, #27250, #27251, #27252, #27268, #27269 + #20130, #18757, #26778, #27117, #26581, #26681 + remaining unsplit stack changes.DrawWithRecipe(ms/f)DrawFinish(ms/f)61250ca018, WITH all 11 PRs incl. #27253, #27254, #27270, #27271, #27273)61250ca018, MINUS #27253, #27254, #27270, #27271, #27273)61250ca018, WITH all 11 PRs incl. #27253, #27254, #27270, #27271, #27273)61250ca018, MINUS #27253, #27254, #27270, #27271, #27273)+0.39 FPS(+3.3%)-2.1 ms-4.6 ms-10.5 ms-3.21 ms/f-1.02 ms/f-0.88 ms/fRemoving those 5 PRs hurt every run (
A1 > B1andA2 > B2across all metrics), showing that their single-run isolated dips onc032ba7c52were within±0.25 FPSscene variance while larger bottlenecks (#27268, #27249, #27252, #20130, #18757) still dominated. Individual PR captures above remain isolated againstc032ba7c52.Not tested: Linux, NVIDIA/Intel GPUs.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T16:48:48Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at head
205937ad7eadbe35a5c4148043ddef8740e6099etracks attachment mip and slice ranges when checking hazards; the inspected implementation and tests support merging, while runtime and CI claims were not independently verified.What I ran
Read the prepared description, commit summary, manifest, diff, and all four changed source files through
repo_read.py. No build or tests were run. The author reports passing unit tests and conventions/debt checks.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full
Draw.cppfile was not read; only the changed hunk and targeted surrounding/caller context were inspected. The claimed Windows, GPU, validation-layer, performance, unit-test, conventions, and debt-check results were not independently verified. Linux and NVIDIA/Intel behavior were not tested. No files were excluded by the manifest.To get this to a good state
Nothing is required.