perf(agc): key shader pipeline libraries only by the state their subset reads #23229

Merged
chitters2004 merged 9 commits from upstream-pr/23229 into main 2026-11-20 10:00:25 +00:00
chitters2004 commented 2026-11-18 20:36:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-11-18T20:36:50Z.


What

Shader pipeline libraries were keyed on more state than they read, so the same shaders were compiled again whenever a draw changed something that only the output or vertex-input part uses.

  • Pre-rasterization and fragment shader libraries take only viewMask from the rendering info. They now pass VK_FORMAT_UNDEFINED depth and stencil formats and key without them. The fragment library takes a null multisample state unless the pipeline enables sample shading, or a fragment shader reads SampleId, SamplePosition or a Sample-decorated input.
  • With VK_EXT_extended_dynamic_state2, the depth bias enable is a dynamic state set at bind and leaves the pre-rasterization key. The bias values were already dynamic, and they are zero when bias is off.
  • APS5_WIDE_LIBRARY_KEYS=1 restores the old keys and APS5_NO_DYNAMIC_DEPTH_BIAS_ENABLE=1 keeps the enable baked, so both can be compared within one build. The pipeline store key carries the mode, and both switches are in docs/dev/ENVIRONMENT.md.

Tested

All runs: RTX 3080, NVIDIA 621.24, Windows 11 (10.0.26320), Ryzen 7 5800X, 3840x2160.

GTA V (PPSA04263 01.011.001), warm boots, main vs this PR (nkp). One CLEAN boot per arm on the same machine, city scene (Franklin's house save), with caches warmed by one untimed boot per build. Only APS5_TRACE_SECONDS=92:30 was set for the window (from the moment the player stands still + 20 s, 30 s long); the other variables in the lines are the harness's (trace paths, pad input, address copy limit). Both arms run with the draw pipeline on (APS5_DRAW_PIPELINE=1, APS5_PIPELINED_DRAWS=32, APS5_PIPELINE_DISPATCH=1), which is how we measure GTA; main ships it off and this PR doesn't touch it. The commits in the lines are lab merges: da3b9f12dd29 is main 806e2140a9 plus #20845 and #14561, which GTA needs to reach gameplay, and a813ef9699a9 is that plus exactly this PR's diff (same patch-id). Defender real-time protection was on.

frame p50 ms p90 ms p99 ms presents GPU busy ms/present
main 111.8 130.4 255.8 251 27.7
this PR 113.6 134.8 286.6 247 28.3

No regression: the difference is within this scene's boot-to-boot spread. In an earlier set on the same scene and mode, two CLEAN boots of one main build measured 112.5 and 119.7 ms p50. The change only affects how pipeline libraries are keyed, so a warm steady state is not expected to move; time in Vulkan.GraphicsPipelineLibrary in the window was 1,109 ms on main and 1,001 ms with this PR, from one boot each.

aps5-summary.jsonl window lines, main then this PR
{"commit":"da3b9f12dd29","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1650,"ms":30074.799},"presents":251,"frame_ms":{"p50":111.759,"p90":130.376,"p99":255.777,"max":277.752},"gpu_busy_ms_per_present":27.664,"worker_busy_pct":{"queue worker 0x0":93.920},"phase_totals_ms":{"Driver.Completion":0.137,"Driver.Dispatch":1950.591,"Driver.Dispatch.capture_resources":12.979,"Driver.Dispatch.decode_key_device_setup":25.981,"Driver.Dispatch.lookup_cache":218.556,"Driver.Dispatch.materialize":1.993,"Driver.Dispatch.prepared_invocation":83.055,"Driver.Draw":20299.185,"Driver.Draw.device_setup":701.404,"Driver.Draw.draw_handed_off":2494.170,"Driver.Draw.prepare":17015.326,"Driver.DrawFinish":19783.845,"Driver.DrawFinish.draw_enqueued":9636.073,"Driver.DrawFinish.post_compile_prepare":271.114,"Driver.DrawFinish.shader_compile_and_link":9729.459,"Driver.EndSubmission":371.809,"Driver.Packet":26780.400,"Driver.Packet.device_lock":208.160,"Driver.Packet.dispatch":1959.369,"Driver.Packet.draw":20449.949,"Driver.Packet.execute":1871.887,"Driver.Packet.flip_flush":8.650,"Driver.Packet.flush_between_packets":500.339,"Driver.Packet.memory_wait":4.739,"Driver.Packet.pipeline_drain":420.736,"Driver.Packet.pipeline_prepare":297.681,"Driver.Packet.prepare_memory":265.243,"Driver.Packet.rendering_wait":0.171,"Driver.Present":1540.875,"Driver.Present.acquire_image":3.599,"Driver.Present.device_setup":0.117,"Driver.Present.gpu_mutex_wait":1.546,"Driver.Present.inflight_wait":0.887,"Driver.Present.present_display_buffer":28.377,"Driver.Present.queue_present":106.082,"Driver.Present.release_and_callback":0.439,"Driver.Present.render_fence_wait":1399.137,"Driver.Present.resize":0.414,"Driver.Present.validate":0.101,"Driver.Rewind":1093.794,"Driver.Suspend":0.055,"GpuMutex.wait.dispatch":0.016,"GpuMutex.wait.draw":34.651,"GpuMutex.wait.end":3.226,"GpuMutex.wait.fill":0.042,"GpuMutex.wait.flush":0.077,"GpuMutex.wait.hook":0.987,"GpuMutex.wait.label":0.985,"GpuMutex.wait.other":0.028,"GpuMutex.wait.present":1.054,"Graphics.Draw":24090.706,"Graphics.Draw.draw_and_resource_release":18984.222,"Graphics.Draw.index_upload":1200.738,"Graphics.Draw.validate":897.092,"Graphics.Draw.vertex_upload":2747.685,"Graphics.DrawWithRecipe":540.942,"Graphics.DrawWithRecipe.draw_and_resource_release":420.769,"Graphics.DrawWithRecipe.index_upload":35.408,"Graphics.DrawWithRecipe.validate":10.796,"Graphics.DrawWithRecipe.vertex_upload":69.736,"Recorder.Reap":269.546,"Recorder.Submit":825.563,"Recorder.Sync":493.832,"Recorder.WaitSerial":251.774,"Resources.Complete":55.316,"Resources.Prepare":92.191,"Shader.DrawStage":8989.291,"Shader.DrawStage.capture_resources":4494.340,"Shader.DrawStage.materialize":2896.677,"Shader.DrawStage.prepared_invocation":1469.458,"Shader.ResolveGraphicsStagesAbi":5.204,"VideoOut.Flip":1575.374,"VideoOut.Flip.completion_mutex_wait":0.473,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.131,"VideoOut.Flip.notify_game":7.864,"VideoOut.Flip.present":1542.472,"VideoOut.Flip.validate":0.304,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.414,"VideoOut.Flip.window_title":23.197,"VideoOut.Readiness":0.461,"VideoOut.Readiness.locks_validate":0.204,"Vulkan.Acquire":3.342,"Vulkan.Acquire.acquire_fence_wait":0.528,"Vulkan.Acquire.acquire_image":2.128,"Vulkan.Acquire.fence_reset":0.477,"Vulkan.Acquire.retired_swapchains":0.115,"Vulkan.Dispatch":201.266,"Vulkan.Dispatch.command_record":70.408,"Vulkan.Dispatch.shader_resources":128.526,"Vulkan.DispatchRecipe":158.350,"Vulkan.DispatchRecipe.command_record":157.149,"Vulkan.DrawFromRecipe":546.895,"Vulkan.GraphicsPipeline":1114.393,"Vulkan.GraphicsPipeline.create":1109.260,"Vulkan.GraphicsPipeline.modules_and_state":5.105,"Vulkan.GraphicsPipelineLibrary":1108.719,"Vulkan.GraphicsPipelineLink":0.150,"Vulkan.Present":12.985,"Vulkan.Present.command_record_scale":5.831,"Vulkan.Present.pixel_upload":0.558,"Vulkan.Present.queue_submit":6.413,"Vulkan.QueuePresent":105.713,"Vulkan.QueuePresent.queue_present":105.245,"Vulkan.Retire":1399.020,"Vulkan.Retire.wait":1395.667},"top_phases_ms_per_frame":{"Driver.Packet":106.695,"Graphics.Draw":95.979,"Driver.Packet.draw":81.474,"Driver.Draw":80.873,"Driver.DrawFinish":78.820,"Graphics.Draw.draw_and_resource_release":75.634,"Driver.Draw.prepare":67.790,"Driver.DrawFinish.shader_compile_and_link":38.763},"owned_draw_counts":{"OwnedDraw.arm_attempt":11797,"OwnedDraw.arm_blocks_requested":11797,"OwnedDraw.arm_refused":11797},"graphics_track":{"Graphics.Barrier.copy":3240,"Graphics.Barrier.dcc-clear":3012,"Graphics.Barrier.dcc-keys":2008,"Graphics.Barrier.dispatch-lead":9320,"Graphics.Barrier.dispatch-trail":10901,"Graphics.Barrier.draw":164754,"Graphics.Barrier.fill":3087,"Graphics.Barrier.fill-clear":502,"Graphics.Barrier.indirect-args":1757,"Graphics.Barrier.input-mirror":39160,"Graphics.Barrier.label-run":102339,"Graphics.Barrier.present-blit":1004,"Graphics.Barrier.shadow-publish":502,"Graphics.Barrier.staging-in":10258,"Graphics.Barrier.staging-out":4359,"Graphics.Barrier.storage-upload":9562,"Graphics.Barrier.storage-writeback":28214,"Graphics.BarrierMerged.dispatch-lead":5095,"Graphics.BarrierMerged.fill":1527,"Graphics.BarrierMerged.label-run":753,"Graphics.BarrierMerged.shadow-publish":502,"Graphics.BarrierMerged.staging-in":2819,"Graphics.BarrierMerged.staging-out":4359,"Graphics.BarrierMerged.storage-writeback":4365,"Graphics.Copy":49939,"Graphics.Copy.bytes":6941316266,"Graphics.RenderPass":82519,"Graphics.RenderPass.Close.command":44630,"Graphics.RenderPass.Close.image":21694,"Graphics.RenderPass.Close.key":3752,"Graphics.RenderPass.Close.label":753,"Graphics.RenderPass.Close.new-batch":11684,"Graphics.RenderPass.Continued":806332},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.315,"events_lost":789445,"totals_full":false},"draw committer":{"events_full_after_s":13.770,"events_lost":306139,"totals_full":false},"draw finisher":{"events_full_after_s":19.443,"events_lost":137731,"totals_full":false}},"trace":"aps5-trace-da3b9f12dd29-4772.json.gz"}
{"commit":"a813ef9699a9","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1696,"ms":30043.527},"presents":247,"frame_ms":{"p50":113.627,"p90":134.808,"p99":286.557,"max":363.317},"gpu_busy_ms_per_present":28.313,"worker_busy_pct":{"queue worker 0x0":94.114},"phase_totals_ms":{"Driver.Completion":0.137,"Driver.Dispatch":1926.328,"Driver.Dispatch.capture_resources":14.113,"Driver.Dispatch.decode_key_device_setup":25.776,"Driver.Dispatch.lookup_cache":211.507,"Driver.Dispatch.materialize":2.123,"Driver.Dispatch.prepared_invocation":88.164,"Driver.Draw":20198.934,"Driver.Draw.device_setup":707.221,"Driver.Draw.draw_handed_off":2468.831,"Driver.Draw.prepare":16933.893,"Driver.DrawFinish":19650.308,"Driver.DrawFinish.draw_enqueued":9508.504,"Driver.DrawFinish.post_compile_prepare":264.018,"Driver.DrawFinish.shader_compile_and_link":9738.905,"Driver.EndSubmission":468.528,"Driver.Packet":26660.304,"Driver.Packet.device_lock":209.468,"Driver.Packet.dispatch":1934.561,"Driver.Packet.draw":20355.624,"Driver.Packet.execute":1794.018,"Driver.Packet.flip_flush":8.768,"Driver.Packet.flush_between_packets":506.762,"Driver.Packet.memory_wait":4.785,"Driver.Packet.pipeline_drain":417.380,"Driver.Packet.pipeline_prepare":298.738,"Driver.Packet.prepare_memory":263.123,"Driver.Packet.rendering_wait":0.170,"Driver.Present":1516.007,"Driver.Present.acquire_image":3.512,"Driver.Present.device_setup":0.112,"Driver.Present.gpu_mutex_wait":1.485,"Driver.Present.inflight_wait":0.631,"Driver.Present.present_display_buffer":29.083,"Driver.Present.queue_present":103.063,"Driver.Present.release_and_callback":0.407,"Driver.Present.render_fence_wait":1377.074,"Driver.Present.resize":0.406,"Driver.Present.validate":0.070,"Driver.Rewind":1146.180,"Driver.Suspend":0.055,"GpuMutex.wait.dispatch":0.014,"GpuMutex.wait.draw":41.451,"GpuMutex.wait.end":1.648,"GpuMutex.wait.fill":0.077,"GpuMutex.wait.flush":0.147,"GpuMutex.wait.hook":0.138,"GpuMutex.wait.label":0.583,"GpuMutex.wait.other":1.830,"GpuMutex.wait.present":0.996,"Graphics.Draw":24128.434,"Graphics.Draw.draw_and_resource_release":19014.506,"Graphics.Draw.index_upload":1222.851,"Graphics.Draw.validate":875.037,"Graphics.Draw.vertex_upload":2766.697,"Graphics.DrawWithRecipe":480.203,"Graphics.DrawWithRecipe.draw_and_resource_release":368.115,"Graphics.DrawWithRecipe.index_upload":33.664,"Graphics.DrawWithRecipe.validate":9.568,"Graphics.DrawWithRecipe.vertex_upload":65.054,"Recorder.Reap":275.380,"Recorder.Submit":830.625,"Recorder.Sync":607.363,"Recorder.WaitSerial":258.697,"Resources.Complete":56.910,"Resources.Prepare":103.407,"Shader.DrawStage":9015.419,"Shader.DrawStage.capture_resources":4529.974,"Shader.DrawStage.materialize":2891.313,"Shader.DrawStage.prepared_invocation":1466.613,"Shader.ResolveGraphicsStagesAbi":5.150,"VideoOut.Flip":1547.938,"VideoOut.Flip.completion_mutex_wait":0.427,"VideoOut.Flip.config_mutex_wait":0.029,"VideoOut.Flip.frame_limit":0.140,"VideoOut.Flip.notify_game":6.183,"VideoOut.Flip.present":1517.603,"VideoOut.Flip.validate":0.287,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.423,"VideoOut.Flip.window_title":22.358,"VideoOut.Readiness":0.469,"VideoOut.Readiness.locks_validate":0.211,"Vulkan.Acquire":3.261,"Vulkan.Acquire.acquire_fence_wait":0.490,"Vulkan.Acquire.acquire_image":2.102,"Vulkan.Acquire.fence_reset":0.463,"Vulkan.Acquire.retired_swapchains":0.122,"Vulkan.Dispatch":199.632,"Vulkan.Dispatch.command_record":70.558,"Vulkan.Dispatch.shader_resources":126.713,"Vulkan.DispatchRecipe":156.560,"Vulkan.DispatchRecipe.command_record":155.415,"Vulkan.DrawFromRecipe":485.709,"Vulkan.GraphicsPipeline":1005.404,"Vulkan.GraphicsPipeline.create":1001.274,"Vulkan.GraphicsPipeline.modules_and_state":4.115,"Vulkan.GraphicsPipelineLibrary":1000.950,"Vulkan.GraphicsPipelineLink":0.087,"Vulkan.Present":12.774,"Vulkan.Present.command_record_scale":5.762,"Vulkan.Present.pixel_upload":0.694,"Vulkan.Present.queue_submit":6.147,"Vulkan.QueuePresent":102.710,"Vulkan.QueuePresent.queue_present":102.260,"Vulkan.Retire":1376.989,"Vulkan.Retire.wait":1374.083},"top_phases_ms_per_frame":{"Driver.Packet":107.936,"Graphics.Draw":97.686,"Driver.Packet.draw":82.411,"Driver.Draw":81.777,"Driver.DrawFinish":79.556,"Graphics.Draw.draw_and_resource_release":76.982,"Driver.Draw.prepare":68.558,"Driver.DrawFinish.shader_compile_and_link":39.429},"owned_draw_counts":{"OwnedDraw.arm_attempt":11609,"OwnedDraw.arm_blocks_requested":11609,"OwnedDraw.arm_refused":11609},"graphics_track":{"Graphics.Barrier.copy":3558,"Graphics.Barrier.dcc-clear":2964,"Graphics.Barrier.dcc-keys":1976,"Graphics.Barrier.dispatch-lead":9173,"Graphics.Barrier.dispatch-trail":10689,"Graphics.Barrier.draw":171465,"Graphics.Barrier.fill":3052,"Graphics.Barrier.fill-clear":494,"Graphics.Barrier.indirect-args":1729,"Graphics.Barrier.input-mirror":43361,"Graphics.Barrier.label-run":100257,"Graphics.Barrier.present-blit":988,"Graphics.Barrier.shadow-publish":499,"Graphics.Barrier.staging-in":9516,"Graphics.Barrier.staging-out":4251,"Graphics.Barrier.storage-upload":9406,"Graphics.Barrier.storage-writeback":27793,"Graphics.BarrierMerged.dispatch-lead":4974,"Graphics.BarrierMerged.fill":1506,"Graphics.BarrierMerged.label-run":514,"Graphics.BarrierMerged.shadow-publish":499,"Graphics.BarrierMerged.staging-in":3237,"Graphics.BarrierMerged.staging-out":4251,"Graphics.BarrierMerged.storage-writeback":4283,"Graphics.Copy":53910,"Graphics.Copy.bytes":6917510402,"Graphics.RenderPass":85856,"Graphics.RenderPass.Close.command":47946,"Graphics.RenderPass.Close.image":21949,"Graphics.RenderPass.Close.key":3696,"Graphics.RenderPass.Close.label":514,"Graphics.RenderPass.Close.new-batch":11740,"Graphics.RenderPass.Continued":796063},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.342,"events_lost":794391,"totals_full":false},"draw committer":{"events_full_after_s":13.741,"events_lost":300969,"totals_full":false},"draw finisher":{"events_full_after_s":19.178,"events_lost":141497,"totals_full":false}},"trace":"aps5-trace-a813ef9699a9-23660.json.gz"}

Cold replay of GTA's city frames (rp7). agc_frame_replay replays a 3-frame 4K capture of the same city scene with an empty shader cache (ANYPS5_NO_SHADER_CACHE=1, --cold-pipelines, __GL_SHADER_DISK_CACHE=0) and the registration prebuild off (APS5_NO_LIBRARY_PREBUILD=1), so every counted part is one the frames' draws needed and the counts repeat exactly. Order: main, this PR, this PR, main, then this PR with APS5_WIDE_LIBRARY_KEYS=1. Both builds carry #20845 and #14561, without which this capture replays a wrong picture; every run matches the capture's own frames (pixels_identical 1.000).

library parts built vertex input pre-rasterization fragment fragment output
main (both runs) 78 122 226 48
this PR (both runs) 78 114 221 48
this PR, APS5_WIDE_LIBRARY_KEYS=1 78 122 226 48

Compile times are not offered: main's two runs differ by 1.3 s.

Whole GTA boots with a cold cache (three main/PR pairs, dg4 to dg6) varied by about ±30 compiles from boot to boot, more than the effect, so they are not offered as a measurement; neither are the earlier whole-boot switch A/Bs (nk3, nk4).

GPU tests. RTX 3080, NVIDIA 621.24, Windows 11, the AGENTS.md protocol: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, validation layer SDK 1.4.335.0. Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation" and no was not found but was requested.

  • ctest -R 'library_keys_narrow|color_write_mask_dynamic|agc_driver_graphics$' -V:

    • main 806e2140a9: 4/4 passed, no VUID- lines;
    • this PR d9b5bf76a5: 7/7 passed, no VUID- lines;
    • the new tests are agc_driver_library_keys_narrow and its _whole_pipelines and _static_depth_bias_enable variants;
    • the push constant assembly: N x ... lines in agc_driver_graphics are that test's own diagnostics and appear on main too.
  • Negative controls: one-edit mutants of d9b5bf76a5, ctest -R library_keys_narrow under the same protocol.

    mutant library_keys_narrow _static_depth_bias_enable _whole_pipelines
    wide keys restored fails: 6 pre-rasterization and 4 fragment libraries built, expected 1 and 1 fails: 6 and 4, expected 2 and 1 passes
    dynamic enable never set fails: 2048 biased pixels pass an EQUAL test, VUID-vkCmdDraw-None-04877 passes passes
    depth/stencil formats kept in the key fails: 3 and 3, expected 1 and 1 fails: 6 and 3, expected 2 and 1 passes

    _whole_pipelines passes in every mutant, as it should, because it runs without libraries.

  • CI on d9b5bf76a5 (our fork): green. Linux lavapipe ran the selected tests 10/10 with the validation layer inserted and no VUID- lines, and main 6/6. Windows (MinGW, lavapipe) ran 10/10 with no VUID- lines.

Checklist

  • Based on current main (806e2140a9; merges cleanly onto today's main); no other open PR implements the same functions. #22058 also adds a field to the pre-rasterization key; the two merge cleanly apart from adjacent new tests in tests/Graphics.cpp
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: NVIDIA GeForce RTX 3080, driver 621.24, Windows 11 (10.0.26320); lavapipe on Linux CI
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5383668545 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23229). Originally posted by [chitters2004](https://github.com/chitters2004) on 2026-11-18T20:36:50Z. --- ### What Shader pipeline libraries were keyed on more state than they read, so the same shaders were compiled again whenever a draw changed something that only the output or vertex-input part uses. - Pre-rasterization and fragment shader libraries take only `viewMask` from the rendering info. They now pass `VK_FORMAT_UNDEFINED` depth and stencil formats and key without them. The fragment library takes a null multisample state unless the pipeline enables sample shading, or a fragment shader reads `SampleId`, `SamplePosition` or a `Sample`-decorated input. - With `VK_EXT_extended_dynamic_state2`, the depth bias enable is a dynamic state set at bind and leaves the pre-rasterization key. The bias values were already dynamic, and they are zero when bias is off. - `APS5_WIDE_LIBRARY_KEYS=1` restores the old keys and `APS5_NO_DYNAMIC_DEPTH_BIAS_ENABLE=1` keeps the enable baked, so both can be compared within one build. The pipeline store key carries the mode, and both switches are in docs/dev/ENVIRONMENT.md. ### Tested All runs: RTX 3080, NVIDIA 621.24, Windows 11 (10.0.26320), Ryzen 7 5800X, 3840x2160. **GTA V (PPSA04263 01.011.001), warm boots, main vs this PR (nkp).** One CLEAN boot per arm on the same machine, city scene (Franklin's house save), with caches warmed by one untimed boot per build. Only `APS5_TRACE_SECONDS=92:30` was set for the window (from the moment the player stands still + 20 s, 30 s long); the other variables in the lines are the harness's (trace paths, pad input, address copy limit). Both arms run with the draw pipeline on (`APS5_DRAW_PIPELINE=1`, `APS5_PIPELINED_DRAWS=32`, `APS5_PIPELINE_DISPATCH=1`), which is how we measure GTA; main ships it off and this PR doesn't touch it. The commits in the lines are lab merges: `da3b9f12dd29` is main 806e2140a9 plus #20845 and #14561, which GTA needs to reach gameplay, and `a813ef9699a9` is that plus exactly this PR's diff (same patch-id). Defender real-time protection was on. | | frame p50 ms | p90 ms | p99 ms | presents | GPU busy ms/present | |---|---|---|---|---|---| | main | 111.8 | 130.4 | 255.8 | 251 | 27.7 | | this PR | 113.6 | 134.8 | 286.6 | 247 | 28.3 | No regression: the difference is within this scene's boot-to-boot spread. In an earlier set on the same scene and mode, two CLEAN boots of one main build measured 112.5 and 119.7 ms p50. The change only affects how pipeline libraries are keyed, so a warm steady state is not expected to move; time in `Vulkan.GraphicsPipelineLibrary` in the window was 1,109 ms on main and 1,001 ms with this PR, from one boot each. <details><summary><code>aps5-summary.jsonl</code> window lines, main then this PR</summary> ```json {"commit":"da3b9f12dd29","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1650,"ms":30074.799},"presents":251,"frame_ms":{"p50":111.759,"p90":130.376,"p99":255.777,"max":277.752},"gpu_busy_ms_per_present":27.664,"worker_busy_pct":{"queue worker 0x0":93.920},"phase_totals_ms":{"Driver.Completion":0.137,"Driver.Dispatch":1950.591,"Driver.Dispatch.capture_resources":12.979,"Driver.Dispatch.decode_key_device_setup":25.981,"Driver.Dispatch.lookup_cache":218.556,"Driver.Dispatch.materialize":1.993,"Driver.Dispatch.prepared_invocation":83.055,"Driver.Draw":20299.185,"Driver.Draw.device_setup":701.404,"Driver.Draw.draw_handed_off":2494.170,"Driver.Draw.prepare":17015.326,"Driver.DrawFinish":19783.845,"Driver.DrawFinish.draw_enqueued":9636.073,"Driver.DrawFinish.post_compile_prepare":271.114,"Driver.DrawFinish.shader_compile_and_link":9729.459,"Driver.EndSubmission":371.809,"Driver.Packet":26780.400,"Driver.Packet.device_lock":208.160,"Driver.Packet.dispatch":1959.369,"Driver.Packet.draw":20449.949,"Driver.Packet.execute":1871.887,"Driver.Packet.flip_flush":8.650,"Driver.Packet.flush_between_packets":500.339,"Driver.Packet.memory_wait":4.739,"Driver.Packet.pipeline_drain":420.736,"Driver.Packet.pipeline_prepare":297.681,"Driver.Packet.prepare_memory":265.243,"Driver.Packet.rendering_wait":0.171,"Driver.Present":1540.875,"Driver.Present.acquire_image":3.599,"Driver.Present.device_setup":0.117,"Driver.Present.gpu_mutex_wait":1.546,"Driver.Present.inflight_wait":0.887,"Driver.Present.present_display_buffer":28.377,"Driver.Present.queue_present":106.082,"Driver.Present.release_and_callback":0.439,"Driver.Present.render_fence_wait":1399.137,"Driver.Present.resize":0.414,"Driver.Present.validate":0.101,"Driver.Rewind":1093.794,"Driver.Suspend":0.055,"GpuMutex.wait.dispatch":0.016,"GpuMutex.wait.draw":34.651,"GpuMutex.wait.end":3.226,"GpuMutex.wait.fill":0.042,"GpuMutex.wait.flush":0.077,"GpuMutex.wait.hook":0.987,"GpuMutex.wait.label":0.985,"GpuMutex.wait.other":0.028,"GpuMutex.wait.present":1.054,"Graphics.Draw":24090.706,"Graphics.Draw.draw_and_resource_release":18984.222,"Graphics.Draw.index_upload":1200.738,"Graphics.Draw.validate":897.092,"Graphics.Draw.vertex_upload":2747.685,"Graphics.DrawWithRecipe":540.942,"Graphics.DrawWithRecipe.draw_and_resource_release":420.769,"Graphics.DrawWithRecipe.index_upload":35.408,"Graphics.DrawWithRecipe.validate":10.796,"Graphics.DrawWithRecipe.vertex_upload":69.736,"Recorder.Reap":269.546,"Recorder.Submit":825.563,"Recorder.Sync":493.832,"Recorder.WaitSerial":251.774,"Resources.Complete":55.316,"Resources.Prepare":92.191,"Shader.DrawStage":8989.291,"Shader.DrawStage.capture_resources":4494.340,"Shader.DrawStage.materialize":2896.677,"Shader.DrawStage.prepared_invocation":1469.458,"Shader.ResolveGraphicsStagesAbi":5.204,"VideoOut.Flip":1575.374,"VideoOut.Flip.completion_mutex_wait":0.473,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.131,"VideoOut.Flip.notify_game":7.864,"VideoOut.Flip.present":1542.472,"VideoOut.Flip.validate":0.304,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.414,"VideoOut.Flip.window_title":23.197,"VideoOut.Readiness":0.461,"VideoOut.Readiness.locks_validate":0.204,"Vulkan.Acquire":3.342,"Vulkan.Acquire.acquire_fence_wait":0.528,"Vulkan.Acquire.acquire_image":2.128,"Vulkan.Acquire.fence_reset":0.477,"Vulkan.Acquire.retired_swapchains":0.115,"Vulkan.Dispatch":201.266,"Vulkan.Dispatch.command_record":70.408,"Vulkan.Dispatch.shader_resources":128.526,"Vulkan.DispatchRecipe":158.350,"Vulkan.DispatchRecipe.command_record":157.149,"Vulkan.DrawFromRecipe":546.895,"Vulkan.GraphicsPipeline":1114.393,"Vulkan.GraphicsPipeline.create":1109.260,"Vulkan.GraphicsPipeline.modules_and_state":5.105,"Vulkan.GraphicsPipelineLibrary":1108.719,"Vulkan.GraphicsPipelineLink":0.150,"Vulkan.Present":12.985,"Vulkan.Present.command_record_scale":5.831,"Vulkan.Present.pixel_upload":0.558,"Vulkan.Present.queue_submit":6.413,"Vulkan.QueuePresent":105.713,"Vulkan.QueuePresent.queue_present":105.245,"Vulkan.Retire":1399.020,"Vulkan.Retire.wait":1395.667},"top_phases_ms_per_frame":{"Driver.Packet":106.695,"Graphics.Draw":95.979,"Driver.Packet.draw":81.474,"Driver.Draw":80.873,"Driver.DrawFinish":78.820,"Graphics.Draw.draw_and_resource_release":75.634,"Driver.Draw.prepare":67.790,"Driver.DrawFinish.shader_compile_and_link":38.763},"owned_draw_counts":{"OwnedDraw.arm_attempt":11797,"OwnedDraw.arm_blocks_requested":11797,"OwnedDraw.arm_refused":11797},"graphics_track":{"Graphics.Barrier.copy":3240,"Graphics.Barrier.dcc-clear":3012,"Graphics.Barrier.dcc-keys":2008,"Graphics.Barrier.dispatch-lead":9320,"Graphics.Barrier.dispatch-trail":10901,"Graphics.Barrier.draw":164754,"Graphics.Barrier.fill":3087,"Graphics.Barrier.fill-clear":502,"Graphics.Barrier.indirect-args":1757,"Graphics.Barrier.input-mirror":39160,"Graphics.Barrier.label-run":102339,"Graphics.Barrier.present-blit":1004,"Graphics.Barrier.shadow-publish":502,"Graphics.Barrier.staging-in":10258,"Graphics.Barrier.staging-out":4359,"Graphics.Barrier.storage-upload":9562,"Graphics.Barrier.storage-writeback":28214,"Graphics.BarrierMerged.dispatch-lead":5095,"Graphics.BarrierMerged.fill":1527,"Graphics.BarrierMerged.label-run":753,"Graphics.BarrierMerged.shadow-publish":502,"Graphics.BarrierMerged.staging-in":2819,"Graphics.BarrierMerged.staging-out":4359,"Graphics.BarrierMerged.storage-writeback":4365,"Graphics.Copy":49939,"Graphics.Copy.bytes":6941316266,"Graphics.RenderPass":82519,"Graphics.RenderPass.Close.command":44630,"Graphics.RenderPass.Close.image":21694,"Graphics.RenderPass.Close.key":3752,"Graphics.RenderPass.Close.label":753,"Graphics.RenderPass.Close.new-batch":11684,"Graphics.RenderPass.Continued":806332},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.315,"events_lost":789445,"totals_full":false},"draw committer":{"events_full_after_s":13.770,"events_lost":306139,"totals_full":false},"draw finisher":{"events_full_after_s":19.443,"events_lost":137731,"totals_full":false}},"trace":"aps5-trace-da3b9f12dd29-4772.json.gz"} {"commit":"a813ef9699a9","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1696,"ms":30043.527},"presents":247,"frame_ms":{"p50":113.627,"p90":134.808,"p99":286.557,"max":363.317},"gpu_busy_ms_per_present":28.313,"worker_busy_pct":{"queue worker 0x0":94.114},"phase_totals_ms":{"Driver.Completion":0.137,"Driver.Dispatch":1926.328,"Driver.Dispatch.capture_resources":14.113,"Driver.Dispatch.decode_key_device_setup":25.776,"Driver.Dispatch.lookup_cache":211.507,"Driver.Dispatch.materialize":2.123,"Driver.Dispatch.prepared_invocation":88.164,"Driver.Draw":20198.934,"Driver.Draw.device_setup":707.221,"Driver.Draw.draw_handed_off":2468.831,"Driver.Draw.prepare":16933.893,"Driver.DrawFinish":19650.308,"Driver.DrawFinish.draw_enqueued":9508.504,"Driver.DrawFinish.post_compile_prepare":264.018,"Driver.DrawFinish.shader_compile_and_link":9738.905,"Driver.EndSubmission":468.528,"Driver.Packet":26660.304,"Driver.Packet.device_lock":209.468,"Driver.Packet.dispatch":1934.561,"Driver.Packet.draw":20355.624,"Driver.Packet.execute":1794.018,"Driver.Packet.flip_flush":8.768,"Driver.Packet.flush_between_packets":506.762,"Driver.Packet.memory_wait":4.785,"Driver.Packet.pipeline_drain":417.380,"Driver.Packet.pipeline_prepare":298.738,"Driver.Packet.prepare_memory":263.123,"Driver.Packet.rendering_wait":0.170,"Driver.Present":1516.007,"Driver.Present.acquire_image":3.512,"Driver.Present.device_setup":0.112,"Driver.Present.gpu_mutex_wait":1.485,"Driver.Present.inflight_wait":0.631,"Driver.Present.present_display_buffer":29.083,"Driver.Present.queue_present":103.063,"Driver.Present.release_and_callback":0.407,"Driver.Present.render_fence_wait":1377.074,"Driver.Present.resize":0.406,"Driver.Present.validate":0.070,"Driver.Rewind":1146.180,"Driver.Suspend":0.055,"GpuMutex.wait.dispatch":0.014,"GpuMutex.wait.draw":41.451,"GpuMutex.wait.end":1.648,"GpuMutex.wait.fill":0.077,"GpuMutex.wait.flush":0.147,"GpuMutex.wait.hook":0.138,"GpuMutex.wait.label":0.583,"GpuMutex.wait.other":1.830,"GpuMutex.wait.present":0.996,"Graphics.Draw":24128.434,"Graphics.Draw.draw_and_resource_release":19014.506,"Graphics.Draw.index_upload":1222.851,"Graphics.Draw.validate":875.037,"Graphics.Draw.vertex_upload":2766.697,"Graphics.DrawWithRecipe":480.203,"Graphics.DrawWithRecipe.draw_and_resource_release":368.115,"Graphics.DrawWithRecipe.index_upload":33.664,"Graphics.DrawWithRecipe.validate":9.568,"Graphics.DrawWithRecipe.vertex_upload":65.054,"Recorder.Reap":275.380,"Recorder.Submit":830.625,"Recorder.Sync":607.363,"Recorder.WaitSerial":258.697,"Resources.Complete":56.910,"Resources.Prepare":103.407,"Shader.DrawStage":9015.419,"Shader.DrawStage.capture_resources":4529.974,"Shader.DrawStage.materialize":2891.313,"Shader.DrawStage.prepared_invocation":1466.613,"Shader.ResolveGraphicsStagesAbi":5.150,"VideoOut.Flip":1547.938,"VideoOut.Flip.completion_mutex_wait":0.427,"VideoOut.Flip.config_mutex_wait":0.029,"VideoOut.Flip.frame_limit":0.140,"VideoOut.Flip.notify_game":6.183,"VideoOut.Flip.present":1517.603,"VideoOut.Flip.validate":0.287,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.423,"VideoOut.Flip.window_title":22.358,"VideoOut.Readiness":0.469,"VideoOut.Readiness.locks_validate":0.211,"Vulkan.Acquire":3.261,"Vulkan.Acquire.acquire_fence_wait":0.490,"Vulkan.Acquire.acquire_image":2.102,"Vulkan.Acquire.fence_reset":0.463,"Vulkan.Acquire.retired_swapchains":0.122,"Vulkan.Dispatch":199.632,"Vulkan.Dispatch.command_record":70.558,"Vulkan.Dispatch.shader_resources":126.713,"Vulkan.DispatchRecipe":156.560,"Vulkan.DispatchRecipe.command_record":155.415,"Vulkan.DrawFromRecipe":485.709,"Vulkan.GraphicsPipeline":1005.404,"Vulkan.GraphicsPipeline.create":1001.274,"Vulkan.GraphicsPipeline.modules_and_state":4.115,"Vulkan.GraphicsPipelineLibrary":1000.950,"Vulkan.GraphicsPipelineLink":0.087,"Vulkan.Present":12.774,"Vulkan.Present.command_record_scale":5.762,"Vulkan.Present.pixel_upload":0.694,"Vulkan.Present.queue_submit":6.147,"Vulkan.QueuePresent":102.710,"Vulkan.QueuePresent.queue_present":102.260,"Vulkan.Retire":1376.989,"Vulkan.Retire.wait":1374.083},"top_phases_ms_per_frame":{"Driver.Packet":107.936,"Graphics.Draw":97.686,"Driver.Packet.draw":82.411,"Driver.Draw":81.777,"Driver.DrawFinish":79.556,"Graphics.Draw.draw_and_resource_release":76.982,"Driver.Draw.prepare":68.558,"Driver.DrawFinish.shader_compile_and_link":39.429},"owned_draw_counts":{"OwnedDraw.arm_attempt":11609,"OwnedDraw.arm_blocks_requested":11609,"OwnedDraw.arm_refused":11609},"graphics_track":{"Graphics.Barrier.copy":3558,"Graphics.Barrier.dcc-clear":2964,"Graphics.Barrier.dcc-keys":1976,"Graphics.Barrier.dispatch-lead":9173,"Graphics.Barrier.dispatch-trail":10689,"Graphics.Barrier.draw":171465,"Graphics.Barrier.fill":3052,"Graphics.Barrier.fill-clear":494,"Graphics.Barrier.indirect-args":1729,"Graphics.Barrier.input-mirror":43361,"Graphics.Barrier.label-run":100257,"Graphics.Barrier.present-blit":988,"Graphics.Barrier.shadow-publish":499,"Graphics.Barrier.staging-in":9516,"Graphics.Barrier.staging-out":4251,"Graphics.Barrier.storage-upload":9406,"Graphics.Barrier.storage-writeback":27793,"Graphics.BarrierMerged.dispatch-lead":4974,"Graphics.BarrierMerged.fill":1506,"Graphics.BarrierMerged.label-run":514,"Graphics.BarrierMerged.shadow-publish":499,"Graphics.BarrierMerged.staging-in":3237,"Graphics.BarrierMerged.staging-out":4251,"Graphics.BarrierMerged.storage-writeback":4283,"Graphics.Copy":53910,"Graphics.Copy.bytes":6917510402,"Graphics.RenderPass":85856,"Graphics.RenderPass.Close.command":47946,"Graphics.RenderPass.Close.image":21949,"Graphics.RenderPass.Close.key":3696,"Graphics.RenderPass.Close.label":514,"Graphics.RenderPass.Close.new-batch":11740,"Graphics.RenderPass.Continued":796063},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.342,"events_lost":794391,"totals_full":false},"draw committer":{"events_full_after_s":13.741,"events_lost":300969,"totals_full":false},"draw finisher":{"events_full_after_s":19.178,"events_lost":141497,"totals_full":false}},"trace":"aps5-trace-a813ef9699a9-23660.json.gz"} ``` </details> **Cold replay of GTA's city frames (rp7).** `agc_frame_replay` replays a 3-frame 4K capture of the same city scene with an empty shader cache (`ANYPS5_NO_SHADER_CACHE=1`, `--cold-pipelines`, `__GL_SHADER_DISK_CACHE=0`) and the registration prebuild off (`APS5_NO_LIBRARY_PREBUILD=1`), so every counted part is one the frames' draws needed and the counts repeat exactly. Order: main, this PR, this PR, main, then this PR with `APS5_WIDE_LIBRARY_KEYS=1`. Both builds carry #20845 and #14561, without which this capture replays a wrong picture; every run matches the capture's own frames (`pixels_identical` 1.000). | library parts built | vertex input | pre-rasterization | fragment | fragment output | |---|---|---|---|---| | main (both runs) | 78 | 122 | 226 | 48 | | this PR (both runs) | 78 | 114 | 221 | 48 | | this PR, `APS5_WIDE_LIBRARY_KEYS=1` | 78 | 122 | 226 | 48 | Compile times are not offered: main's two runs differ by 1.3 s. Whole GTA boots with a cold cache (three main/PR pairs, dg4 to dg6) varied by about ±30 compiles from boot to boot, more than the effect, so they are not offered as a measurement; neither are the earlier whole-boot switch A/Bs (nk3, nk4). **GPU tests.** RTX 3080, NVIDIA 621.24, Windows 11, the AGENTS.md protocol: `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`, validation layer SDK 1.4.335.0. Every log shows `Insert instance layer "VK_LAYER_KHRONOS_validation"` and no `was not found but was requested`. - `ctest -R 'library_keys_narrow|color_write_mask_dynamic|agc_driver_graphics$' -V`: - main 806e2140a9: 4/4 passed, no `VUID-` lines; - this PR d9b5bf76a5: 7/7 passed, no `VUID-` lines; - the new tests are `agc_driver_library_keys_narrow` and its `_whole_pipelines` and `_static_depth_bias_enable` variants; - the `push constant assembly: N x ...` lines in `agc_driver_graphics` are that test's own diagnostics and appear on main too. - Negative controls: one-edit mutants of d9b5bf76a5, `ctest -R library_keys_narrow` under the same protocol. | mutant | `library_keys_narrow` | `_static_depth_bias_enable` | `_whole_pipelines` | |---|---|---|---| | wide keys restored | fails: 6 pre-rasterization and 4 fragment libraries built, expected 1 and 1 | fails: 6 and 4, expected 2 and 1 | passes | | dynamic enable never set | fails: 2048 biased pixels pass an EQUAL test, `VUID-vkCmdDraw-None-04877` | passes | passes | | depth/stencil formats kept in the key | fails: 3 and 3, expected 1 and 1 | fails: 6 and 3, expected 2 and 1 | passes | `_whole_pipelines` passes in every mutant, as it should, because it runs without libraries. - CI on d9b5bf76a5 (our fork): green. Linux lavapipe ran the selected tests 10/10 with the validation layer inserted and no `VUID-` lines, and main 6/6. Windows (MinGW, lavapipe) ran 10/10 with no `VUID-` lines. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main` (806e2140a9; merges cleanly onto today's main); no other open PR implements the same functions. #22058 also adds a field to the pre-rasterization key; the two merge cleanly apart from adjacent new tests in `tests/Graphics.cpp` - [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) and the licence notice of code adapted from upstream (see AGENTS.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: NVIDIA GeForce RTX 3080, driver 621.24, Windows 11 (10.0.26320); lavapipe on Linux CI - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-18 21:23:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T21:23:00Z.

Review: COMMENTED


Reviewed — comments

The inspected implementation is consistent with the stated pipeline-key changes, but two changed files were excluded from the review folder and no checks were run in this review.

What I ran

Reviewed head 2857a546d20eaec058a63fa910485f88c83641b3. No commands or tests were run. Read the prepared description, commit list, manifest and diff, plus targeted ranges of VulkanDevice.cpp, Pipeline.cpp, and Graphics.cpp at the pinned head.

Results

Check Result Note
Diff and targeted code review passed No concrete defect found in inspected code
Automated checks not run Author reports GPU and replay checks

Findings

Blocking

None identified in the code inspected.

Non-blocking

None.

Not verified

The full changed text for core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp and core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was excluded because each was too large for the review folder. Targeted ranges of both were read through repo_read.py, but their remaining contents were not reviewed. Other changed files whose full text was included in review/files/ were not individually read; the diff was reviewed instead. No tests were run here; test results in the PR description are author-reported.

To get this to a good state

Nothing is required. The excluded file contents and checks remain unverified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5965389322 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23229#pullrequestreview-5965389322). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T21:23:00Z. **Review:** COMMENTED --- # Reviewed — comments The inspected implementation is consistent with the stated pipeline-key changes, but two changed files were excluded from the review folder and no checks were run in this review. ## What I ran Reviewed head `2857a546d20eaec058a63fa910485f88c83641b3`. No commands or tests were run. Read the prepared description, commit list, manifest and diff, plus targeted ranges of `VulkanDevice.cpp`, `Pipeline.cpp`, and `Graphics.cpp` at the pinned head. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted code review | passed | No concrete defect found in inspected code | | Automated checks | not run | Author reports GPU and replay checks | ## Findings ### Blocking None identified in the code inspected. ### Non-blocking None. ## Not verified The full changed text for `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` and `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` was excluded because each was too large for the review folder. Targeted ranges of both were read through `repo_read.py`, but their remaining contents were not reviewed. Other changed files whose full text was included in `review/files/` were not individually read; the diff was reviewed instead. No tests were run here; test results in the PR description are author-reported. ## To get this to a good state Nothing is required. The excluded file contents and checks remain unverified.
MarcZX10 commented 2026-11-19 01:55:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T01:55:28Z.

Review: COMMENTED


Reviewed — no blocking findings

The change narrows shader-library keys and adds dynamic depth-bias enable; I found no verified blocking defect in the code read.

What I ran

Reviewed head 9169633a54af9c410de3f01a2add9e4fbe6bca2d. No commands or tests were run; I reviewed the prepared diff and targeted source ranges through repo_read.py.

Results

Check Result Note
Diff and targeted source review passed Key construction and feature setup inspected
Tests not run Results in the PR description are author supplied

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full text of VulkanDevice.cpp and tests/Graphics.cpp was excluded from the review bundle; only targeted ranges of VulkanDevice.cpp and changed hunks of tests/Graphics.cpp were inspected. The changed tests/Recorder.cpp was also excluded and not read. Other included changed files were not individually read. Runtime behavior, test results, CI, performance measurements, and remaining changed-file contents were not independently verified. The prepared manifest lists 18 changed files: 15 included and 3 excluded as too large for the review folder. I read the description, commits, manifest, diff, targeted ranges in Pipeline.cpp, PipelineLibrary.cpp, Recorder.cpp, RuntimeSwitches.cpp, Context.hpp, and Pipeline.hpp, plus the changed hunks in VulkanDevice.cpp, Graphics.cpp, and the CMake and documentation changes.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5968178505 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23229#pullrequestreview-5968178505). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T01:55:28Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change narrows shader-library keys and adds dynamic depth-bias enable; I found no verified blocking defect in the code read. ## What I ran Reviewed head `9169633a54af9c410de3f01a2add9e4fbe6bca2d`. No commands or tests were run; I reviewed the prepared diff and targeted source ranges through `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Key construction and feature setup inspected | | Tests | not run | Results in the PR description are author supplied | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The full text of `VulkanDevice.cpp` and `tests/Graphics.cpp` was excluded from the review bundle; only targeted ranges of `VulkanDevice.cpp` and changed hunks of `tests/Graphics.cpp` were inspected. The changed `tests/Recorder.cpp` was also excluded and not read. Other included changed files were not individually read. Runtime behavior, test results, CI, performance measurements, and remaining changed-file contents were not independently verified. The prepared manifest lists 18 changed files: 15 included and 3 excluded as too large for the review folder. I read the description, commits, manifest, diff, targeted ranges in `Pipeline.cpp`, `PipelineLibrary.cpp`, `Recorder.cpp`, `RuntimeSwitches.cpp`, `Context.hpp`, and `Pipeline.hpp`, plus the changed hunks in `VulkanDevice.cpp`, `Graphics.cpp`, and the CMake and documentation changes. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-19 21:12:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T21:12:14Z.

Review: COMMENTED


Reviewed — comments

The change’s library-key and dynamic depth-bias paths look consistent in the inspected code; I did not run the reported checks or read every reviewed file, so a formal approval is not justified.

What I ran

Reviewed head 2393392a4d643fff2d8a4916e1d609eeb82479a3 using the prepared diff and repo_read.py; no tests or build commands were run. The author reports GPU and CI results in the PR description; these were not independently verified.

Results

Check Result Note
Source review passed Inspected key construction and library linking
Build and tests not run Results in the description are author reported
Negative control not run Reported mutants were not independently run

Findings

Blocking

None identified in the inspected code.

Non-blocking

None.

Not verified

The review folder’s files.json was not available through the reader. Changed files reported by the folder listing but not read: core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/PipelineLibrary.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cpp, core/libs/prx/libSceAgcDriver/tests/CommandStateLog.hpp, core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, core/libs/prx/libSceAgcDriver/tests/RuntimeSwitches.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmake, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_library_keys_narrow_tests.cmake, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake, core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp, core/libs/prx/libSceAgcDriver/tests/execution/LibraryKeysNarrow.cpp, and docs/dev/ENVIRONMENT.md. VulkanDevice.cpp was read only around the feature query and device feature chain; Pipeline.cpp only around key generation, pipeline cache keying, and dynamic state; PipelineLibrary.cpp only around library construction; Recorder.cpp only around depth bias enable tracking. No other behavior or platform results were verified.

To get this to a good state

Nothing is required. The test, GPU, and performance observations in the description are optional context and remain author reported.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5983481461 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23229#pullrequestreview-5983481461). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T21:12:14Z. **Review:** COMMENTED --- # Reviewed — comments The change’s library-key and dynamic depth-bias paths look consistent in the inspected code; I did not run the reported checks or read every reviewed file, so a formal approval is not justified. ## What I ran Reviewed head `2393392a4d643fff2d8a4916e1d609eeb82479a3` using the prepared diff and `repo_read.py`; no tests or build commands were run. The author reports GPU and CI results in the PR description; these were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Inspected key construction and library linking | | Build and tests | not run | Results in the description are author reported | | Negative control | not run | Reported mutants were not independently run | ## Findings ### Blocking None identified in the inspected code. ### Non-blocking None. ## Not verified The review folder’s `files.json` was not available through the reader. Changed files reported by the folder listing but not read: `core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/include/PipelineLibrary.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp`, `core/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cpp`, `core/libs/prx/libSceAgcDriver/tests/CommandStateLog.hpp`, `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`, `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`, `core/libs/prx/libSceAgcDriver/tests/RuntimeSwitches.cpp`, `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmake`, `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_library_keys_narrow_tests.cmake`, `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake`, `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`, `core/libs/prx/libSceAgcDriver/tests/execution/LibraryKeysNarrow.cpp`, and `docs/dev/ENVIRONMENT.md`. `VulkanDevice.cpp` was read only around the feature query and device feature chain; `Pipeline.cpp` only around key generation, pipeline cache keying, and dynamic state; `PipelineLibrary.cpp` only around library construction; `Recorder.cpp` only around depth bias enable tracking. No other behavior or platform results were verified. ## To get this to a good state Nothing is required. The test, GPU, and performance observations in the description are optional context and remain author reported.
MarcZX10 commented 2026-11-19 21:35:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T21:35:29Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete because three changed files were excluded from the review folder and their added lines were not inspected.

What I ran

  • Reviewed head 741dccedee6c13bf108cfc2ac705aead4c1ab40a using repo_read.py reader tools; no tests were run.
  • Read description.md, commits.md, manifest.json, README.md, and the available changed-file text listed below. The ruling file was not read, as instructed.

Results

Check Result Note
Changed code review not run Three changed files remain unread
Tests not run Author-reported results only

Findings

Blocking

None verified in the code inspected.

Non-blocking

None.

Not verified

The added lines in core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp, core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, and core/libs/prx/libSceAgcDriver/tests/Recorder.cpp were not read; the review reader reported these full texts as excluded from the review folder. No tests were run. The author reports GPU tests and negative controls in description.md; these were not run by this review.

Files read: core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp, Pipeline.hpp, PipelineLibrary.hpp, Recorder.hpp, RuntimeSwitches.hpp; core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp, PipelineLibrary.cpp, Recorder.cpp, Resources.cpp, RuntimeSwitches.cpp; core/libs/prx/libSceAgcDriver/tests/CommandStateLog.hpp, RuntimeSwitches.cpp, cmake/agc_driver_graphics_tests.cmake, cmake/agc_driver_library_keys_narrow_tests.cmake, cmake/agc_driver_recorder_tests.cmake, execution/DepthFastClearHarness.hpp, execution/LibraryKeysNarrow.cpp; and docs/dev/ENVIRONMENT.md was not read. The first five headers and PipelineLibrary.cpp, RuntimeSwitches.cpp, and LibraryKeysNarrow.cpp were read in full; other included files were inspected only in relevant ranges. Excluded changed files: the three listed above.

To get this to a good state

Nothing is required to address a verified defect. The review remains incomplete until the excluded changed lines are inspected; optional feedback: none.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5983782845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23229#pullrequestreview-5983782845). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T21:35:29Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete because three changed files were excluded from the review folder and their added lines were not inspected. ## What I ran - Reviewed head `741dccedee6c13bf108cfc2ac705aead4c1ab40a` using `repo_read.py` reader tools; no tests were run. - Read `description.md`, `commits.md`, `manifest.json`, `README.md`, and the available changed-file text listed below. The ruling file was not read, as instructed. ## Results | Check | Result | Note | |---|---|---| | Changed code review | not run | Three changed files remain unread | | Tests | not run | Author-reported results only | ## Findings ### Blocking None verified in the code inspected. ### Non-blocking None. ## Not verified The added lines in `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`, `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`, and `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` were not read; the review reader reported these full texts as excluded from the review folder. No tests were run. The author reports GPU tests and negative controls in `description.md`; these were not run by this review. Files read: `core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`, `Pipeline.hpp`, `PipelineLibrary.hpp`, `Recorder.hpp`, `RuntimeSwitches.hpp`; `core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp`, `PipelineLibrary.cpp`, `Recorder.cpp`, `Resources.cpp`, `RuntimeSwitches.cpp`; `core/libs/prx/libSceAgcDriver/tests/CommandStateLog.hpp`, `RuntimeSwitches.cpp`, `cmake/agc_driver_graphics_tests.cmake`, `cmake/agc_driver_library_keys_narrow_tests.cmake`, `cmake/agc_driver_recorder_tests.cmake`, `execution/DepthFastClearHarness.hpp`, `execution/LibraryKeysNarrow.cpp`; and `docs/dev/ENVIRONMENT.md` was not read. The first five headers and `PipelineLibrary.cpp`, `RuntimeSwitches.cpp`, and `LibraryKeysNarrow.cpp` were read in full; other included files were inspected only in relevant ranges. Excluded changed files: the three listed above. ## To get this to a good state Nothing is required to address a verified defect. The review remains incomplete until the excluded changed lines are inspected; optional feedback: none.
MarcZX10 commented 2026-11-19 23:15:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T23:15:06Z.

Review: APPROVED


Reviewed — looks good

The change narrows shader-library keys and adds dynamic depth-bias handling; the inspected code and supplied validation evidence show no verified blocking defect.

What I ran

  • Reviewed head 306e4008b12f646c083f15072eefa7e559baa660 using repo_read.py to inspect the prepared diff and targeted source ranges.
  • No tests were run in this review. The PR description reports GPU tests, negative controls, and CI results; these were not independently run here.

Results

Check Result Note
Diff and source review passed Changed behavior and targeted callers inspected
Tests in this review not run Author-reported results only
Negative control in this review not run Author reports mutation tests

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • I read the full diff and source for Pipeline.cpp, PipelineLibrary.cpp, Recorder.cpp, Resources.cpp, RuntimeSwitches.cpp, VulkanDevice.cpp, and the new LibraryKeysNarrow.cpp test. I also read the changed portions of the prepared tests and documentation.
  • Full text for VulkanDevice.cpp and tests/Graphics.cpp was excluded by the review folder size limit; I inspected the relevant changed source ranges through repo_read.py. The remaining changed files listed in manifest.json were not read in full.
  • GPU behavior, CI, and the reported negative controls were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5984941523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23229#pullrequestreview-5984941523). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T23:15:06Z. **Review:** APPROVED --- # Reviewed — looks good The change narrows shader-library keys and adds dynamic depth-bias handling; the inspected code and supplied validation evidence show no verified blocking defect. ## What I ran - Reviewed head `306e4008b12f646c083f15072eefa7e559baa660` using `repo_read.py` to inspect the prepared diff and targeted source ranges. - No tests were run in this review. The PR description reports GPU tests, negative controls, and CI results; these were not independently run here. ## Results | Check | Result | Note | |---|---|---| | Diff and source review | passed | Changed behavior and targeted callers inspected | | Tests in this review | not run | Author-reported results only | | Negative control in this review | not run | Author reports mutation tests | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - I read the full diff and source for `Pipeline.cpp`, `PipelineLibrary.cpp`, `Recorder.cpp`, `Resources.cpp`, `RuntimeSwitches.cpp`, `VulkanDevice.cpp`, and the new `LibraryKeysNarrow.cpp` test. I also read the changed portions of the prepared tests and documentation. - Full text for `VulkanDevice.cpp` and `tests/Graphics.cpp` was excluded by the review folder size limit; I inspected the relevant changed source ranges through `repo_read.py`. The remaining changed files listed in `manifest.json` were not read in full. - GPU behavior, CI, and the reported negative controls were not independently verified. ## To get this to a good state Nothing is required.
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!23229
No description provided.