Skip to content

perf(agc): APS5_PRESYNC_CPU_WRITES waits for a dispatch build's pending CPU-side stores before the GPU mutex - #14163

Closed
milescoviello wants to merge 1 commit into
boykopovar:mainfrom
milescoviello:perf/dispatch-presync-cpu-writes
Closed

milescoviello wants to merge 1 commit into
boykopovar:mainfrom
milescoviello:perf/dispatch-presync-cpu-writes

Conversation

@milescoviello

Copy link
Copy Markdown
Contributor

What

A dispatch whose guest buffers cover a pending CPU-side store — a completion label stored when its batch is reaped, or a copied write-back — syncs with the GPU in stage B, under the GPU mutex: UploadFinish → CompletePendingCpuWrites → Recorder::SyncThrough → Recorder::Sync. Every queue that wants the mutex waits behind that sync, the draw committer included.

With APS5_PRESYNC_CPU_WRITES=1 (off by default), stage A also lists the build's buffer ranges for the existing stage-A pre-sync, which already waits for image surfaces without the mutex:

  • PresyncSurface gains a cpuWrites flag. ShaderResources::PresyncSurfaces adds the build's upload ranges (GuestBufferMemory::UploadRanges: its regions and the base regions of a cached address space), or a cached object's direct regions.
  • VulkanDevice::presync looks at those ranges only while a completion label or a copied write-back is pending at all. Under its short lock it keeps only the ranges CpuWriteSyncNeeded accepts. That is CompletePendingCpuWrites's own test, without the sync; CompletePendingCpuWrites now calls it. GPU-only pending writes never make the pre-sync wait.
  • The dispatch then reaps the batches it waited for at its own lock, so stage B finds nothing pending and does not sync.
  • [presync] reports the CPU-write ranges checked and the pre-syncs they joined. PresyncStatistics gains cpuWriteChecks and cpuWriteWaits.

Why: Ghost of Tsushima (PPSA02225 02.024.000)

This is measured on my Ghost of Tsushima test stack, because plain main stops earlier in this title on native multisample stencil or depth format import is not implemented (#9533, #9717). The stack is #9508's GPU heap plus those depth PRs; the code this PR changes is the same as main's.

  • Without the switch (in-game, 300 s windows): every sync of 200 ms or more was a compute dispatch's UploadFinish → CompletePendingCpuWrites → Recorder::Sync under the mutex, 64 of them for 31 s in total. The draw committer waited 1.6 to 2.1 s per 10 s for the GPU mutex, almost all of it behind queue 0x38 and 0x51 dispatches ([lock] "waited behind").
  • With it: 3 such syncs (0.9 s). The committer waited 0.28 s per 10 s for the mutex. 448 pre-syncs waited for CPU-side stores without the mutex.

That run also changed other switches, so paired runs alternating only this switch are underway and will follow in a comment, with APS5_TRACE_SUMMARY_EVERY lines.

Tested

Linux (Ubuntu 26.04.1, GCC 15.2), RTX 4070 Ti (NVIDIA 615.71.09), at this head 611cec0678 on main 01df56f7b7:

  • ctest -R 'agc_driver_cpu_write_presync|agc_driver_dcc_key_presync|^agc_recorder': 11 tests pass in each of 3 runs.
  • New agc_driver_cpu_write_presync (tests/execution/CpuWritePresync.cpp, the switch set by the test):
    • A label inside a copy's source. It queues a label stored by a completion (Recorder::AfterCompletions) inside the source of a copy dispatch. Stage A checks the range, waits for the label without the GPU mutex (cpuWriteWaits and presyncs each go up by one), and the copy reads the label's value.
    • A label outside the source. The same label outside the copy's source makes stage A wait for nothing, and the copy reads its own source.

Windows 11 VM (GeForce GT 1030, WinLibs GCC 15.2, Release) at this head and on main 01df56f7b7:

  • agc_driver_cpu_write_presync passes 3 of 3 at this head.
  • agc_driver_dcc_key_presync passes 3 of 3 on both sides.

Khronos validation layer comparison (vvlcmp.sh, Linux, RTX 4070 Ti), main against this head on agc_driver_cpu_write_presync|agc_driver_dcc_key_presync:

  • main: 1 test, 1 Vulkan device created. This head: 2 tests, 2 devices created.
  • No VUID- line on either side, so nothing new at this head.

Pending: paired Ghost of Tsushima runs that alternate only this switch, off/on/off/on on the same build. They will follow in a comment.

docs/dev/ENVIRONMENT.md lists the switch.

Overlaps

#9445, #9858 and #11847 each change one line that this PR moves: the label test in CompletePendingCpuWrites (PendingLabelIn to CompletionLabelIn). This PR moves that test, unchanged, into CpuWriteSyncNeeded, which CompletePendingCpuWrites now calls.

  • Whichever merges second takes the other's line.
  • The two are compatible: with CompletionLabelIn, the pre-sync also waits only for CPU-stored completion labels.

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
  • Fixes: none
  • Unblocks: none (PPSA02225 Ghost of Tsushima speed, Ghost of Tsushima Director's Cut (PPSA02225) — bring-up progress #4461)
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti (Linux), NVIDIA GeForce GT 1030 (Windows VM)
  • AI-assisted: yes

🤖 Generated with Claude Code

…ng CPU-side stores before the GPU mutex

A dispatch whose buffers cover a completion label or a copied write-back
still pending syncs in stage B under the GPU mutex (UploadFinish ->
CompletePendingCpuWrites -> Recorder::Sync), and every other queue waits
behind it. With the switch, stage A lists the build's buffer ranges for its
unlocked pre-sync, which keeps only the ranges CpuWriteSyncNeeded (the
test of CompletePendingCpuWrites without its sync) accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

The implementation and focused correctness evidence look reviewable, but the PR is titled perf and does not yet include the repository-required matched performance report.

What I ran

Reviewed head 611cec067881b4cf50cee06317064c171d2c983e, based on main 05ff2857e6391c0bdc672b73b5dfa573537134fc; the merge preview against that base was clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or compile locally.

git diff --check 05ff2857e6391c0bdc672b73b5dfa573537134fc...611cec067881b4cf50cee06317064c171d2c983e
python3 tools/check_conventions.py --base 05ff2857e6391c0bdc672b73b5dfa573537134fc --head 611cec067881b4cf50cee06317064c171d2c983e
python3 tools/pr_stack_check.py 14163 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14163-611cec067881/stack
git merge-tree --write-tree refs/review/anyps5-main refs/review/14163
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14163 --no-negative-controls

Results

Check Result
Diff check and conventions Passed. The conventions command printed All conventions checks passed.
Current-base merge preview and dependency check Clean; no declared dependency.
Source and test inspection The changed pre-sync path filters CPU-write ranges with CpuWriteSyncNeeded; the new test covers an in-range label and a label outside the copy source. The CMake test-fragment glob includes the new registration fragment.
Focused runtime tests The description reports 11/11 focused CTests in each of three Linux runs; Windows reports 3/3 agc_driver_cpu_write_presync and 3/3 agc_driver_dcc_key_presync on both main and this head. These are author-reported, not runs I performed.
Hosted CI At the snapshot, eligibility, intake, labels, conventions, report and library-portability checks were queued.
Precheck helper execution The overall precheck exited 1 because its isolated snapshot lacked workspace-only pr_abi_audit.py and pr_test_quality.py. No export ABI change is in this diff; I inspected test registration directly. This is a tooling availability issue, not a reported code-check failure.
Unedited local check output
All conventions checks passed.
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14163-611cec067881/stack/stack-report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14163-611cec067881/stack/stack-report.json
a05df87521e132727f760c3b5f5010219f790dfd

Negative control

No local negative control was run; the focused C++ tests require built binaries, and I did not build during this initial review.

Findings

Blocking

  • Required performance evidence is absent. The description says the reported 300-second runs changed other switches and that alternating off/on runs are still underway. Those preliminary figures do not isolate this change. Before this perf PR is ready for approval, add the main and PR aps5-summary.jsonl lines from the same title, scene, and machine, attach both traces, and include tools/trace_digest.py output as required by the repository's performance report guidance.

Non-blocking

  • None found in the source and test-registration inspection performed for this initial review.

Sources

Not verified

No local build or CTest run; no independent GPU, title, or console measurements. The paired performance captures and their digest are not present yet. The hosted checks were still queued at the snapshot.

To get this to a good state

Add the matched baseline/change summaries, traces, and digest to the PR description. I will re-run the same relevant checks on the updated head.

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 31, 2026
@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.

@milescoviello

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks for the review. Agreed, the runs in the description don't isolate the change. The paired captures are underway now on the same Ghost of Tsushima save, scene and machine.

Plain main stops in this title before gameplay (the D32S8 import, #9533/#9717), so both sides run on my GoT stack, with the only difference being this PR:

  • base 6acafe348d: the stack with its older copy of this change reverted.
  • change 9c994a7770: that base plus this PR's 611cec0678. Its C++ diff against the base is identical to this PR's diff against main.

That gives 2 runs per side, interleaved (base, PR, base, PR), each with APS5_TRACE_SECONDS=300:8 and summaries every 10 s. I'll add both sides' aps5-summary.jsonl lines, link the traces and add the tools/trace_digest.py output in the description when they're done, then ask you to re-run your checks.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Oct 31, 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 9508 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp L56-57
PR 9858 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L3552-3557
PR 11847 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L3552-3557

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 1395 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 1896 docs/dev/ENVIRONMENT.md
PR 2434 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6182 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6501 docs/dev/ENVIRONMENT.md
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6918 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6924 docs/dev/ENVIRONMENT.md
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7369 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7457 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 7464 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7514 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 7604 docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7844 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7922 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 8014 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8484 docs/dev/ENVIRONMENT.md
PR 8874 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 9012 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9154 docs/dev/ENVIRONMENT.md
PR 9176 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9248 docs/dev/ENVIRONMENT.md
PR 9287 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9289 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 9432 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9445 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9489 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9592 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9884 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9898 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 10025 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 10026 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 10064 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10069 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 10193 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10256 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10351 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10382 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10442 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10547 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10757 docs/dev/ENVIRONMENT.md
PR 10846 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 10867 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10940 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11351 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11554 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12120 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 12157 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 12323 docs/dev/ENVIRONMENT.md
PR 12324 docs/dev/ENVIRONMENT.md
PR 12536 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 12544 docs/dev/ENVIRONMENT.md
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12662 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 12746 docs/dev/ENVIRONMENT.md
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12855 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12904 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12980 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 13044 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
docs/dev/ENVIRONMENT.md
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13159 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 13263 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 13793 docs/dev/ENVIRONMENT.md
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 13863 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 13879 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 14051 docs/dev/ENVIRONMENT.md

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@milescoviello, the current PPSA02225 figures still compare runs where other switches changed, and the description says the paired captures are pending. Please add matched baseline/change aps5-summary.jsonl lines and both traces, using the same machine, session, scene, settings and warmed caches with no extra profiling switches. The performance report form also has a field for trace_digest.py output.

Since plain main cannot reach this scene, please identify the exact same prerequisite stack in both arms and isolate this change, with immutable commit IDs and the source compositions recorded. Alternating this switch on one build is useful mechanism evidence; please keep it distinct from the required baseline/change commit comparison.

The new fixture checks completion-label overlap and copied output, but its counters alone would not catch moving the timeline wait under GpuMutex. Please add a controlled lock-availability check during a held wait and coverage for a copied CPU write-back versus a GPU-only pending write.

@bunbeans2-arch

Copy link
Copy Markdown
Contributor

Ran on AMD RDNA 4 with this PR (611cec0678) merged onto main 3c8e5d9d42, and on main alone: Windows 11 Pro 10.0.22631, Radeon RX 9070 XT, MSYS2 UCRT64 GCC 16.1.0, Release, Vulkan validation layer on.

  • The new agc_driver_cpu_write_presync passed in 3 of 3 runs, with no validation errors. So did agc_driver_dcc_key_presync and all 105 tests of agc_driver_recorder_tests (321 of 321 results in total).
  • On main alone, the same 106 tests passed 318 of 318.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 31, 2026
@milescoviello

Copy link
Copy Markdown
Contributor Author

@MarcZX10 here are the paired Ghost of Tsushima (PPSA02225) runs. They don't show a gain, so I'm closing this PR.

Setup: same save, same scene, same machine (Linux, RTX 4070 Ti, NVIDIA 615.71.09). 20-minute sessions, each with a trace at 300 s (APS5_TRACE_SECONDS=300:8). The two builds differ only by this PR:

  • base 6acafe348d
  • change 9c994a7770 = base + 611cec0678
base 6acafe348d change 9c994a7770
fps, 200-500 s 0.570 0.563 / 0.563 (2 runs)
fps, 400-700 s 0.523 0.510 / 0.423
trace window: frame p50, GPU busy per present (trace_digest.py) 2095 ms, 1552 ms 1938 ms, 1531 ms
draw committer's GPU-mutex wait per 10 s (windows 20-60) 587 ms 534 ms
syncs of 200 ms or more 118 (69.0 s) 121 (70.4 s)
pre-syncs that joined a CPU-side store n/a 42 in the whole run

On this stack the scene is GPU-bound: about 80% GPU busy, around 1.5 s of GPU per present. The CPU-side completion-label syncs this PR moves out of the mutex are rare here, unlike the older stack whose runs the description quoted. So there's no fps change to show, and the description's numbers came from a run that also changed other switches.

Rather than leave a perf PR open without evidence, I'm closing it. If the CPU-store syncs become the bottleneck again on a title, I'll reopen it with matched captures.

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor Author

@oneandonlydean thanks for the specific list. The closing comment above has the matched baseline/change pair on the same prerequisite stack:

  • base 6acafe348d = the stack with its older copy of this change reverted.
  • change 9c994a7770 = that base + 611cec0678.

It shows no fps difference, so I closed the PR rather than work on the lock-availability fixture. If a title makes these syncs the bottleneck again, I'll reopen it with a held-wait lock test and the copied CPU write-back vs GPU-only pending-write cases you describe.

@bunbeans2-arch thank you for the RX 9070 XT run: 321 of 321 with the validation layer on, and the same 106 tests passing on main.

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* docs perf numbers missing perf pull request without a before and after summary line perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants