Skip to content

perf(agc): skip the staging, write-back and label-run leading barriers a covering barrier already orders - #7489

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
AlxcBTW:pr/barrier-batch
Oct 19, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
AlxcBTW:pr/barrier-batch

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What

Several commands start with a barrier that waits for every earlier write: the GPU buffer copy-in (recordGpuCopies), the copy-back (RecordCopyBacks), the storage write-back's import-ready barrier (StorageTexture::writeBackWindows) and the label store run (closeStoreRun). When the command before them has just recorded a barrier of its own that already covers theirs, they add a second barrier back to back with the first. A dispatch, a fill, a copy and the write-back's seed barrier already skip theirs in that case (Recorder::Commands(&covered), MarkCovered, the merged count on the [barriers] line). This extends the same rule to the four sites above.

  • BarrierMask and two pure functions (Graphics/include/BarrierBatch.hpp, Graphics/src/BarrierBatch.cpp): Covers(outer, inner) (stages, with ALL_COMMANDS holding every stage but the host; access masks as subsets) and OrderedByTrailing(covered, wanted) (the trailing barrier's destination accesses hold the shader and transfer accesses and the ones the left-out barrier asks for; the left-out barrier has no host destination, no layout change and no queue family transfer).
  • Recorder::ElideCovered(class, wanted, covered): OrderedByTrailing plus the switch, counted as merged for the class.
  • Copy-in, copy-back and the direct write-back's import-ready barrier ask ElideCovered with the mask Commands(&covered) returned. The write-back asks only when it recorded no seed or padding copy before the barrier, since those are commands recorded after Commands.
  • The label run's leading barrier is left out when the pass a draw left open was ended by closeStoreRun itself (its pass end barrier is the last command, and the pass has no after-pass callback) and Covers(PassEndBarrier, LabelLeadingBarrier). Both masks are now constants; endOpenRenderPass records PassEndBarrier, so the check and the barrier can't drift apart. The barrier at Submit (host destination) is recorded as before.

On by default. APS5_NO_BARRIER_BATCH=1 records them again (set at all means off, like the other APS5_NO_* switches); APS5_NO_BARRIER_ELISION=1 and APS5_FULL_BARRIERS=1 turn it off as well, since they turn off every leading barrier merge. The left-out barriers add to the merged counts per class (staging-in, staging-out, storage-writeback, label-run) on the [barriers] line under APS5_PROFILE_DRAW or APS5_PROFILE_GPU.

Why the result is the same: a barrier is left out only when its work is already ordered by the one before it.

  1. Commands(&covered) returns a non-zero mask only when the last command recorded into the batch is a barrier with ALL_COMMANDS as its destination stage and nothing was recorded since; the next Commands call clears it. That is the rule the dispatch, fill and copy sites already rely on. Every write recorded before that barrier is available and visible to the accesses of the mask at any later stage.
  2. A site asks only when the mask holds shader and transfer reads and writes and every access the site's barrier makes visible (OrderedByTrailing). A trailing barrier that marks less (the copy-in's own, which marks shader and uniform reads and shader writes) leaves the next barrier recorded.
  3. What the left-out barrier would order is exactly what was recorded before the trailing barrier: its source scope is ALL_COMMANDS (plus the host stage for host writes) with shader and transfer writes, and nothing sits between the two barriers. The trailing barrier's source scope covers the same commands, directly or through the barrier its own command started with (the chain every trailing mask already stands for in point 1).
  4. What it would make visible is made visible by the trailing barrier: its destination is ALL_COMMANDS, which holds TRANSFER and COMPUTE_SHADER, and the destination accesses of the left-out barrier are in the mask. A destination with the host stage is never left out.
  5. The host-write source bits of the copy-in and the import-ready barrier add nothing: host stores made before the batch is submitted are visible to the device by the submission itself (the write-back's seed barrier is already left out on that basis).
  6. The import-ready barrier carries an image barrier. In the direct path it keeps the layout (GENERAL to GENERAL) and the queue family, so it is a pure memory dependency; OrderedByTrailing refuses any barrier that changes a layout or transfers a queue family, which also keeps the non-direct write-back's barrier (TRANSFER_SRC_OPTIMAL) as it is.
  7. Label run: the pass end barrier (ALL_COMMANDS to ALL_COMMANDS; shader, colour, depth and transfer writes to shader and transfer reads and writes) holds the leading barrier (ALL_COMMANDS to TRANSFER; shader, transfer and colour writes to transfer writes) in every field, so the label stores that follow are ordered behind every write the pass end ordered, and behind every read before it (the execution dependency of ALL_COMMANDS). A pass with an after-pass callback records more commands after its barrier, so it keeps the barrier.
  8. Not touched: the dispatch, fill and copy sites, the Submit-time label barrier, the non-direct write-back, the trailing barriers, any barrier recorded after other commands.

Limits: the ordering is argued from the Vulkan rules above; the validation layers were not run on this PR's head, and nothing was run on console hardware. A GPU or driver that needs the second barrier to flush a cache the first leaves alone would break the argument, and APS5_NO_BARRIER_BATCH=1 is the way back.

Tested

  • Linux (Ubuntu, Mesa lavapipe), fork CI at 211293d (the PR head 0d704d3 plus the CI scaffolding commit; run 39113027924, the agc_* and recorder set of the lab test filter): 709 of 709 passed, among them agc_barrier_batch (the new test). Not run on Windows.
  • agc_barrier_batch_tests (tests/BarrierBatch.cpp, registered in the CMake test list): Covers on the pass end against the label run's leading barrier (covered), against the copy-in's (not: ALL_COMMANDS holds no host stage), against narrower and wider stages and accesses (a compute-only barrier, a source without the colour write, a destination without the transfer write, the reverse direction), and OrderedByTrailing on the masks the trailing barriers of a dispatch, a fill, a pass end and the copy-in leave (left out for the copy-in, the copy-out and the import-ready barrier; kept for an empty mask after an intervening command, a shader-only mask, a mask without the transfer read, the copy-in's own mask, a destination access the mask lacks, a host destination, an image barrier that changes the layout, a queue family transfer). Memory barriers carry no buffer or image range, so there is no range case: a global barrier covers every range, which is what the argument uses. The recorder paths are not unit tested; they run in the existing agc_* execution tests (the draw, dispatch, staging and write-back tests of the filter) with the switch on, and nothing in them failed.
  • Windows 11, NVIDIA, Minecraft Dungeons II (PPSA16064). Measured on the lab version c6fdafc (fork branch lab/barrier-batch, on an older base: job 9b, a = the lab stack lead-best11 + REFRESH_LEVER=2, b = the same + APS5_LAB_BARRIER_BATCH=1), not on this PR's head. The lab version differs from the PR: it also planned the order of the label store run (overlapping stores only get a barrier between waves), merged the write-back's image barrier and seed barrier into one call, and had a verify ledger and its own counters; none of that is in this PR, so its label-run and write-back figures are not this PR's. All rows, as measured:
row scene arm FPS frame p50 ms frame p99 ms GPU busy per present ms
bb-g-a-1 gameplay a 4.1 239.2 488.6 70.6
bb-g-a-2 gameplay a 4.55 213.4 315.1 66.7
bb-g-a-3 gameplay a 6.9 156.9 382.1 48.5
bb-g-b-1 gameplay b 3.5 291.9 345.5 71.5
bb-g-b-2 gameplay b 5.85 162.1 324.9 60.2
bb-g-b-3 gameplay b 8.15 128.2 279.3 53.0
bb-g-v gameplay b, verify mode 3.35 245.8 2225.2 77.8
bb-t-a-1 title a 7.82 127.6 151.0 73.1
bb-t-a-2 title a 8.2 121.9 147.9 72.8
bb-t-b-1 title b 8.17 120.5 159.1 72.4
bb-t-b-2 title b 7.48 116.8 302.9 72.7

The FPS rows are memory-noisy (the app held 15.8 GiB private and the commit reached 64 GiB; the gameplay spread inside arm a alone is 4.1 to 6.9 FPS, and the one verify row crashed once with 1.3 GiB free and ran on the retry), so I claim nothing for FPS or GPU busy from them.

GPU ms per present by class, mean over the [gputime] windows after the first three (ranges per present in brackets), APS5_PROFILE_GPU=1 on all rows:

row label-run staging-in staging-out storage-writeback
bb-g-a 1.65 [109] 2.77 [107] 2.89 [107] 5.45 [248]
bb-g-b 1.52 [106] 2.70 [107] 2.86 [107] 5.00 [251]
bb-g-v 1.78 [123] 3.22 [103] 3.38 [103] 8.28 [247]
bb-t-a 1.68 [78] 1.24 [86] 1.35 [86] 5.99 [253]
bb-t-b 1.64 [84] 1.22 [86] 1.36 [86] 6.04 [254]

In gameplay the four classes together went from 12.76 to 12.08 ms per present (about -0.7 ms, of which 0.45 ms in storage-writeback and 0.13 in label-run); at the title they did not change. Barriers recorded per 10 s, last [barrierbatch] line of each b row (before/after in the lab version): gameplay 57,143 to 44,256, 65,249 to 50,270, 112,726 to 85,766 (-22.6 %, -23.0 %, -23.9 %), title 108,363 to 82,306 and 49,993 to 39,322 (-24.0 %, -21.3 %); the verify row's windows 37,607 to 29,382 and 34,254 to 26,755 (-22 %). Most of it is the copy-in and copy-back leading barriers (gameplay, last b row: staging-in 16,086 to 10,121 and staging-out 16,086 to 8,043) and the write-back (40,158 to 28,363); the label run went from 40,396 to 39,239, of which the lab version's store waves are part, so this PR's share there is smaller. In the verify row, a ledger in the lab version checked every elided or merged barrier against the barrier left in its place: 156 and 100 exact covers, 7,900 and 7,245 covers through the trailing barrier's mask, 0 violations in both verify windows (the ledger ran in verify mode only). That ledger is a model of the rule, not a GPU result. Pictures were not compared. Traces are on the lab machine and I can attach them on request.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (PPSA16064 speed; no Game bring-up discussion yet)
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7677 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1924

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1324 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5480 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5656 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6249 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6588 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6611 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6786 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6887 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6905 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6924 docs/dev/ENVIRONMENT.md
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ENVIRONMENT.md
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ENVIRONMENT.md
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6965 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7154 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7233 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7254 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ENVIRONMENT.md
PR 7340 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7473 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ENVIRONMENT.md
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7618 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7622 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/ENVIRONMENT.md

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 18, 2026
@milescoviello

milescoviello commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

A data point from Linux. This is PPSA31162 on an NVIDIA RTX 4070 Ti (driver 595.99.02), Ubuntu 24.04. I merged this PR at 0d704d3 onto main 9caecfd locally (no conflicts) and used a Release build (ANYPS5_ENABLE_SPIRV_TOOLS off). I did four 180 s runs with pad input and a warm shader cache, all with APS5_PROFILE_GPU=1: two with APS5_NO_BARRIER_BATCH=1 and two without, interleaved. The figures are the sums of the [barriers] and [gputime] lines after the first 60 s, divided by the presents in that time.

Run Presents label-run recorded / merged staging-in recorded / merged staging-out recorded / merged storage-writeback recorded / merged GPU batch per present
APS5_NO_BARRIER_BATCH=1 598 748.0 / 0.0 101.8 / 0.0 101.8 / 0.0 355.7 / 45.9 142.9 ms
this PR 565 755.1 / 1.0 65.5 / 33.5 49.5 / 49.5 353.2 / 76.4 149.3 ms
APS5_NO_BARRIER_BATCH=1 336 1231.4 / 0.0 128.5 / 0.0 128.5 / 0.0 390.7 / 52.5 177.0 ms
this PR 356 773.5 / 1.2 65.7 / 35.7 50.7 / 50.7 357.3 / 76.9 183.6 ms

Recorded plus merged stays at about 99 per present for both staging classes. So in this title the PR leaves out about half of the copy-back barriers and about a third of the copy-in barriers. The write-back gains about 25 to 30 merged barriers per present. The label run's barrier is left out about once per present, out of roughly 750, so that condition rarely holds in this title.

I can't see a GPU time change. The runs reached different parts of the game (336 to 598 presents over the same stretch), and per-present GPU time follows that much more than it follows the switch. All four runs ran to the 180 s timeout.

AI-assisted: yes (Claude Code)

@LeandroLP23

Copy link
Copy Markdown
Contributor

AMD on Windows: the tests this PR names pass on an RDNA 3.5 GPU.

Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release. main 6efb7261b with this PR (0d704d32f) merged, together with #7296, #7446, #7377, #7445, #6708, #6748, #6785, #6706, #6613, #7449, #7391, #7484, #7514. They were built once, so the result is for the combination; each merge was clean.

  • agc_barrier_batch: pass, 3 runs of 3.
  • Every agc_* test on the combined build: 713 of 716 pass. The 3 that fail, agc_driver_host_import_lifetime, agc_driver_quad_pixel_mask and agc_driver_layered_volume_vertex_no_gpl, fail the same way on unchanged main here, so none comes from these PRs.

AI-assisted

@AlxcBTW

AlxcBTW commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@milescoviello thanks for the second title. The counts match the mechanism. Recorded plus merged stays at about 99 per present in both staging classes, so the PR leaves out about half of the copy-back barriers and a third of the copy-in barriers. The write-back gains 25 to 30 merged barriers per present. The label-run case almost never holds in PPSA31162 (1 in ~750), so in that title the gain is the staging and write-back sites.

I agree there is no GPU-time reading in rows that cover 336 to 598 presents of different stretches. The lab machine will run an A/B of this PR against APS5_NO_BARRIER_BATCH=1 in one build with fixed scenes (title and a fixed walk), and I'll post the rows here.

AI-assisted: yes (Claude Code)

@oneandonlydean oneandonlydean self-assigned this Oct 18, 2026
@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line unblocks title Names a title ID on the Unblocks line needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
The environment-reference check now requires a row for every APS5_* name a pull request reads; main added that check after this branch was written.
@github-actions

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@savvaniss

Copy link
Copy Markdown
Contributor

Intel and AMD Windows data: agc_barrier_batch passes with and without this PR on an Intel UHD 770 and an AMD RX 9070 XT, so the skipped barriers lose no ordering the test checks.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 0d704d32f merged into main 07377573f. "Without" means this PR's test files on main 07377573f, with none of its other changes.

Tests, ×3 UHD 770 RX 9070 XT
This head: agc_barrier_batch pass pass
Without pass pass

This is a correctness check only; I measured no speed.

I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7426, #7413, #7480, #7465, #7466, #7464, #7449, #7673, #7560). Neither GPU showed a failure beyond main's own: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build perf numbers missing perf pull request without a before and after summary line perf Performance change unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants