Skip to content

perf(agc): bind moved read-only words from the draw upload chunk - #11451

Open
johandavidcm wants to merge 1 commit into
boykopovar:mainfrom
johandavidcm:perf/agc-moved-word-upload
Open

johandavidcm wants to merge 1 commit into
boykopovar:mainfrom
johandavidcm:perf/agc-moved-word-upload

Conversation

@johandavidcm

@johandavidcm johandavidcm commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

A draw that hits a resource-cache template whose read-only guest buffers moved (MovedReadOnlyBuffers) binds the moved words through an override buffer: PrepareDrawBindings created a Vulkan Buffer for them on every such draw, kept at most eight in movedWordBuffers, and otherwise created another. In Yakuza 0 Director's Cut (PPSA31327) 80,000 of 390,000 draws per 10 s take that path, so the committer created a buffer per draw for a fifth of its draws: Buffer::Buffer and the driver's allocation under it were about 4 % of the committer in a sampled profile.

  • A moved-word override of at most APS5_DRAW_UPLOAD_MAX bytes (4 KiB by default) now takes a slice of the recorder's draw upload chunk (Recorder::DrawUpload), the same 1 MiB chunk the small snapshot uploads use: the words and the data patches are copied into the slice, and the descriptor points at the chunk with the slice's offset. Larger overrides keep the buffer per draw and the eight-slot cache as before.
  • APS5_NO_MOVED_WORD_UPLOAD=1 keeps every override in a buffer of its own. docs/dev/ENVIRONMENT.md gets the row.

Tested

Windows 11 Pro 26200, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON, head d4b86f8 on main f95acfc.

New test agc_moved_word_upload (tests/Recorder.cpp, --moved-word-upload-only): two draws of one template with different moved words must share one buffer, the chunk, at different offsets, each slice must hold its draw's words, and the descriptor written for the second draw must point at the chunk with that slice's offset.

  • Without the change it fails with two draws with moved words got a buffer each instead of slices of the recorder's draw upload chunk.
  • With the change it passes, also with --repeat until-fail:20. agc_draw_descriptors (drawDescriptorWriteTests) and the snapshot descriptor check in agc_driver_graphics expect the moved binding's descriptor at the slice's offset now instead of offset zero, and read the words there.

Pass with the change: agc_draw_descriptors, agc_draw_snapshot_cap, agc_draw_snapshot_epoch, agc_draw_inputs_in_place, agc_draw_inputs_copied, agc_queued_write_groups, agc_recorder_read_list, agc_descriptor_pool_recycling, agc_driver_draw_cache_reuse and its _draw_pipeline, _entry_verify, _inline, _off and _verify variants, agc_driver_graphics, agc_driver_address_passes, agc_driver_address_passes_targets_split.

With ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (VK_LOADER_DEBUG=layer showing the layer inserted), ctest -R <those tests> -V passes on main f95acfc (17 of 17) and on this head (18 of 18, with the new test); both logs show the layer inserted, neither contains was not found but was requested by env var VK_INSTANCE_LAYERS, and neither contains a VUID- line (0 on main, 0 on the head).

PPSA31327 01.015.000, gameplay in Kamurocho, scripted boot through the first dialogue, 1920x1080, APS5_DRAW_PIPELINE=1 APS5_DRAW_INPUTS_IN_PLACE=1, APS5_TRACE_SECONDS=140:60, runs alternated, two builds from the same tree and machine:

Between f616a13 and f95acfc, main changes libSceAgcDriver only in CMakeLists.txt, the new tests/ShaderMemory.cpp, two lines of Execution/src/Driver/Packets/PacketExecution.cpp, tests/MaskedSelect.cpp and tests/Pm4.cpp, none on the moved-word path, so the captures stand for this head.

Pair base p50 (presents in 60 s) this change p50 (presents) Change
1 206.7 ms (289) 196.3 ms (305) -5.0 %
2 210.0 ms (280) 190.0 ms (315) -9.5 %
3 198.6 ms (301) 197.1 ms (304) -0.8 %
4 203.6 ms (294) 192.9 ms (310) -5.3 %
mean 204.7 ms 194.1 ms -5.2 %

performance_compare lists window.first_present as the only configuration difference between the records. Graphics.Draw per frame moves by -7.6 %, -14.1 %, -3.9 % and -8.0 %; the GPU busy per present follows the frame.

Summary lines (pair 2: base, then this change)
{"commit":"b5e8d63b20cc","dirty":false,"env":{"APS5_DRAW_INPUTS_IN_PLACE":"1","APS5_DRAW_PIPELINE":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"140:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 621.01","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31892,"title_id":"PPSA31327","title":"Yakuza 0 Director's Cut","content_version":"01.015.000","resolution":"1920x1080","window":{"spec":"seconds 140:60","first_present":2994,"ms":60172.649},"presents":280,"frame_ms":{"p50":209.978,"p90":227.347,"p99":312.175,"max":327.108},"gpu_busy_ms_per_present":76.376,"worker_busy_pct":{"queue worker 0x0":98.155},"top_phases_ms_per_frame":{"Driver.Packet":210.788,"Graphics.Draw":183.394,"Driver.Packet.draw":179.783,"Driver.Draw":178.258,"Driver.DrawFinish":160.736,"Driver.Draw.prepare":150.340,"Graphics.Draw.draw_and_resource_release":149.140,"Driver.DrawFinish.shader_compile_and_link":110.619},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.229,"events_lost":3483105,"totals_full":false},"draw finisher":{"events_full_after_s":8.221,"events_lost":1702625,"totals_full":false},"draw committer":{"events_full_after_s":12.164,"events_lost":1055416,"totals_full":false}},"trace":"aps5-trace-b5e8d63b20cc-89144.json.gz"}
{"commit":"1d307e1e0282","dirty":false,"env":{"APS5_DRAW_INPUTS_IN_PLACE":"1","APS5_DRAW_PIPELINE":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"140:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 621.01","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31892,"title_id":"PPSA31327","title":"Yakuza 0 Director's Cut","content_version":"01.015.000","resolution":"1920x1080","window":{"spec":"seconds 140:60","first_present":3034,"ms":60033.790},"presents":315,"frame_ms":{"p50":190.032,"p90":198.844,"p99":206.373,"max":216.711},"gpu_busy_ms_per_present":69.310,"worker_busy_pct":{"queue worker 0x0":98.118},"top_phases_ms_per_frame":{"Driver.Packet":186.916,"Driver.Packet.draw":157.677,"Graphics.Draw":157.572,"Driver.Draw":156.396,"Driver.DrawFinish":140.348,"Driver.Draw.prepare":130.889,"Graphics.Draw.draw_and_resource_release":127.694,"Driver.DrawFinish.shader_compile_and_link":99.737},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.258,"events_lost":3459324,"totals_full":false},"draw finisher":{"events_full_after_s":8.484,"events_lost":1623402,"totals_full":false},"draw committer":{"events_full_after_s":14.175,"events_lost":861186,"totals_full":false}},"trace":"aps5-trace-1d307e1e0282-105208.json.gz"}

The traces of pair 2 and the output of tools/trace_digest.py on each are in the comment below the review.

Earlier, on main 9f386f3 + #8098 with one build and the switch (APS5_NO_MOVED_WORD_UPLOAD=1 as the base arm), four alternated pairs gave 198.6 / 203.9, 205.6 / 199.8, 211.3 / 194.4 and 206.7 / 189.8 ms (mean -4.2 %), and a sampled committer profile of each arm (APS5_SAMPLE_COMMITTER, gameplay only, one run per arm) showed the mechanism:

share of the committer's gameplay samples APS5_NO_MOVED_WORD_UPLOAD=1 this change
PrepareDrawBindings (inclusive) 11.5 % 6.5 %
of it, Buffer::Buffer 2.1 % 0
of it, Allocate + Recorder::KeepBytes + shared-pointer release 2.0 % 0.6 %
recordPreparedDraw (inclusive) 25.9 % 21.3 %
prepareDraw (inclusive, untouched by the change) 59.7 % 60.8 %

Frame dumps at the same points of the scene (intro, title, two street frames) match between this change and the base build. tools/check_conventions.py --base origin/main passes.

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 (PPSA31327 Yakuza 0 Director's Cut (PPSA31327) #6722 is the title it was measured on)
  • GPUs tested: NVIDIA GeForce RTX 4070, driver 621.01, Windows 11 Pro 26200
  • AI-assisted: yes

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

@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.

The perf evidence is not yet reviewable under the repository rule. Both pasted aps5-summary.jsonl records identify commit ef5836d37150; only the environment differs (APS5_NO_MOVED_WORD_UPLOAD=1 versus unset), so the first record does not identify a capture on main and the second does not identify this PR head. Please provide a same-title, same-scene, same-machine capture on current main and on the changed head, paste the two actual summary records, attach both trace files, and include the output of tools/trace_digest.py. The branch is also based on 3ead2d7251 while main has advanced to 51f5c57dd9; please sync it and rerun the required checks.

@panicDa3m0n

Copy link
Copy Markdown

@johandavidcm, a note on how this meets #9712, which keeps draw snapshots in resizable BAR memory. There the draw upload chunk (Recorder::DrawUpload) is allocated with context.SnapshotProperties(), so with both changes the moved words these draws bind are written straight into device-local, host-visible memory when the GPU has a resizable BAR. This change only writes the slice (the copy and the byte patches) and never reads it back, and reads are the slow access on that memory.

The two overlap on one line: both add a test to the Windows set_tests_properties(agc_recorder_read_list …) list in core/libs/prx/libSceAgcDriver/CMakeLists.txt (#9712 adds agc_draw_input_memory, this one agc_moved_word_upload). The rest of this diff applies cleanly on main with #9712 merged. Either order works for me: whichever is merged second keeps both names on that line.

AI-assisted: yes

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

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 862 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4449 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4472 docs/dev/ENVIRONMENT.md
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6182 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6498 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6743 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6905 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6921 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6924 docs/dev/ENVIRONMENT.md
PR 6959 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7243 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7261 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7310 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7410 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7446 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7449 docs/dev/ENVIRONMENT.md
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 7464 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 7643 docs/dev/ENVIRONMENT.md
PR 7668 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7717 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7844 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7893 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7922 docs/dev/ENVIRONMENT.md
PR 8004 docs/dev/ENVIRONMENT.md
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8089 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8105 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8212 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 8365 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 8542 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8874 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8887 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 8939 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8963 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9012 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9129 docs/dev/ENVIRONMENT.md
PR 9176 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9243 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 9248 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 9287 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9289 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 9445 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9489 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9533 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9565 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9592 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9604 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9626 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 9633 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9671 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9675 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9676 docs/dev/ENVIRONMENT.md
PR 9696 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9700 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9717 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9723 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 9742 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9748 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9749 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9790 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9852 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9858 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9875 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9884 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9890 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9892 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9897 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9898 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9899 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9969 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9999 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10000 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10026 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10043 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 10049 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10064 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10069 docs/dev/ENVIRONMENT.md
PR 10141 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10159 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10194 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10233 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10256 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10304 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10333 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10348 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10351 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10382 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10435 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10443 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10472 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10489 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10492 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10497 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10498 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10547 docs/dev/ENVIRONMENT.md
PR 10556 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10581 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10668 docs/dev/ENVIRONMENT.md
PR 10678 docs/dev/ENVIRONMENT.md
PR 10720 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10750 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 10757 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 10760 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10764 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10773 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10779 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10846 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 10867 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10886 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10894 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10920 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11075 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11098 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11130 docs/dev/ENVIRONMENT.md
PR 11163 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11305 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11307 docs/dev/ENVIRONMENT.md
PR 11348 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11351 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 11363 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 11435 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 11436 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 11442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11443 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11444 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11485 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11490 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11507 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11520 docs/dev/ENVIRONMENT.md
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11554 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11555 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11557 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11566 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11600 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11615 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11637 docs/dev/ENVIRONMENT.md
PR 11638 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11684 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11690 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11692 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11694 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11696 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 11704 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11711 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11721 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11740 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11825 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11847 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11899 docs/dev/ENVIRONMENT.md
PR 11901 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11914 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11915 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11916 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11920 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11948 docs/dev/ENVIRONMENT.md
PR 11957 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11998 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 12051 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 12066 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 12068 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12074 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@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.

Re-reviewed exact head 1941801408e7eeddc39326643ae2bf1f4695c2e9. The code patch is unchanged from the previously reviewed commit, but the required performance evidence is still not present: both pasted summary lines identify the same commit ef5836d37150 and differ only by APS5_NO_MOVED_WORD_UPLOAD. That is a useful configuration comparison, but it is not a capture on main and one on this PR head as required by CONTRIBUTING.md.

The head is based on f616a1397f9b618036ac7c89f461f0bd46fbd6d6; the live main head is 2dbe9b99f577f5fad8ee675932a0603439e5eb2a. Please provide a same-title, same-scene, same-machine pair captured on those exact revisions, attach both traces, and include the actual tools/trace_digest.py output. Until those artifacts identify a main-vs-change comparison, the perf numbers missing label is accurate.

Local checks I ran against current main and this exact head: python3 tools/check_conventions.py --base upstream/main --head upstream/pr-11451 passed; git diff --check upstream/main...upstream/pr-11451 passed; the merge-tree preview is clean. Hosted eligibility, conventions, labels and report checks pass; relinker and product jobs were skipped. I did not run the Windows/GPU tests locally.

@johandavidcm
johandavidcm force-pushed the perf/agc-moved-word-upload branch from 1941801 to 29c9624 Compare October 26, 2026 15:05
@github-actions github-actions Bot removed the perf numbers missing perf pull request without a before and after summary line label Oct 26, 2026
@johandavidcm

Copy link
Copy Markdown
Contributor Author

@MarcZX10 rebased onto main 7903201; head is now 29c9624. On that head the focused set passes under the validation layer on main 7903201 (17 of 17) and on the head (18 of 18, agc_moved_word_upload 20 times in a row); neither log has a missing-layer message or a VUID- line. The description is updated.

Captures on two builds, as asked: base main f616a13 + #8098 (commit b5e8d63b2; #8098 is the title's audio fix, without which it does not run, and it touches libSceAudioOut only) and the same plus this commit (1d307e1e0), same title, scene and machine (PPSA31327, Kamurocho, RTX 4070, driver 621.01), four alternated pairs. Between f616a13 and 7903201, main changes libSceAgcDriver only in CMakeLists.txt and the new tests/ShaderMemory.cpp (a test and its registration, no runtime code), so the captures stand for this head.

Pair base p50 (presents in 60 s) this change p50 (presents) Change
1 206.7 ms (289) 196.3 ms (305) -5.0 %
2 210.0 ms (280) 190.0 ms (315) -9.5 %
3 198.6 ms (301) 197.1 ms (304) -0.8 %
4 203.6 ms (294) 192.9 ms (310) -5.3 %
mean 204.7 ms 194.1 ms -5.2 %

performance_compare on each pair lists window.first_present as the only configuration difference. The two aps5-summary.jsonl records of pair 2 are in the description; the two traces are attached here, and tools/trace_digest.py on each:

Base, commit b5e8d63b2

seconds 140:60 from present 2994: 280 presents, frame p50 210.0 / p90 227.3 / p99 312.2 / max 327.1 ms, GPU busy 76.4 ms per present
NVIDIA GeForce RTX 4070, NVIDIA 621.01, Windows 10.0.26200, 1920x1080, commit b5e8d63b20cc, dropped: yes

{"commit":"b5e8d63b20cc","dirty":false,"env":{"APS5_DRAW_INPUTS_IN_PLACE":"1","APS5_DRAW_PIPELINE":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"140:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 621.01","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31892,"title_id":"PPSA31327","title":"Yakuza 0 Director's Cut","content_version":"01.015.000","resolution":"1920x1080","window":{"spec":"seconds 140:60","first_present":2994,"ms":60172.649},"presents":280,"frame_ms":{"p50":209.978,"p90":227.347,"p99":312.175,"max":327.108},"gpu_busy_ms_per_present":76.376,"worker_busy_pct":{"queue worker 0x0":98.155},"top_phases_ms_per_frame":{"Driver.Packet":210.788,"Graphics.Draw":183.394,"Driver.Packet.draw":179.783,"Driver.Draw":178.258,"Driver.DrawFinish":160.736,"Driver.Draw.prepare":150.34,"Graphics.Draw.draw_and_resource_release":149.14,"Driver.DrawFinish.shader_compile_and_link":110.619},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.229,"events_lost":3483105,"totals_full":false},"draw finisher":{"events_full_after_s":8.221,"events_lost":1702625,"totals_full":false},"draw committer":{"events_full_after_s":12.164,"events_lost":1055416,"totals_full":false}},"trace":"aps5-trace-b5e8d63b20cc-89144.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 3265: 327.1 ms at 57732 ms: batch (gpu) 85.1, VideoOut.Flip (presenter) 5.8, VideoOut.Flip.present (presenter) 5.6, Driver.Present (presenter) 5.6
  • present 3268: 321.8 ms at 58649 ms: batch (gpu) 88.0, VideoOut.Flip (presenter) 7.4, VideoOut.Flip.present (presenter) 7.3, Driver.Present (presenter) 7.3
  • present 3260: 312.2 ms at 56362 ms: batch (gpu) 75.5, VideoOut.Flip (presenter) 6.6, VideoOut.Flip.present (presenter) 6.4, Driver.Present (presenter) 6.4
  • present 3266: 300.5 ms at 58059 ms: batch (gpu) 80.6, VideoOut.Flip (presenter) 7.1, VideoOut.Flip.present (presenter) 6.9, Driver.Present (presenter) 6.9
  • present 3200: 299.0 ms at 43368 ms: batch (gpu) 78.4, VideoOut.Flip (presenter) 7.0, VideoOut.Flip.present (presenter) 6.6, Driver.Present (presenter) 6.6

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 214.9 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 9.7 (5 %) 0.0 (0 %) 205.2 20.6 Driver.Packet 9.7, Driver.EndSubmission 0.0
draw finisher 14.2 (7 %) 0.0 (0 %) 200.7 41.5 Driver.DrawFinish 14.2
draw committer 22.4 (10 %) 0.0 (0 %) 192.5 35.7 Graphics.Draw 21.5, Recorder.Submit 0.9
presenter 3.9 (2 %) 2.3 (1 %) 208.7 0.1 VideoOut.Flip 6.2, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 214.9 0.0
gpu 76.4 (36 %) 0.0 (0 %) 138.5 0.0 batch 76.4

Largest slices (ms per frame, inclusive, all threads): batch 76.4, Graphics.Draw 21.5, Graphics.Draw.draw_and_resource_release 14.9, Driver.DrawFinish 14.2, Driver.Packet 9.7, Driver.Packet.draw 8.2, Driver.Draw 8.1, Driver.DrawFinish.shader_compile_and_link 7.9, Driver.Draw.prepare 6.5, VideoOut.Flip 6.2

Longest waits

  • Driver.Present.render_fence_wait (presenter) 3.0 ms at 29803 ms, present 3136
  • Driver.Present.render_fence_wait (presenter) 2.8 ms at 54466 ms, present 3252
  • Driver.Present.render_fence_wait (presenter) 2.8 ms at 45662 ms, present 3210
  • Driver.Present.render_fence_wait (presenter) 2.8 ms at 30250 ms, present 3138
  • Driver.Present.render_fence_wait (presenter) 2.7 ms at 48775 ms, present 3225
  • Driver.Present.render_fence_wait (presenter) 2.7 ms at 54701 ms, present 3253
  • Driver.Present.render_fence_wait (presenter) 2.7 ms at 45017 ms, present 3207
  • Driver.Present.render_fence_wait (presenter) 2.7 ms at 56976 ms, present 3262
  • Driver.Present.render_fence_wait (presenter) 2.6 ms at 54227 ms, present 3251
  • Driver.Present.render_fence_wait (presenter) 2.6 ms at 58654 ms, present 3268

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 42557: 11.0 ms at 54446 ms, present 3251: GPU no ranges; recorded by no CPU slices
  • batch 42068: 10.9 ms at 53755 ms, present 3248: GPU no ranges; recorded by no CPU slices
  • batch 35125: 10.6 ms at 44997 ms, present 3206: GPU no ranges; recorded by no CPU slices
  • batch 43379: 10.6 ms at 55553 ms, present 3256: GPU no ranges; recorded by no CPU slices
  • batch 23433: 10.6 ms at 29783 ms, present 3135: GPU no ranges; recorded by no CPU slices
This change, commit 1d307e1e0

seconds 140:60 from present 3034: 315 presents, frame p50 190.0 / p90 198.8 / p99 206.4 / max 216.7 ms, GPU busy 69.3 ms per present
NVIDIA GeForce RTX 4070, NVIDIA 621.01, Windows 10.0.26200, 1920x1080, commit 1d307e1e0282, dropped: yes

{"commit":"1d307e1e0282","dirty":false,"env":{"APS5_DRAW_INPUTS_IN_PLACE":"1","APS5_DRAW_PIPELINE":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"140:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 621.01","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31892,"title_id":"PPSA31327","title":"Yakuza 0 Director's Cut","content_version":"01.015.000","resolution":"1920x1080","window":{"spec":"seconds 140:60","first_present":3034,"ms":60033.79},"presents":315,"frame_ms":{"p50":190.032,"p90":198.844,"p99":206.373,"max":216.711},"gpu_busy_ms_per_present":69.31,"worker_busy_pct":{"queue worker 0x0":98.118},"top_phases_ms_per_frame":{"Driver.Packet":186.916,"Driver.Packet.draw":157.677,"Graphics.Draw":157.572,"Driver.Draw":156.396,"Driver.DrawFinish":140.348,"Driver.Draw.prepare":130.889,"Graphics.Draw.draw_and_resource_release":127.694,"Driver.DrawFinish.shader_compile_and_link":99.737},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.258,"events_lost":3459324,"totals_full":false},"draw finisher":{"events_full_after_s":8.484,"events_lost":1623402,"totals_full":false},"draw committer":{"events_full_after_s":14.175,"events_lost":861186,"totals_full":false}},"trace":"aps5-trace-1d307e1e0282-105208.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 3077: 216.7 ms at 8290 ms: Driver.DrawFinish (draw finisher) 103.9, Graphics.Draw (draw committer) 102.9, Graphics.Draw.draw_and_resource_release (draw committer) 74.5, batch (gpu) 70.0
  • present 3191: 206.9 ms at 30313 ms: batch (gpu) 70.5, VideoOut.Flip (presenter) 5.7, VideoOut.Flip.present (presenter) 5.3, Driver.Present (presenter) 5.3
  • present 3108: 206.4 ms at 14309 ms: batch (gpu) 72.5, VideoOut.Flip (presenter) 6.1, VideoOut.Flip.present (presenter) 5.9, Driver.Present (presenter) 5.9
  • present 3178: 206.4 ms at 27812 ms: batch (gpu) 68.9, VideoOut.Flip (presenter) 5.4, VideoOut.Flip.present (presenter) 5.2, Driver.Present (presenter) 5.2
  • present 3125: 206.2 ms at 17590 ms: batch (gpu) 70.3, VideoOut.Flip (presenter) 5.7, VideoOut.Flip.present (presenter) 5.5, Driver.Present (presenter) 5.5

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 190.6 0.1 Shader.ResolveGraphicsAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 190.6 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
queue worker 0x0 8.3 (4 %) 0.0 (0 %) 182.2 19.6 Driver.Packet 8.3, Driver.EndSubmission 0.0
draw finisher 12.3 (6 %) 0.0 (0 %) 178.2 38.8 Driver.DrawFinish 12.3
draw committer 20.2 (11 %) 0.0 (0 %) 170.3 39.2 Graphics.Draw 19.2, Recorder.Submit 1.0
presenter 3.8 (2 %) 2.3 (1 %) 184.5 0.1 VideoOut.Flip 6.1, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 190.5 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 190.6 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 190.6 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 190.6 0.0 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 190.6 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 190.6 0.0
title 0.0 (0 %) 0.0 (0 %) 190.6 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 69.5 (36 %) 0.0 (0 %) 121.1 0.0 batch 69.5

Largest slices (ms per frame, inclusive, all threads): batch 69.5, Graphics.Draw 19.2, Graphics.Draw.draw_and_resource_release 13.5, Driver.DrawFinish 12.3, Driver.Packet 8.3, Driver.DrawFinish.shader_compile_and_link 7.3, Driver.Packet.draw 7.0, Driver.Draw 6.9, VideoOut.Flip 6.1, Driver.Present 5.9

Longest waits

  • Driver.Present.render_fence_wait (presenter) 2.6 ms at 57987 ms, present 3338
  • Driver.Present.render_fence_wait (presenter) 2.6 ms at 59096 ms, present 3344
  • Driver.Present.render_fence_wait (presenter) 2.6 ms at 55181 ms, present 3323
  • Driver.Present.render_fence_wait (presenter) 2.6 ms at 46778 ms, present 3278
  • Driver.Present.render_fence_wait (presenter) 2.5 ms at 48074 ms, present 3285
  • Driver.Present.render_fence_wait (presenter) 2.5 ms at 53135 ms, present 3312
  • Driver.Present.render_fence_wait (presenter) 2.5 ms at 58735 ms, present 3342
  • Driver.Present.render_fence_wait (presenter) 2.5 ms at 54064 ms, present 3317
  • Driver.Present.render_fence_wait (presenter) 2.5 ms at 45296 ms, present 3270
  • Driver.Present.render_fence_wait (presenter) 2.5 ms at 52768 ms, present 3310

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 6669: 9.3 ms at 8085 ms, present 3075: GPU no ranges; recorded by Recorder.Sync (draw committer) 9.9, Graphics.Draw (draw committer) 0.2, Graphics.Draw.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0
  • batch 25060: 9.2 ms at 30506 ms, present 3191: GPU no ranges; recorded by no CPU slices
  • batch 14291: 9.1 ms at 17385 ms, present 3123: GPU no ranges; recorded by no CPU slices
  • batch 39089: 9.1 ms at 47509 ms, present 3281: GPU no ranges; recorded by no CPU slices
  • batch 42011: 9.1 ms at 51075 ms, present 3300: GPU no ranges; recorded by no CPU slices

AI-assisted: yes
aps5-trace-1d307e1e0282-105208.json.gz

aps5-trace-b5e8d63b20cc-89144.json.gz

@johandavidcm

Copy link
Copy Markdown
Contributor Author

@panicDa3m0n thank you for checking it against #9712; writing the moved words straight into the resizable BAR chunk is exactly where this should end up, and this path only writes the slice. Either order works for me as well: whichever lands second keeps both test names on that set_tests_properties line.

@ycbuzi

ycbuzi commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

A Windows run of 29c9624db5 with the AMD iGPU and an older NVIDIA card added, to go with your RTX 4070: Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, merged onto main 1fd64318f3 with no conflicts. The 126 tests built from agc_driver_graphics_tests and agc_driver_recorder_tests, including the new agc_moved_word_upload. One GPU at a time with ANYPS5_GPU, plus ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, run with ctest -V --repeat until-fail:2. Each log's Vulkan device: line names the device.

device result
GeForce RTX 4070 SUPER (0x2783), NVIDIA 616.92 125 of 126
GeForce GTX 1650 SUPER (0x2187), NVIDIA 616.92 125 of 126
AMD Radeon(TM) Graphics (1002:164e, RDNA2 iGPU), AMD 32.0.21030.2001 125 of 126
  • The one failure on every device is agc_host_import_cut_lifetime, the larger side of an unmap of 1440 KiB at the start of the import's first 2 MiB run left the write watch. That's agc_host_import_cut_lifetime fails on Windows since the merge of #9159 #10746, which fails the same way on main on Windows. agc_moved_word_upload passes everywhere.
  • Control with main's ShaderResources.cpp: agc_moved_word_upload fails on the 4070 with two draws with moved words got a buffer each instead of slices of the recorder's draw upload chunk.
  • Build warnings: only main's known PipelineLibrary.cpp pair.

AI-assisted: yes (Claude Code)

@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.

I reviewed exact head 29c9624db5ee20768914e4011865299466cf504d and the new performance evidence. I withdraw my earlier request for missing capture data. I downloaded both attached pair-2 traces and independently ran tools/trace_digest.py with their posted summary lines. The base trace reports 280 presents and p50 209.978 ms; the change trace reports 315 presents and p50 190.032 ms. Both digests match the posted capture windows and expose trace_dropped: true; the full-window summary metrics remain available, while event-level details are incomplete as the report discloses. The four alternating pairs and same-machine/title/scene controls are documented. I found no implementation defect in the moved-word upload change.

The remaining repository-rule update is branch freshness: the tested base/head are on 7903201bb426, while current main is b0f1183ca12b. The merge-tree preview is clean, and main has made no AGC runtime or test changes since the tested base. Please sync to current main and let the required checks rerun; the captured comparison remains relevant because those intervening commits do not touch the changed AGC paths.

A draw that hits a template whose read-only guest buffers moved binds
the moved words through an override buffer that PrepareDrawBindings
created on every such draw, keeping at most eight in movedWordBuffers.
In Yakuza 0 (PPSA31327) 80,000 of 390,000 draws per 10 s take that path,
so the committer created a Vulkan buffer per draw for a fifth of its
draws: about 4 % of the committer in a sampled profile.

An override of at most APS5_DRAW_UPLOAD_MAX bytes now takes a slice of
the recorder's draw upload chunk, as the small snapshot uploads do: the
words and the data patches are copied into the slice and the descriptor
points at the chunk with the slice's offset. Larger overrides keep the
buffer per draw. APS5_NO_MOVED_WORD_UPLOAD keeps every override in a
buffer of its own.
@johandavidcm
johandavidcm force-pushed the perf/agc-moved-word-upload branch from 29c9624 to d4b86f8 Compare October 26, 2026 18:37
@johandavidcm

Copy link
Copy Markdown
Contributor Author

@MarcZX10 synced: rebased onto main f95acfc, head is now d4b86f8, the same patch. Since the tested base, main changed libSceAgcDriver only in Execution/src/Driver/Packets/PacketExecution.cpp (two lines), tests/MaskedSelect.cpp and tests/Pm4.cpp, none of them on the moved-word path, so the pair-2 captures stand. On the new head, with the validation layer inserted (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer): agc_moved_word_upload passes 20 times in a row, and the focused set passes on main f95acfc (17 of 17) and on the head (18 of 18); neither log has a missing-layer message or a VUID- line. The description's head and base are updated.

@ycbuzi thank you for the three-GPU run and the control.

AI-assisted: yes

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 27, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

#11142 (merged today) already copies moved draw words into the draw upload ring, without the 4 KiB cap, the eight-slot cache or the opt-out switch. This branch now conflicts with main in ShaderResources.cpp and both tests.

Could you close it, or reduce it to what main still lacks (for example the agc_moved_word_upload test) and explain why the cap and the switch are still wanted?

This branch has not been deployed

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

Labels

agc libSceAgc* build docs needs rebase Conflicts with main, rebase needed perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants