perf(shader): emit vertex modules specialized instead of in registration form #14265

Merged
Astronaut10 merged 2 commits from upstream-pr/14265 into main 2026-11-04 19:18:18 +00:00
Astronaut10 commented 2026-11-01 05:17:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Astronaut10 on 2026-11-01T05:17:23Z.


What

On devices with graphics pipeline libraries, vertex and pixel artifacts are emitted in registration form so that their libraries can be prebuilt at registration with a default state. For the vertex stage this form costs GPU time on every vertex: each vertex attribute reads its component selectors, and each buffer load the V# stride and swizzle (and the format and bounds mode when the load does not take the descriptor's format, descriptor and formattedCall in SpirvRuntimeBuffer.cpp), from the shader data at run time, where a specialized module has them as constants.

This emits vertex artifacts specialized from the start, as the existing fallback above registrationWordLimit already does. Pixel artifacts keep registration form, and nothing else changes (GPL, the set-1 pixel layout, fixed push slots, the pixel word limit). docs/dev/ARCHITECTURE.md and the two technical debt entries on registration modules (debt/shader.md, debt/libSceAgcDriver.md) now describe pixel modules only.

Tests: the prepared graphics, vertex fetch and zero-stride fetch tests asserted a vertex registration module and now expect a specialized one; their rendering checks are unchanged. agc_driver_gcn_buffer_format_lookup and agc_formatted_buffer_once checked registration-form buffer code through a vertex shader; they now compile the same loads and stores as a pixel shader, which keeps registration form and shares that code, and agc_formatted_buffer_once also checks that each module has the form it was compiled for. Both still fail when the change they guard is undone: with the former private GCN format table (50e9cc4021 reverted) and with a formatted V#'s format word read at run time in registration modules.

Cost: a vertex stage's pre-rasterization library is no longer prebuilt at registration; it is built at its first draw. Counted with a build-origin counter (a local diagnostic, not part of this PR) on an older base (main 27ad7244d2 with other changes) in a cold boot of the scene below: 19 more pre-rasterization libraries built at the draw after the level started (+0.7 s of draw-thread time, no added stall frame) and 80 fewer prebuilt. Warm boots built no library at the draw on either side, because the pipeline journal replays them. These counts were not repeated on current main.

Relation to #9508: with its opt-in APS5_GPU_HEAP, PreparedShaderInvocation::MaterializeHeap only takes artifacts in registration form, so under that switch vertex stages leave the heap path for the per-draw path; #7642, #10193, #13928 and #13929 carry the same check. With the switch off, the default, nothing changes. For context only, not this PR's measurement: an earlier prototype run on an older #9508-based base with the heap on found this change 1.6 % slower in the same scene (95 % -2.2 to -1.0 %).

The vertex half of the registration ABI (the vertex component selector state and its emission, and the pre-rasterization prebuild from a vertex registration result) becomes unreachable; this PR leaves it, and removing it is a follow-up.

Tested

CachyOS (Linux 7.3), Ryzen 7 5700X3D, RX 9070 XT (RADV, Mesa 26.2.5, GPU clock level forced to high), 3840x2160. PPSA21564 (ASTRO BOT 01.007.000), started into underwater_aerial_garden with -lvl, standing at the spawn with no input, warm caches (each side ran the scene before; the change needs its own shader cache).

Base: main 029463ceb6; change: this branch at c46f7afcbe, measured before it was rebased onto main 3ab5a11d66 without conflicts (the same diff; rebuilt and its focused tests rerun after the rebase). Plain main needs a larger host-import budget than its default to run this scene at a usable rate, so both sides set APS5_HOST_IMPORT_MIB=11815. Switches on both: APS5_DEPTH_PLANE_COPY_MIB=512 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_NO_PAD_INPUT=1 APS5_HOST_IMPORT_MIB=11815.

Clean runs, each measured from 40 s to 130 s after the level started, in the order A B B A B A A B, four per side, no run excluded; FPS from every frame of that window:

A: main B: this PR change
FPS per run 3.067 / 3.114 / 3.094 / 3.103 3.123 / 3.121 / 3.155 / 3.188
FPS mean 3.095 3.147 +1.7 % (95 % +0.1 to +3.2 %)
GPU busy ms per present 165.2 154.4 -6.6 % (95 % -6.9 to -6.2 %)
Driver.Draw.prepare ms per frame 182.7 178.9 -2.1 % (95 % -3.8 to -0.4 %)
frames, p50 / p95 / p99 ms 1133, 320.2 / 330.5 / 341.0 1147, 313.1 / 323.7 / 343.1
frames > 500 ms / > 1 s 8 / 4 8 / 5
longest frame per run, ms 1223 / 1186 / 1089 / 1143 1469 / 1493 / 1300 / 890

The GPU saves 10.8 ms per present, and every B run is faster than the A run next to it. The frame is bound by the CPU chain (queue worker 0x0 is about 87 % busy in both traces), so FPS gains less than the GPU time. Every run has one long frame about 86 s after the level started, when the title starts a video; B's was longer in three of four runs (mean 1,288 against 1,160 ms), which four runs do not separate from noise.

Summary lines of the attached traces, captured as the Performance report form describes (no other APS5_TRACE_* or APS5_PROFILE_* switch; the runner reads the log through a pipe on both sides). The window is 4 s, 40 s after the level started, so the queue worker's default event buffer does not fill; 13 presents are too few to compare frame times, which the clean runs above do:

{"commit":"029463ceb62c","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"54:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 54:4","first_present":396,"ms":4091.873},"presents":13,"frame_ms":{"p50":313.480,"p90":323.816,"p99":327.700,"max":327.700},"gpu_busy_ms_per_present":162.331,"worker_busy_pct":{"queue worker 0x0":97.823,"queue worker 0x40":93.354,"queue worker 0x48":92.766,"queue worker 0x46":0.844},"top_phases_ms_per_frame":{"Driver.Packet":894.282,"Driver.Packet.memory_wait":547.449,"Driver.Packet.draw":218.571,"Driver.Draw":217.699,"Graphics.Draw":189.075,"Driver.DrawFinish":185.819,"Driver.Draw.prepare":182.671,"Graphics.Draw.draw_and_resource_release":154.825},"trace_dropped":false,"trace":"aps5-trace-029463ceb62c-608475.json.gz"}
{"commit":"c46f7afcbe28","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"53:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 53:4","first_present":383,"ms":4103.363},"presents":13,"frame_ms":{"p50":316.082,"p90":319.354,"p99":320.501,"max":320.501},"gpu_busy_ms_per_present":150.819,"worker_busy_pct":{"queue worker 0x0":97.909,"queue worker 0x40":93.641,"queue worker 0x48":92.718,"queue worker 0x46":0.787},"top_phases_ms_per_frame":{"Driver.Packet":897.753,"Driver.Packet.memory_wait":558.041,"Driver.Packet.draw":218.618,"Driver.Draw":217.730,"Graphics.Draw":191.412,"Driver.DrawFinish":184.260,"Driver.Draw.prepare":181.700,"Graphics.Draw.draw_and_resource_release":157.036},"trace_dropped":false,"trace":"aps5-trace-c46f7afcbe28-608774.json.gz"}

tools/trace_digest.py: main 13 presents, frame p50 313.5 / p99 327.7 ms, GPU busy 162.3 ms per present (gpu track 163.4 ms per frame); this PR 13 presents, frame p50 316.1 / p99 320.5 ms, GPU busy 150.8 ms per present (gpu track 151.3 ms per frame), dropped: no on both.

A frame dump of the scene (APS5_DUMP_FRAMES) on both sides shows the same image, apart from the animation phase.

Validation: the 129 tests of -R 'agc_.*(vertex|prepared_graphics|registration|pipeline_library|formatted_buffer|buffer_descriptor|graphics|draw|gcn_buffer_format|prepared_exports|image_plane|stencil_null)' with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and ctest -V, on main (029463ceb6) and on this branch: 129 of 129 pass on both, neither log reports the layer missing, and the validation messages are identical: the same 10 VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 errors in agc_driver_prepared_exports on both sides, 30 layerCount-compatibility and 16 ShaderOutputNotConsumed warnings; this PR adds none. The full suite (ctest, 3,100 tests, ANYPS5_REQUIRE_VULKAN=1) passes apart from agc_driver_tessellation (a crash inside RADV) and agc_idle_publish_wait, which fail on main as well.

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
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.5, Linux 7.3 (CachyOS)
  • AI-assisted: yes

aps5-trace-029463ceb62c-608475.json.gz
aps5-trace-c46f7afcbe28-608774.json.gz

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5104634608 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14265). Originally posted by [Astronaut10](https://github.com/Astronaut10) on 2026-11-01T05:17:23Z. --- ### What On devices with graphics pipeline libraries, vertex and pixel artifacts are emitted in registration form so that their libraries can be prebuilt at registration with a default state. For the vertex stage this form costs GPU time on every vertex: each vertex attribute reads its component selectors, and each buffer load the V# stride and swizzle (and the format and bounds mode when the load does not take the descriptor's format, `descriptor` and `formattedCall` in `SpirvRuntimeBuffer.cpp`), from the shader data at run time, where a specialized module has them as constants. This emits vertex artifacts specialized from the start, as the existing fallback above `registrationWordLimit` already does. Pixel artifacts keep registration form, and nothing else changes (GPL, the set-1 pixel layout, fixed push slots, the pixel word limit). `docs/dev/ARCHITECTURE.md` and the two technical debt entries on registration modules (`debt/shader.md`, `debt/libSceAgcDriver.md`) now describe pixel modules only. Tests: the prepared graphics, vertex fetch and zero-stride fetch tests asserted a vertex registration module and now expect a specialized one; their rendering checks are unchanged. `agc_driver_gcn_buffer_format_lookup` and `agc_formatted_buffer_once` checked registration-form buffer code through a vertex shader; they now compile the same loads and stores as a pixel shader, which keeps registration form and shares that code, and `agc_formatted_buffer_once` also checks that each module has the form it was compiled for. Both still fail when the change they guard is undone: with the former private GCN format table (`50e9cc4021` reverted) and with a formatted V#'s format word read at run time in registration modules. Cost: a vertex stage's pre-rasterization library is no longer prebuilt at registration; it is built at its first draw. Counted with a build-origin counter (a local diagnostic, not part of this PR) on an older base (`main` `27ad7244d2` with other changes) in a cold boot of the scene below: 19 more pre-rasterization libraries built at the draw after the level started (+0.7 s of draw-thread time, no added stall frame) and 80 fewer prebuilt. Warm boots built no library at the draw on either side, because the pipeline journal replays them. These counts were not repeated on current `main`. Relation to #9508: with its opt-in `APS5_GPU_HEAP`, `PreparedShaderInvocation::MaterializeHeap` only takes artifacts in registration form, so under that switch vertex stages leave the heap path for the per-draw path; #7642, #10193, #13928 and #13929 carry the same check. With the switch off, the default, nothing changes. For context only, not this PR's measurement: an earlier prototype run on an older #9508-based base with the heap on found this change 1.6 % slower in the same scene (95 % -2.2 to -1.0 %). The vertex half of the registration ABI (the vertex component selector state and its emission, and the pre-rasterization prebuild from a vertex registration result) becomes unreachable; this PR leaves it, and removing it is a follow-up. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> CachyOS (Linux 7.3), Ryzen 7 5700X3D, RX 9070 XT (RADV, Mesa 26.2.5, GPU clock level forced to `high`), 3840x2160. PPSA21564 (ASTRO BOT 01.007.000), started into `underwater_aerial_garden` with `-lvl`, standing at the spawn with no input, warm caches (each side ran the scene before; the change needs its own shader cache). Base: `main` `029463ceb6`; change: this branch at `c46f7afcbe`, measured before it was rebased onto `main` `3ab5a11d66` without conflicts (the same diff; rebuilt and its focused tests rerun after the rebase). Plain `main` needs a larger host-import budget than its default to run this scene at a usable rate, so both sides set `APS5_HOST_IMPORT_MIB=11815`. Switches on both: `APS5_DEPTH_PLANE_COPY_MIB=512 APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_NO_PAD_INPUT=1 APS5_HOST_IMPORT_MIB=11815`. Clean runs, each measured from 40 s to 130 s after the level started, in the order A B B A B A A B, four per side, no run excluded; FPS from every frame of that window: | | A: `main` | B: this PR | change | | --- | --- | --- | --- | | FPS per run | 3.067 / 3.114 / 3.094 / 3.103 | 3.123 / 3.121 / 3.155 / 3.188 | | | FPS mean | 3.095 | 3.147 | +1.7 % (95 % +0.1 to +3.2 %) | | GPU busy ms per present | 165.2 | 154.4 | -6.6 % (95 % -6.9 to -6.2 %) | | `Driver.Draw.prepare` ms per frame | 182.7 | 178.9 | -2.1 % (95 % -3.8 to -0.4 %) | | frames, p50 / p95 / p99 ms | 1133, 320.2 / 330.5 / 341.0 | 1147, 313.1 / 323.7 / 343.1 | | | frames > 500 ms / > 1 s | 8 / 4 | 8 / 5 | | | longest frame per run, ms | 1223 / 1186 / 1089 / 1143 | 1469 / 1493 / 1300 / 890 | | The GPU saves 10.8 ms per present, and every B run is faster than the A run next to it. The frame is bound by the CPU chain (queue worker `0x0` is about 87 % busy in both traces), so FPS gains less than the GPU time. Every run has one long frame about 86 s after the level started, when the title starts a video; B's was longer in three of four runs (mean 1,288 against 1,160 ms), which four runs do not separate from noise. Summary lines of the attached traces, captured as the Performance report form describes (no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch; the runner reads the log through a pipe on both sides). The window is 4 s, 40 s after the level started, so the queue worker's default event buffer does not fill; 13 presents are too few to compare frame times, which the clean runs above do: ```json {"commit":"029463ceb62c","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"54:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 54:4","first_present":396,"ms":4091.873},"presents":13,"frame_ms":{"p50":313.480,"p90":323.816,"p99":327.700,"max":327.700},"gpu_busy_ms_per_present":162.331,"worker_busy_pct":{"queue worker 0x0":97.823,"queue worker 0x40":93.354,"queue worker 0x48":92.766,"queue worker 0x46":0.844},"top_phases_ms_per_frame":{"Driver.Packet":894.282,"Driver.Packet.memory_wait":547.449,"Driver.Packet.draw":218.571,"Driver.Draw":217.699,"Graphics.Draw":189.075,"Driver.DrawFinish":185.819,"Driver.Draw.prepare":182.671,"Graphics.Draw.draw_and_resource_release":154.825},"trace_dropped":false,"trace":"aps5-trace-029463ceb62c-608475.json.gz"} {"commit":"c46f7afcbe28","dirty":false,"env":{"APS5_DEPTH_PLANE_COPY_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_HOST_IMPORT_MIB":"11815","APS5_NO_PAD_INPUT":"1","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"53:4"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.0-4-cachyos","cpu":"AMD Ryzen 7 5700X3D 8-Core Processor","cpu_threads":16,"memory_mib":31992,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 53:4","first_present":383,"ms":4103.363},"presents":13,"frame_ms":{"p50":316.082,"p90":319.354,"p99":320.501,"max":320.501},"gpu_busy_ms_per_present":150.819,"worker_busy_pct":{"queue worker 0x0":97.909,"queue worker 0x40":93.641,"queue worker 0x48":92.718,"queue worker 0x46":0.787},"top_phases_ms_per_frame":{"Driver.Packet":897.753,"Driver.Packet.memory_wait":558.041,"Driver.Packet.draw":218.618,"Driver.Draw":217.730,"Graphics.Draw":191.412,"Driver.DrawFinish":184.260,"Driver.Draw.prepare":181.700,"Graphics.Draw.draw_and_resource_release":157.036},"trace_dropped":false,"trace":"aps5-trace-c46f7afcbe28-608774.json.gz"} ``` `tools/trace_digest.py`: `main` 13 presents, frame p50 313.5 / p99 327.7 ms, GPU busy 162.3 ms per present (`gpu` track 163.4 ms per frame); this PR 13 presents, frame p50 316.1 / p99 320.5 ms, GPU busy 150.8 ms per present (`gpu` track 151.3 ms per frame), `dropped: no` on both. A frame dump of the scene (`APS5_DUMP_FRAMES`) on both sides shows the same image, apart from the animation phase. Validation: the 129 tests of `-R 'agc_.*(vertex|prepared_graphics|registration|pipeline_library|formatted_buffer|buffer_descriptor|graphics|draw|gcn_buffer_format|prepared_exports|image_plane|stencil_null)'` with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `ctest -V`, on `main` (`029463ceb6`) and on this branch: 129 of 129 pass on both, neither log reports the layer missing, and the validation messages are identical: the same 10 `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605` errors in `agc_driver_prepared_exports` on both sides, 30 `layerCount-compatibility` and 16 `ShaderOutputNotConsumed` warnings; this PR adds none. The full suite (`ctest`, 3,100 tests, `ANYPS5_REQUIRE_VULKAN=1`) passes apart from `agc_driver_tessellation` (a crash inside RADV) and `agc_idle_publish_wait`, which fail on `main` as well. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.5, Linux 7.3 (CachyOS) - [x] AI-assisted: yes [aps5-trace-029463ceb62c-608475.json.gz](https://github.com/user-attachments/files/34231981/aps5-trace-029463ceb62c-608475.json.gz) [aps5-trace-c46f7afcbe28-608774.json.gz](https://github.com/user-attachments/files/34231982/aps5-trace-c46f7afcbe28-608774.json.gz) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CnRJay commented 2026-11-01 19:42:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:42:47Z.

Review: COMMENTED


The GPU saving is clear (165.2 to 154.4 ms per present on a 9070 XT / RADV, every B run ahead of its neighbouring A run), and removing per-vertex descriptor reads is the right target. The cost side is stated but not measured on a cold start, which is where it lands.

1. The pre-rasterization library moves from registration to the first draw. On a cold pipeline journal each vertex stage's library is now compiled by the draw thread when it is first drawn, where today it is built at registration on a worker. The description counts 19 more libraries built at the draw after the level started (+0.7 s of draw-thread time) on an older base, "no added stall frame", and says the counts were not repeated on current main. 0.7 s is the sum, but each library is a separate compile on the thread that bounds the frame, so a cold first-run player gets a hitch per new vertex shader. Please report the longest frame and the number of frames over 100 ms in a cold boot of the same scene, main against this change, from tools/trace_digest.py. The warm numbers hide this, because the journal replays the libraries.

2. The longest frame is already longer on B in three of four warm runs (mean 1,288 against 1,160 ms around the video start). The description puts that down to noise. Four runs cannot separate it, which cuts both ways. Please add runs, or take the frame after the video start out of both comparisons, and say which.

3. APS5_GPU_HEAP regresses. The description notes that an earlier prototype found this change 1.6 % slower with the heap on, and that vertex stages leave the heap path. The heap is opt-in today, but #9508, #7642, #10193, #13928 and #13929 all carry that path. Say which of those landing first changes the answer. Specialized vertex modules and the heap pull in opposite directions: one specializes per draw state, the other shares modules across it.

4. Module count. A specialized module per vertex layout means more distinct SPIR-V and pipeline variants than the registration form, which has one. Please give the number of distinct vertex modules on the scene, before and after, since it drives shader cache size and cold compile time.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729898135 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14265#pullrequestreview-5729898135). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:42:47Z. **Review:** COMMENTED --- The GPU saving is clear (165.2 to 154.4 ms per present on a 9070 XT / RADV, every B run ahead of its neighbouring A run), and removing per-vertex descriptor reads is the right target. The cost side is stated but not measured on a cold start, which is where it lands. **1. The pre-rasterization library moves from registration to the first draw.** On a cold pipeline journal each vertex stage's library is now compiled by the draw thread when it is first drawn, where today it is built at registration on a worker. The description counts 19 more libraries built at the draw after the level started (+0.7 s of draw-thread time) on an older base, "no added stall frame", and says the counts were not repeated on current `main`. 0.7 s is the sum, but each library is a separate compile on the thread that bounds the frame, so a cold first-run player gets a hitch per new vertex shader. Please report the longest frame and the number of frames over 100 ms in a cold boot of the same scene, `main` against this change, from `tools/trace_digest.py`. The warm numbers hide this, because the journal replays the libraries. **2. The longest frame is already longer on B in three of four warm runs** (mean 1,288 against 1,160 ms around the video start). The description puts that down to noise. Four runs cannot separate it, which cuts both ways. Please add runs, or take the frame after the video start out of both comparisons, and say which. **3. `APS5_GPU_HEAP` regresses.** The description notes that an earlier prototype found this change 1.6 % slower with the heap on, and that vertex stages leave the heap path. The heap is opt-in today, but #9508, #7642, #10193, #13928 and #13929 all carry that path. Say which of those landing first changes the answer. Specialized vertex modules and the heap pull in opposite directions: one specializes per draw state, the other shares modules across it. **4. Module count.** A specialized module per vertex layout means more distinct SPIR-V and pipeline variants than the registration form, which has one. Please give the number of distinct vertex modules on the scene, before and after, since it drives shader cache size and cold compile time.
MarcZX10 commented 2026-11-02 07:00:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T07:00:55Z.

Review: COMMENTED


Reviewed — CI is red on the merged build, for the same base-code reason as #14264

The shader change emits vertex modules specialised instead of in registration form. The hosted relinker jobs fail on this head. The Ubuntu relinker job fails only on check_skips_ctest, which fails in base code: the same failure is on #14264, and both share base 7fad6837. The shader change itself was not read in this pass, so this review says nothing about its correctness.

What I ran

  • Head 9dfce2d76f9a734474e7e8c19097b3ca8c6b191d; base 7fad6837767a4f0cb1636ff835cd42522aae8fac. The changed files are shader and libSceAgcDriver test files (FormattedBufferOnce.cpp, GcnBufferFormatLookup.cpp, PreparedGraphics.cpp, VertexFetch.cpp, and others in tests/), plus the production shader files.
  • Hosted: the Ubuntu relinker job (job 125007976445) fails with one case, check_skips_ctest (Test #63, 1 of 557 failed). That is the same assertion failure as #14264: test_notrun_without_ctest_skip_marker_is_rejected expects a ValueError the base check_skips.py does not raise. The macOS (clang++ and x86_64) and Windows relinker jobs also fail; their logs were not read.
  • Checked: tools/check_skips.py and its test have the same blob at the base and at this head, and this PR does not change them.
  • Hosted: the Windows CTest run for this head executed one case (100% tests passed, 0 tests failed out of 1).
  • Read-only checks from the trusted main checkout: diff check and the stack check passed (no declared dependencies, no errors). Conventions passed with one warning. The ABI audit is not applicable.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed, with one warning the warning is not identified in this pass
Mergeability and dependencies passed stack check passed; no declared dependencies; no errors
check_skips_ctest (hosted, Ubuntu relinker) failed fails in base code, as on #14264; this PR does not touch the file
The other relinker jobs (macOS, Windows) failed logs not read
The shader change (ShaderTable, vertex module emission) not read not reviewed in this pass
Windows CTest (1 case) passed the shader tests did not run in that CTest selection
Linux build and runtime tests not run Linux is skipped on pull requests
Negative controls not run no local build
Hosted CI failed (relinkers) conventions, eligibility, labels, library-portability, report and relinker-asan succeeded
Read-only check output

Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed, one warning. ABI audit: not applicable. Stack check: passed, no errors. Hosted: gh api repos/boykopovar/AnyPS5/commits/9dfce2d76f9a734474e7e8c19097b3ca8c6b191d/check-runs, and the Ubuntu relinker job log (125007976445).

Negative control

Not run here. A negative control needs a local build, and code from this head is not run here.

Findings

Blocking

  • The hosted relinker jobs are red. The Ubuntu job fails in base code (check_skips_ctest) that this PR does not change. The base needs the fix first; see #14264, which has the same failure.

Non-blocking

  • The shader change itself was not read in this pass, so there is no verdict on its correctness.

Sources

Not verified

  • The shader change and its tests.
  • The macOS and Windows relinker failures (logs not read).
  • The conventions warning's content.

To get this to a good state

  • Fix check_skips_ctest on the base (see #14264), then re-run this head's relinker jobs.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5733037948 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14265#pullrequestreview-5733037948). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T07:00:55Z. **Review:** COMMENTED --- # Reviewed — CI is red on the merged build, for the same base-code reason as #14264 The shader change emits vertex modules specialised instead of in registration form. The hosted relinker jobs fail on this head. The Ubuntu relinker job fails only on `check_skips_ctest`, which fails in base code: the same failure is on #14264, and both share base `7fad6837`. The shader change itself was not read in this pass, so this review says nothing about its correctness. ## What I ran - Head `9dfce2d76f9a734474e7e8c19097b3ca8c6b191d`; base `7fad6837767a4f0cb1636ff835cd42522aae8fac`. The changed files are shader and libSceAgcDriver test files (`FormattedBufferOnce.cpp`, `GcnBufferFormatLookup.cpp`, `PreparedGraphics.cpp`, `VertexFetch.cpp`, and others in `tests/`), plus the production shader files. - Hosted: the Ubuntu relinker job (job 125007976445) fails with one case, `check_skips_ctest` (`Test #63`, 1 of 557 failed). That is the same assertion failure as #14264: `test_notrun_without_ctest_skip_marker_is_rejected` expects a `ValueError` the base `check_skips.py` does not raise. The macOS (clang++ and x86_64) and Windows relinker jobs also fail; their logs were not read. - Checked: `tools/check_skips.py` and its test have the same blob at the base and at this head, and this PR does not change them. - Hosted: the Windows CTest run for this head executed one case (`100% tests passed, 0 tests failed out of 1`). - Read-only checks from the trusted main checkout: diff check and the stack check passed (no declared dependencies, no errors). Conventions passed with one warning. The ABI audit is not applicable. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed, with one warning | the warning is not identified in this pass | | Mergeability and dependencies | passed | stack check passed; no declared dependencies; no errors | | `check_skips_ctest` (hosted, Ubuntu relinker) | failed | fails in base code, as on #14264; this PR does not touch the file | | The other relinker jobs (macOS, Windows) | failed | logs not read | | The shader change (`ShaderTable`, vertex module emission) | not read | not reviewed in this pass | | Windows CTest (1 case) | passed | the shader tests did not run in that CTest selection | | Linux build and runtime tests | not run | Linux is skipped on pull requests | | Negative controls | not run | no local build | | Hosted CI | failed (relinkers) | conventions, eligibility, labels, library-portability, report and relinker-asan succeeded | <details><summary>Read-only check output</summary> Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed, one warning. ABI audit: not applicable. Stack check: passed, no errors. Hosted: `gh api repos/boykopovar/AnyPS5/commits/9dfce2d76f9a734474e7e8c19097b3ca8c6b191d/check-runs`, and the Ubuntu relinker job log (125007976445). </details> ## Negative control Not run here. A negative control needs a local build, and code from this head is not run here. ## Findings **Blocking** - The hosted relinker jobs are red. The Ubuntu job fails in base code (`check_skips_ctest`) that this PR does not change. The base needs the fix first; see #14264, which has the same failure. **Non-blocking** - The shader change itself was not read in this pass, so there is no verdict on its correctness. ## Sources - Ubuntu relinker job: 125007976445 (`check_skips_ctest`) - Test: https://github.com/boykopovar/AnyPS5/blob/9dfce2d76f9a734474e7e8c19097b3ca8c6b191d/tools/tests/test_check_skips_ctest.py - Same failure on #14264: https://github.com/boykopovar/AnyPS5/pull/14264 ## Not verified - The shader change and its tests. - The macOS and Windows relinker failures (logs not read). - The conventions warning's content. ## To get this to a good state - Fix `check_skips_ctest` on the base (see #14264), then re-run this head's relinker jobs.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14265
No description provided.