Skip to content

perf(agc): remember the verdict of a sampler table entry - #25849

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
Remi-Bon:perf/agc-sampler-table-verdicts
Dec 3, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
Remi-Bon:perf/agc-sampler-table-verdicts

Conversation

@Remi-Bon

@Remi-Bon Remi-Bon commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

ShaderResources::addSamplerTable decodes and validates every sampler of a sampler table entry on every capture. When an entry is refused, it throws and catches an exception per sampler, every time. A shader that binds the same refused entry on each dispatch pays that cost on every dispatch.

This change remembers each entry's verdict: accepted, or the refusal text. The key is the context address, the entry's guest descriptor words and its depth-compare flags. The next capture of the same entry reuses the verdict without decoding. The memo is cleared at 65536 entries. An entry over the device's sampler table capacity is never memoised.

Tested

  • Windows 11, MinGW Release build.
  • ctest --test-dir build -R "sampler|image_table": 46/46 passed, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer, validation layer from Vulkan SDK 1.4.363.1. The loader log shows Insert instance layer "VK_LAYER_KHRONOS_validation" and contains no VUID-.
  • Measured in PPSA01317 (Café scene) on a local tree that carries other unmerged split table call work, so this is not a main vs change tools/trace_digest.py comparison: main alone does not reach the scene. CPU samples in addSamplerTable went from 654 to 163 over 45 s.

Speed capture

Windows 11 (26300), AMD Radeon RX 9070, AMD proprietary driver 26.11.2 (LLPC), Ryzen 9 5950X, 32 GB. PPSA01317, Café scene, 3840x2160, validation layer not loaded. Same environment on both sides, one warm-up run then one measured run per side, APS5_TRACE_SECONDS=0:100 from the Café entry.

This is not a main vs change capture: main alone does not reach the scene (#7256). Both commits are local snapshots of one downstream tree (e2c5cb724bb5 plus unmerged split table call work) and are not pushed. They differ only in ShaderResources::addSamplerTable: 0114600e6d8c has no verdict memo, d24d6e5c38d8 has the memo with this PR's key.

per frame without with change
Vulkan.Dispatch ms 62.993 25.709 -59.2 %
Recorder.Sync ms 93.654 129.365 +38.1 %
Driver.SplitDispatch ms 252.274 259.663 +2.9 %
GPU busy ms 107.616 142.757 +32.7 %
mean frame ms 350.539 351.038 +0.1 %

Over the window, Vulkan.Dispatch.shader_resources goes from 17479 ms to 6867 ms and Resources.Prepare from 13821 ms to 3058 ms. Frame time does not improve in this scene: Recorder.Sync and GPU busy time are higher on the side with the memo. There is one run per side, so the noise is unmeasured and I do not know the cause of that rise. Both traces dropped events on queue worker 0x0, so slice-based figures in the digests are partial.

{"commit":"0114600e6d8c","dirty":false,"env":{"APS5_ASYNC_COMPUTE_WORDS":"0","APS5_ASYNC_DRAW_COMPILE":"1","APS5_ASYNC_PIPELINE_WORDS":"50000","APS5_BATCH_CAP":"64","APS5_DRAW_PIPELINE":"1","APS5_GPU_CHECKPOINTS":"1","APS5_LOCAL_A2C_UNDITHERED":"1","APS5_LOCAL_MSAA_STALE_READ":"1","APS5_LOCAL_RETIRE_PARTIAL_FMASK_FILL":"1","APS5_LOCAL_SKIP_STATE_REFUSALS":"1","APS5_LOOP_GUARD":"65536","APS5_MAX_COMPUTE_SPIRV_WORDS":"1000000","APS5_NO_PIPELINE_LTO":"1","APS5_PIPELINED_DRAWS":"64","APS5_SKIP_REFUSED_DISPATCHES":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_SKIP_SHADER_FILE":"run287_skip.txt","APS5_SPLIT_DEFER_CALLEES":"1","APS5_SPLIT_TABLE_CALLS":"1","APS5_TRACE_SECONDS":"0:100","APS5_TRACE_TRIGGER_FILE":"<path>"},"gpu":"AMD Radeon RX 9070","driver":"AMD proprietary driver 26.11.2 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5950X 16-Core Processor","cpu_threads":32,"memory_mib":32687,"title_id":"PPSA01317","title":"Gran Turismo® 7","content_version":"01.710.000","resolution":"3840x2160","window":{"spec":"seconds 0:100","first_present":7201,"ms":100254.034},"presents":286,"frame_ms":{"p50":33.513,"p90":1661.803,"p99":2312.045,"max":22776.469},"gpu_busy_ms_per_present":107.616,"worker_busy_pct":{"queue worker 0x50":0.704,"queue worker 0x0":91.941,"queue worker 0x51":1.195,"queue worker 0x2a":0.385,"queue worker 0x23":0.040,"queue worker 0x2b":2.153,"queue worker 0x4a":0.223,"queue worker 0x4b":0.153,"queue worker 0x22":0.490},"phase_totals_ms":{"Driver.Completion":8.991,"Driver.Dispatch":86686.248,"Driver.Dispatch.capture_resources":450.611,"Driver.Dispatch.decode_key_device_setup":2989.634,"Driver.Dispatch.lookup_cache":40.691,"Driver.Dispatch.materialize":112.691,"Driver.Dispatch.prepared_invocation":33.057,"Driver.Draw":6377.993,"Driver.Draw.device_setup":76.372,"Driver.Draw.draw_handed_off":481.015,"Driver.Draw.prepare":5813.393,"Driver.DrawFinish":5629.045,"Driver.DrawFinish.draw_enqueued":1383.121,"Driver.DrawFinish.post_compile_prepare":38.297,"Driver.DrawFinish.shader_compile_and_link":3975.352,"Driver.EndSubmission":283.542,"Driver.Packet":97121.556,"Driver.Packet.device_lock":25.235,"Driver.Packet.dispatch":86768.798,"Driver.Packet.draw":6397.857,"Driver.Packet.execute":162.647,"Driver.Packet.flush_between_packets":108.961,"Driver.Packet.memory_wait":2972.208,"Driver.Packet.pipeline_drain":88.488,"Driver.Packet.pipeline_prepare":38.217,"Driver.Packet.prepare_memory":394.175,"Driver.Packet.rendering_wait":0.232,"Driver.Present":429.667,"Driver.Present.acquire_image":177.350,"Driver.Present.device_setup":0.155,"Driver.Present.gpu_mutex_wait":3.971,"Driver.Present.inflight_wait":0.684,"Driver.Present.present_display_buffer":71.692,"Driver.Present.queue_present":39.310,"Driver.Present.release_and_callback":0.364,"Driver.Present.render_fence_wait":135.385,"Driver.Present.resize":0.476,"Driver.Present.validate":0.105,"Driver.Rewind":111.738,"Driver.SplitDispatch":72150.464,"Driver.SplitDispatch.capture":27334.148,"Driver.SplitLookup":80117.441,"Driver.SplitLookup.parts_for":6236.652,"Driver.Suspend":4.948,"GpuMutex.wait.dispatch":453.157,"GpuMutex.wait.draw":29.361,"GpuMutex.wait.end":249.902,"GpuMutex.wait.flush":7.385,"GpuMutex.wait.hook":21.341,"GpuMutex.wait.indirect":16.481,"GpuMutex.wait.label":112.490,"GpuMutex.wait.other":3.761,"GpuMutex.wait.present":3.264,"Graphics.Draw":7202.628,"Graphics.Draw.draw_and_resource_release":6477.300,"Graphics.Draw.index_upload":83.987,"Graphics.Draw.validate":386.550,"Graphics.Draw.vertex_upload":132.286,"Graphics.DrawWithRecipe":12.961,"Graphics.DrawWithRecipe.draw_and_resource_release":11.855,"Graphics.DrawWithRecipe.index_upload":0.023,"Graphics.DrawWithRecipe.validate":0.209,"Graphics.DrawWithRecipe.vertex_upload":0.729,"Graphics.Submit":1.245,"Graphics.Submit.command_end":0.062,"Graphics.Submit.queue_submit":1.174,"Graphics.Wait":116.610,"Graphics.Wait.fence_wait":116.596,"Recorder.Reap":95.986,"Recorder.Submit":526.201,"Recorder.Sync":26785.183,"Resources.Complete":4490.768,"Resources.Prepare":13820.772,"Shader.DrawStage":4000.462,"Shader.DrawStage.capture_resources":1438.123,"Shader.DrawStage.materialize":2264.881,"Shader.DrawStage.prepared_invocation":213.794,"Shader.PrepareArtifact":301.418,"Shader.Register":30.813,"Shader.ResolveAbi":432.659,"Shader.ResolveGraphicsAbi":90.916,"Shader.ResolveGraphicsStagesAbi":680.604,"VideoOut.Flip":453.191,"VideoOut.Flip.completion_mutex_wait":0.338,"VideoOut.Flip.config_mutex_wait":0.036,"VideoOut.Flip.frame_limit":0.151,"VideoOut.Flip.notify_game":6.772,"VideoOut.Flip.present":428.689,"VideoOut.Flip.validate":0.356,"VideoOut.Flip.vblank_wait":0.201,"VideoOut.Flip.window_prepare":0.475,"VideoOut.Flip.window_title":15.958,"Vulkan.Acquire":177.000,"Vulkan.Acquire.acquire_fence_wait":157.507,"Vulkan.Acquire.acquire_image":18.162,"Vulkan.Acquire.fence_reset":0.775,"Vulkan.Acquire.retired_swapchains":0.419,"Vulkan.ComputePipeline":979.501,"Vulkan.Dispatch":18015.923,"Vulkan.Dispatch.command_record":514.140,"Vulkan.Dispatch.shader_resources":17479.156,"Vulkan.DispatchRecipe":237.081,"Vulkan.DispatchRecipe.command_record":235.859,"Vulkan.DrawFromRecipe":13.090,"Vulkan.GraphicsPipeline":0.379,"Vulkan.GraphicsPipeline.modules_and_state":0.332,"Vulkan.GraphicsPipelinePrebuild":0.400,"Vulkan.Present":41.907,"Vulkan.Present.command_record_scale":25.988,"Vulkan.Present.pixel_upload":2.332,"Vulkan.Present.queue_submit":13.341,"Vulkan.QueuePresent":38.523,"Vulkan.QueuePresent.queue_present":38.032,"Vulkan.Retire":136.839,"Vulkan.Retire.wait":132.824},"top_phases_ms_per_frame":{"Driver.Packet":339.586,"Driver.Packet.dispatch":303.387,"Driver.Dispatch":303.099,"Driver.SplitLookup":280.131,"Driver.SplitDispatch":252.274,"Driver.SplitDispatch.capture":95.574,"Recorder.Sync":93.654,"Vulkan.Dispatch":62.993},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2560,"Graphics.Barrier.dcc-clear":1202,"Graphics.Barrier.dcc-keys":840,"Graphics.Barrier.dispatch-lead":48792,"Graphics.Barrier.dispatch-trail":43480,"Graphics.Barrier.draw":44302,"Graphics.Barrier.indirect-args":13893,"Graphics.Barrier.label-run":32560,"Graphics.Barrier.present-blit":571,"Graphics.Barrier.shadow-publish":3698,"Graphics.Barrier.staging-in":20666,"Graphics.Barrier.staging-out":9916,"Graphics.Barrier.storage-upload":28654,"Graphics.Barrier.storage-writeback":38090,"Graphics.BarrierMerged.dispatch-lead":22474,"Graphics.BarrierMerged.label-run":151,"Graphics.BarrierMerged.shadow-publish":2988,"Graphics.BarrierMerged.staging-in":9082,"Graphics.BarrierMerged.staging-out":9916,"Graphics.BarrierMerged.storage-writeback":12308,"Graphics.Copy":22459,"Graphics.Copy.bytes":57921654124,"Graphics.RenderPass":17955,"Graphics.RenderPass.Close.command":14965,"Graphics.RenderPass.Close.image":611,"Graphics.RenderPass.Close.key":345,"Graphics.RenderPass.Close.label":151,"Graphics.RenderPass.Close.new-batch":1883,"Graphics.RenderPass.Continued":75945},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":62.954,"events_lost":111068,"totals_full":false}},"trace":"aps5-trace-0114600e6d8c-19080.json.gz"}
{"commit":"d24d6e5c38d8","dirty":false,"env":{"APS5_ASYNC_COMPUTE_WORDS":"0","APS5_ASYNC_DRAW_COMPILE":"1","APS5_ASYNC_PIPELINE_WORDS":"50000","APS5_BATCH_CAP":"64","APS5_DRAW_PIPELINE":"1","APS5_GPU_CHECKPOINTS":"1","APS5_LOCAL_A2C_UNDITHERED":"1","APS5_LOCAL_MSAA_STALE_READ":"1","APS5_LOCAL_RETIRE_PARTIAL_FMASK_FILL":"1","APS5_LOCAL_SKIP_STATE_REFUSALS":"1","APS5_LOOP_GUARD":"65536","APS5_MAX_COMPUTE_SPIRV_WORDS":"1000000","APS5_NO_PIPELINE_LTO":"1","APS5_PIPELINED_DRAWS":"64","APS5_SKIP_REFUSED_DISPATCHES":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_SKIP_SHADER_FILE":"run287_skip.txt","APS5_SPLIT_DEFER_CALLEES":"1","APS5_SPLIT_TABLE_CALLS":"1","APS5_TRACE_SECONDS":"0:100","APS5_TRACE_TRIGGER_FILE":"<path>"},"gpu":"AMD Radeon RX 9070","driver":"AMD proprietary driver 26.11.2 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5950X 16-Core Processor","cpu_threads":32,"memory_mib":32687,"title_id":"PPSA01317","title":"Gran Turismo® 7","content_version":"01.710.000","resolution":"3840x2160","window":{"spec":"seconds 0:100","first_present":7223,"ms":100396.915},"presents":286,"frame_ms":{"p50":33.474,"p90":478.223,"p99":2830.182,"max":26379.738},"gpu_busy_ms_per_present":142.757,"worker_busy_pct":{"queue worker 0x50":0.629,"queue worker 0x51":1.084,"queue worker 0x0":92.046,"queue worker 0x2a":0.354,"queue worker 0x2b":2.661,"queue worker 0x23":0.040,"queue worker 0x4a":0.234,"queue worker 0x4b":0.130,"queue worker 0x22":0.489},"phase_totals_ms":{"Driver.Completion":9.172,"Driver.Dispatch":87373.598,"Driver.Dispatch.capture_resources":420.478,"Driver.Dispatch.decode_key_device_setup":2943.422,"Driver.Dispatch.lookup_cache":34.577,"Driver.Dispatch.materialize":110.387,"Driver.Dispatch.prepared_invocation":29.082,"Driver.Draw":5862.858,"Driver.Draw.device_setup":70.846,"Driver.Draw.draw_handed_off":458.271,"Driver.Draw.prepare":5326.093,"Driver.DrawFinish":5207.735,"Driver.DrawFinish.draw_enqueued":1191.558,"Driver.DrawFinish.post_compile_prepare":33.869,"Driver.DrawFinish.shader_compile_and_link":3722.555,"Driver.EndSubmission":202.173,"Driver.Packet":97731.108,"Driver.Packet.device_lock":23.478,"Driver.Packet.dispatch":87445.623,"Driver.Packet.draw":5881.690,"Driver.Packet.execute":149.132,"Driver.Packet.flush_between_packets":97.904,"Driver.Packet.memory_wait":3468.997,"Driver.Packet.pipeline_drain":93.382,"Driver.Packet.pipeline_prepare":35.684,"Driver.Packet.prepare_memory":383.847,"Driver.Packet.rendering_wait":0.233,"Driver.Present":412.365,"Driver.Present.acquire_image":179.818,"Driver.Present.device_setup":0.141,"Driver.Present.gpu_mutex_wait":10.578,"Driver.Present.inflight_wait":0.697,"Driver.Present.present_display_buffer":73.447,"Driver.Present.queue_present":42.631,"Driver.Present.release_and_callback":0.355,"Driver.Present.render_fence_wait":103.941,"Driver.Present.resize":0.490,"Driver.Present.validate":0.098,"Driver.Rewind":106.229,"Driver.SplitDispatch":74263.675,"Driver.SplitDispatch.capture":29287.982,"Driver.SplitLookup":81160.394,"Driver.SplitLookup.parts_for":5040.290,"Driver.Suspend":4.519,"GpuMutex.wait.dispatch":394.678,"GpuMutex.wait.draw":33.057,"GpuMutex.wait.end":119.853,"GpuMutex.wait.flush":2.869,"GpuMutex.wait.hook":173.597,"GpuMutex.wait.indirect":11.706,"GpuMutex.wait.label":249.529,"GpuMutex.wait.other":80.260,"GpuMutex.wait.present":9.833,"Graphics.Draw":6488.325,"Graphics.Draw.draw_and_resource_release":5848.118,"Graphics.Draw.index_upload":75.028,"Graphics.Draw.validate":420.551,"Graphics.Draw.vertex_upload":110.747,"Graphics.DrawWithRecipe":11.458,"Graphics.DrawWithRecipe.draw_and_resource_release":10.451,"Graphics.DrawWithRecipe.index_upload":0.023,"Graphics.DrawWithRecipe.validate":0.203,"Graphics.DrawWithRecipe.vertex_upload":0.647,"Graphics.Submit":0.780,"Graphics.Submit.command_end":0.037,"Graphics.Submit.queue_submit":0.737,"Graphics.Wait":61.166,"Graphics.Wait.fence_wait":61.157,"Recorder.Reap":92.693,"Recorder.Submit":459.236,"Recorder.Sync":36998.295,"Resources.Complete":4272.897,"Resources.Prepare":3057.873,"Shader.DrawStage":3760.865,"Shader.DrawStage.capture_resources":1286.581,"Shader.DrawStage.materialize":2188.066,"Shader.DrawStage.prepared_invocation":193.166,"Shader.PrepareArtifact":148.741,"Shader.Register":30.897,"Shader.ResolveAbi":327.571,"Shader.ResolveGraphicsAbi":85.407,"Shader.ResolveGraphicsStagesAbi":413.053,"VideoOut.Flip":436.838,"VideoOut.Flip.completion_mutex_wait":0.340,"VideoOut.Flip.config_mutex_wait":0.035,"VideoOut.Flip.frame_limit":0.150,"VideoOut.Flip.notify_game":5.319,"VideoOut.Flip.present":411.219,"VideoOut.Flip.validate":0.382,"VideoOut.Flip.vblank_wait":0.191,"VideoOut.Flip.window_prepare":0.535,"VideoOut.Flip.window_title":18.457,"Vulkan.Acquire":179.466,"Vulkan.Acquire.acquire_fence_wait":160.477,"Vulkan.Acquire.acquire_image":17.623,"Vulkan.Acquire.fence_reset":0.801,"Vulkan.Acquire.retired_swapchains":0.430,"Vulkan.ComputePipeline":6.028,"Vulkan.Dispatch":7352.696,"Vulkan.Dispatch.command_record":464.080,"Vulkan.Dispatch.shader_resources":6867.181,"Vulkan.DispatchRecipe":224.546,"Vulkan.DispatchRecipe.command_record":223.561,"Vulkan.DrawFromRecipe":11.577,"Vulkan.GraphicsPipeline":0.252,"Vulkan.GraphicsPipeline.modules_and_state":0.212,"Vulkan.GraphicsPipelinePrebuild":0.268,"Vulkan.Present":42.050,"Vulkan.Present.command_record_scale":26.078,"Vulkan.Present.pixel_upload":2.078,"Vulkan.Present.queue_submit":13.637,"Vulkan.QueuePresent":41.846,"Vulkan.QueuePresent.queue_present":41.068,"Vulkan.Retire":104.974,"Vulkan.Retire.wait":101.501},"top_phases_ms_per_frame":{"Driver.Packet":341.717,"Driver.Packet.dispatch":305.754,"Driver.Dispatch":305.502,"Driver.SplitLookup":283.778,"Driver.SplitDispatch":259.663,"Recorder.Sync":129.365,"Driver.SplitDispatch.capture":102.406,"Vulkan.Dispatch":25.709},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":2175,"Graphics.Barrier.dcc-clear":1156,"Graphics.Barrier.dcc-keys":836,"Graphics.Barrier.dispatch-lead":46714,"Graphics.Barrier.dispatch-trail":40059,"Graphics.Barrier.draw":40083,"Graphics.Barrier.indirect-args":13597,"Graphics.Barrier.label-run":30429,"Graphics.Barrier.present-blit":571,"Graphics.Barrier.shadow-publish":3146,"Graphics.Barrier.staging-in":19865,"Graphics.Barrier.staging-out":9510,"Graphics.Barrier.storage-upload":25439,"Graphics.Barrier.storage-writeback":33274,"Graphics.BarrierMerged.dispatch-lead":20539,"Graphics.BarrierMerged.label-run":141,"Graphics.BarrierMerged.shadow-publish":2582,"Graphics.BarrierMerged.staging-in":8657,"Graphics.BarrierMerged.staging-out":9510,"Graphics.BarrierMerged.storage-writeback":10958,"Graphics.Copy":22502,"Graphics.Copy.bytes":51057706884,"Graphics.RenderPass":16632,"Graphics.RenderPass.Close.command":13815,"Graphics.RenderPass.Close.image":593,"Graphics.RenderPass.Close.key":337,"Graphics.RenderPass.Close.label":141,"Graphics.RenderPass.Close.new-batch":1743,"Graphics.RenderPass.Continued":69914},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":67.822,"events_lost":72992,"totals_full":false}},"trace":"aps5-trace-d24d6e5c38d8-25036.json.gz"}
tools/trace_digest.py, without

285 frames over 98460.1 ms (no summary line found)

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 111068 events lost; buffer full at 62953.6 ms; over the 264 of 285 frames that ended before it: busy 202.1 ms per frame (86 %), wait 28.5, largest Driver.Packet 201.8, Driver.Rewind 0.3 (the thread table divides the retained slices by every frame)

Slowest frames (largest slices inside each, inclusive)

  • present 7456: 22776.5 ms at 25970 ms: Driver.WorkerWait (queue worker 0x4b) 22776.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 22776.5, Driver.WorkerWait (queue worker 0x50) 22776.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x50) 22776.2
  • present 7436: 2588.4 ms at 12972 ms: Driver.WorkerWait (queue worker 0x4a) 2588.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4a) 2588.4, Driver.WorkerWait (queue worker 0x23) 2588.1, Driver.WorkerWait (queue worker 0x50) 2588.1
  • present 7453: 2312.0 ms at 21588 ms: Driver.WorkerWait (queue worker 0x23) 2312.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x23) 2312.0, Driver.WorkerWait (queue worker 0x4a) 2312.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4a) 2312.0
  • present 7435: 2015.3 ms at 10956 ms: Driver.WorkerWait (queue worker 0x50) 2015.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x50) 2015.0, Driver.WorkerWait (queue worker 0x23) 2014.7, Driver.WorkerWait (queue worker 0x2b) 2014.2
  • present 7473: 1990.7 ms at 75135 ms: Driver.WorkerWait (queue worker 0x23) 1990.4, Driver.WorkerWait (queue worker 0x2b) 1987.5, Driver.WorkerWait (queue worker 0x2a) 1985.2, Driver.WorkerWait (queue worker 0x22) 1981.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 7456: 22776.5 ms at 25970 ms, persistence 22760.9 ms
  • present 7436: 2588.4 ms at 12972 ms, persistence 2352.3 ms
  • present 7453: 2312.0 ms at 21588 ms, persistence 1859.6 ms
  • present 7473: 1990.7 ms at 75135 ms, persistence 615.2 ms
  • present 7220: 479.7 ms at 2090 ms, persistence 455.2 ms
  • present 7485: 1867.4 ms at 96593 ms, persistence 191.2 ms
  • present 7393: 186.2 ms at 8396 ms, persistence 161.2 ms
  • present 7459: 1759.8 ms at 51587 ms, persistence 156.2 ms
  • present 7402: 152.7 ms at 8927 ms, persistence 122.4 ms
  • present 7451: 741.9 ms at 20222 ms, persistence 117.6 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Shader.PrepareArtifact 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Shader.PrepareArtifact 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Recorder.Submit 0.0
shader prepare 0.4 (0 %) 0.0 (0 %) 345.1 0.0 Vulkan.ComputePipeline 0.4
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.5 (0 %) 0.0 (0 %) 345.0 0.0 Vulkan.ComputePipeline 0.5
shader prepare 0.1 (0 %) 0.0 (0 %) 345.3 0.0 Vulkan.ComputePipeline 0.1
shader prepare 0.1 (0 %) 0.0 (0 %) 345.4 0.0 Vulkan.ComputePipeline 0.1
shader prepare 1.6 (0 %) 0.0 (0 %) 343.9 0.0 Vulkan.ComputePipeline 1.6
shader prepare 0.1 (0 %) 0.0 (0 %) 345.4 0.0 Vulkan.ComputePipeline 0.1
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 345.5 0.0
shader prepare 0.6 (0 %) 0.0 (0 %) 344.9 0.0 Vulkan.ComputePipeline 0.6, Vulkan.GraphicsPipelinePrebuild 0.0
queue worker 0x50 0.4 (0 %) 345.0 (100 %) 0.1 0.3 Driver.Packet 2.1, Driver.EndSubmission 0.2
queue worker 0x0 191.5 (55 %) 26.4 (8 %) 127.5 9.8 Driver.Packet 190.9, Driver.Rewind 0.3
queue worker 0x51 0.1 (0 %) 345.3 (100 %) 0.1 0.0 Driver.Packet 3.4, Driver.EndSubmission 0.7
draw committer 24.9 (7 %) 0.4 (0 %) 320.2 6.2 Graphics.Draw 24.3, Recorder.Submit 0.4
presenter 0.6 (0 %) 1.0 (0 %) 343.9 0.0 VideoOut.Flip 1.6, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 345.3 0.2 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Shader.Register 0.0, Recorder.Submit 0.0
title 0.0 (0 %) 0.0 (0 %) 345.5 0.0 Shader.Register 0.0, Recorder.Submit 0.0
draw finisher 17.7 (5 %) 0.0 (0 %) 327.8 15.1 Driver.DrawFinish 17.7
title 0.0 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.7 (0 %) 0.0 (0 %) 344.8 0.1 Shader.ResolveGraphicsStagesAbi 0.6, Shader.ResolveAbi 0.0
title 1.2 (0 %) 0.0 (0 %) 344.3 0.1 Shader.ResolveGraphicsStagesAbi 0.7, Shader.ResolveAbi 0.5
title 0.0 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.3 (0 %) 0.0 (0 %) 345.1 0.1 Shader.ResolveGraphicsStagesAbi 0.2, Shader.ResolveAbi 0.1
title 0.1 (0 %) 0.0 (0 %) 345.4 0.1 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x2a 1.1 (0 %) 344.3 (100 %) 0.0 0.3 Driver.Packet 1.3, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 345.5 0.1 Shader.Register 0.0
queue worker 0x23 0.1 (0 %) 344.9 (100 %) 0.5 0.0 Driver.Packet 0.1, Driver.EndSubmission 0.0
queue worker 0x2b 1.4 (0 %) 343.5 (99 %) 0.5 0.5 Driver.Packet 7.5, Driver.Completion 0.0
queue worker 0x4a 0.5 (0 %) 57.8 (17 %) 287.1 0.8 Driver.Packet 0.6, Driver.Completion 0.0
queue worker 0x4b 0.2 (0 %) 245.0 (71 %) 100.3 0.1 Driver.Packet 0.5, Driver.EndSubmission 0.0
queue worker 0x22 1.5 (0 %) 273.8 (79 %) 70.2 0.5 Driver.Packet 1.6, Driver.Completion 0.0
gpu 107.4 (31 %) 0.0 (0 %) 238.1 0.0 batch 107.4

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 2313.2, Driver.WorkerWait.dequeue_order 1201.5, Driver.WorkerWait.idle_and_completion_poll 1111.7, Driver.Packet 208.1, Driver.Packet.dispatch 178.7, Driver.Dispatch 178.2, Driver.SplitLookup 159.6, Driver.SplitDispatch 144.1, batch 107.4, Recorder.Sync 62.4

Longest waits

  • Driver.WorkerWait (queue worker 0x4b) 48840.8 ms at 21167 ms, present 7452
  • Driver.WorkerWait (queue worker 0x50) 22778.9 ms at 25978 ms, present 7456
  • Driver.WorkerWait (queue worker 0x51) 22777.3 ms at 25980 ms, present 7456
  • Driver.WorkerWait (queue worker 0x23) 22773.5 ms at 25969 ms, present 7455
  • Driver.WorkerWait (queue worker 0x2b) 22769.8 ms at 25973 ms, present 7456
  • Driver.WorkerWait (queue worker 0x2a) 22767.3 ms at 25975 ms, present 7456
  • Driver.WorkerWait (queue worker 0x22) 22765.7 ms at 25977 ms, present 7456
  • Driver.WorkerWait (queue worker 0x4a) 10577.8 ms at 11009 ms, present 7435
  • Driver.WorkerWait (queue worker 0x4b) 7392.0 ms at 1886 ms, present 7215
  • Driver.WorkerWait (queue worker 0x23) 7037.0 ms at 1885 ms, present 7215

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

  • batch 3947: 716.4 ms at 30044 ms, present 7456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 717.4, Vulkan.Dispatch (queue worker 0x0) 583.4, Vulkan.Dispatch.shader_resources (queue worker 0x0) 578.7, Resources.Prepare (queue worker 0x0) 503.8
  • batch 3949: 707.1 ms at 31332 ms, present 7456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 708.2, Vulkan.Dispatch (queue worker 0x0) 542.4, Vulkan.Dispatch.shader_resources (queue worker 0x0) 538.7, Resources.Prepare (queue worker 0x0) 475.2
  • batch 3951: 704.7 ms at 32600 ms, present 7456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 705.8, Vulkan.Dispatch (queue worker 0x0) 532.1, Vulkan.Dispatch.shader_resources (queue worker 0x0) 528.5, Resources.Prepare (queue worker 0x0) 465.6
  • batch 3953: 703.5 ms at 33875 ms, present 7456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 704.5, Vulkan.Dispatch (queue worker 0x0) 540.9, Vulkan.Dispatch.shader_resources (queue worker 0x0) 537.5, Resources.Prepare (queue worker 0x0) 468.1
  • batch 3955: 702.0 ms at 35160 ms, present 7456: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 703.1, Vulkan.Dispatch (queue worker 0x0) 551.7, Vulkan.Dispatch.shader_resources (queue worker 0x0) 547.8, Resources.Prepare (queue worker 0x0) 482.9
tools/trace_digest.py, with

285 frames over 98000.0 ms (no summary line found)

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 72992 events lost; buffer full at 67822.0 ms; over the 272 of 285 frames that ended before it: busy 209.4 ms per frame (87 %), wait 27.6, largest Driver.Packet 209.1, Driver.Rewind 0.3 (the thread table divides the retained slices by every frame)

Slowest frames (largest slices inside each, inclusive)

  • present 7489: 26379.7 ms at 26337 ms: Driver.WorkerWait (queue worker 0x4b) 26379.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 26379.7, Driver.WorkerWait (queue worker 0x23) 26379.4, Driver.WorkerWait (queue worker 0x50) 26379.3
  • present 7469: 2845.7 ms at 13440 ms: Driver.WorkerWait (queue worker 0x4a) 2845.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4a) 2845.7, Driver.WorkerWait (queue worker 0x23) 2845.4, Driver.WorkerWait (queue worker 0x50) 2845.4
  • present 7504: 2830.2 ms at 87900 ms: Driver.WorkerWait (queue worker 0x23) 2830.0, Driver.WorkerWait (queue worker 0x2b) 2827.7, Driver.WorkerWait (queue worker 0x2a) 2826.6, Driver.WorkerWait (queue worker 0x22) 2815.3
  • present 7496: 2762.1 ms at 67834 ms: Driver.WorkerWait (queue worker 0x4b) 2762.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 2762.1, Driver.WorkerWait (queue worker 0x50) 2761.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x50) 2761.9
  • present 7491: 2666.0 ms at 55288 ms: Driver.WorkerWait (queue worker 0x4b) 2666.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 2666.0, Driver.WorkerWait (queue worker 0x23) 2665.8, Driver.WorkerWait (queue worker 0x50) 2665.7

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 7489: 26379.7 ms at 26337 ms, persistence 26364.1 ms
  • present 7469: 2845.7 ms at 13440 ms, persistence 2617.1 ms
  • present 7504: 2830.2 ms at 87900 ms, persistence 547.0 ms
  • present 7242: 488.8 ms at 2071 ms, persistence 464.1 ms
  • present 7487: 2165.7 ms at 22455 ms, persistence 450.1 ms
  • present 7496: 2762.1 ms at 67834 ms, persistence 383.3 ms
  • present 7484: 756.0 ms at 20808 ms, persistence 342.4 ms
  • present 7416: 184.0 ms at 8410 ms, persistence 159.2 ms
  • present 7436: 181.9 ms at 9303 ms, persistence 153.8 ms
  • present 7471: 762.2 ms at 16924 ms, persistence 123.9 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.0 (0 %) 0.0 (0 %) 343.8 0.0 Shader.PrepareArtifact 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.8 0.0 Shader.PrepareArtifact 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.8 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0 Vulkan.GraphicsPipelinePrebuild 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 343.9 0.0 Recorder.Submit 0.0
queue worker 0x50 0.5 (0 %) 343.3 (100 %) 0.1 0.3 Driver.Packet 1.9, Driver.EndSubmission 0.2
queue worker 0x51 0.1 (0 %) 343.7 (100 %) 0.1 0.0 Driver.Packet 3.3, Driver.EndSubmission 0.5
queue worker 0x0 208.6 (61 %) 26.4 (8 %) 108.9 9.9 Driver.Packet 208.4, Driver.Rewind 0.3
draw committer 22.4 (7 %) 0.9 (0 %) 320.6 5.6 Graphics.Draw 21.9, Recorder.Submit 0.4
presenter 0.6 (0 %) 0.9 (0 %) 342.3 0.0 VideoOut.Flip 1.5, Driver.Present 0.0
title 0.4 (0 %) 0.6 (0 %) 342.9 0.2 Shader.ResolveGraphicsStagesAbi 0.2, Shader.ResolveAbi 0.1
title 0.1 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 343.9 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 343.9 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.3 (0 %) 343.6 0.1 Shader.Register 0.0, Recorder.Submit 0.0
draw finisher 16.3 (5 %) 0.0 (0 %) 327.5 14.0 Driver.DrawFinish 16.3
title 0.6 (0 %) 0.0 (0 %) 343.3 0.1 Shader.ResolveGraphicsStagesAbi 0.4, Shader.ResolveAbi 0.2
title 0.0 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 343.7 0.1 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.2 (0 %) 0.0 (0 %) 343.7 0.1 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.1
title 0.1 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 343.8 0.1 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x2a 1.1 (0 %) 342.8 (100 %) 0.0 0.3 Driver.Packet 1.2, Driver.EndSubmission 0.0
queue worker 0x2b 1.4 (0 %) 341.9 (99 %) 0.5 0.4 Driver.Packet 9.3, Driver.EndSubmission 0.0
queue worker 0x23 0.1 (0 %) 343.3 (100 %) 0.4 0.0 Driver.Packet 0.1, Driver.EndSubmission 0.0
queue worker 0x4a 0.5 (0 %) 82.9 (24 %) 260.5 0.8 Driver.Packet 0.6, Driver.Completion 0.0
queue worker 0x4b 0.2 (0 %) 299.1 (87 %) 44.6 0.1 Driver.Packet 0.5, Driver.EndSubmission 0.0
title 0.0 (0 %) 0.0 (0 %) 343.8 0.0 Shader.Register 0.0
queue worker 0x22 1.5 (0 %) 270.2 (79 %) 72.2 0.3 Driver.Packet 1.6, Driver.Completion 0.0
gpu 142.7 (41 %) 0.0 (0 %) 201.2 0.0 batch 142.7

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 2379.5, Driver.WorkerWait.dequeue_order 1206.3, Driver.WorkerWait.idle_and_completion_poll 1173.1, Driver.Packet 226.9, Driver.Packet.dispatch 195.8, Driver.Dispatch 195.4, Driver.SplitLookup 176.5, Driver.SplitDispatch 161.5, batch 142.7, Recorder.Sync 101.5

Longest waits

  • Driver.WorkerWait (queue worker 0x4b) 63800.1 ms at 21609 ms, present 7485
  • Driver.WorkerWait (queue worker 0x23) 26379.4 ms at 26334 ms, present 7488
  • Driver.WorkerWait (queue worker 0x2a) 26374.4 ms at 26339 ms, present 7489
  • Driver.WorkerWait (queue worker 0x2b) 26370.2 ms at 26343 ms, present 7489
  • Driver.WorkerWait (queue worker 0x50) 26358.6 ms at 26375 ms, present 7489
  • Driver.WorkerWait (queue worker 0x51) 26355.6 ms at 26378 ms, present 7489
  • Driver.WorkerWait (queue worker 0x22) 26340.5 ms at 26373 ms, present 7489
  • Driver.WorkerWait (queue worker 0x4a) 10635.8 ms at 11404 ms, present 7468
  • Driver.WorkerWait (queue worker 0x4a) 8410.3 ms at 889 ms, present 7229
  • Driver.WorkerWait (queue worker 0x4b) 7802.8 ms at 1862 ms, present 7237

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

  • batch 4142: 1482.4 ms at 42297 ms, present 7489: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 1483.4, Vulkan.Dispatch (queue worker 0x0) 81.0, Vulkan.Dispatch.shader_resources (queue worker 0x0) 77.7, Resources.Complete (queue worker 0x0) 32.4
  • batch 4126: 1469.8 ms at 30175 ms, present 7489: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 1470.3, Vulkan.Dispatch (queue worker 0x0) 114.1, Vulkan.Dispatch.shader_resources (queue worker 0x0) 110.1, Resources.Prepare (queue worker 0x0) 44.9
  • batch 4140: 1425.4 ms at 40764 ms, present 7489: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 1426.4, Vulkan.Dispatch (queue worker 0x0) 79.0, Vulkan.Dispatch.shader_resources (queue worker 0x0) 75.8, Resources.Complete (queue worker 0x0) 31.8
  • batch 4144: 1407.3 ms at 43890 ms, present 7489: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 1408.4, Vulkan.Dispatch (queue worker 0x0) 84.7, Vulkan.Dispatch.shader_resources (queue worker 0x0) 81.0, Resources.Complete (queue worker 0x0) 33.4
  • batch 4130: 1400.9 ms at 33255 ms, present 7489: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 1402.0, Vulkan.Dispatch (queue worker 0x0) 83.7, Vulkan.Dispatch.shader_resources (queue worker 0x0) 80.1, Resources.Complete (queue worker 0x0) 33.2

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 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: AMD Radeon RX 9070, AMD driver 2.0.416 (Vulkan 1.4.359), Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

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

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed — looks good

Nothing blocks this change; the review found no verified defect in the inspected sampler-verdict cache logic.

What I ran

Reviewed head ccb2df2dd6442a9141774fd7e23a75e45f92b481. No commands or tests were run; repository context was read with repo_read.py.

Results

Check Result Note
Diff and changed code passed One changed source file inspected
Tests not run Author-reported test results were not independently verified

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full test suite, reported Windows build and Vulkan validation run, performance measurements, and behavior outside the inspected code were not verified. files.json was not available in the review folder; the manifest identifies ShaderResources.cpp as excluded from the folder because it is too large. Its relevant source range and the sampler-table caller were read through repo_read.py.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line agc libSceAgc* labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown

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

@Doorriiaann

Copy link
Copy Markdown
Contributor

NVIDIA run on Linux: no regression in the sampler and image table tests.

Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base 07336cc, head is ccb2df2. ANYPS5_GPU=NVIDIA ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest -R '(sampler|image_table)' -V, 2 runs each.

base this PR
all 41 matching tests 82/82 pass 82/82 pass

Every Vulkan test's log selects the RTX 3070 and shows the layer inserted, none reports it missing, and no log has a VUID- line.

AI-assisted: yes

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Remi-Bon on head ccb2df2 merged onto main b9c8230, three tests fail on their own with the same check: agc_driver_graphics, agc_driver_graphics_maps_fallback and agc_graphics_profile_draw all stop at "AGC graphics: non-seamless sampler table has the wrong deferred poison count". They pass on main without this PR. It looks like the remembered verdict skips a deferred poison count that a non-seamless sampler table entry still needs. I have held the PR until a head passes those three.

…e context address

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

Copy link
Copy Markdown
Contributor

Head ccb2df2dd6 merged onto main 7482424113: blocking. The verdict cache key does not cover every input of the verdict, and agc_driver_graphics and agc_graphics_profile_draw fail 3/3 on AMD. This reproduces oneandonlydean's finding. The AGENTS.md speed evidence is missing.

Code.

  • addSamplerTable (Graphics/src/ShaderResources.cpp:6259, merge 679382f362) keys the memo on three things: &context, the entry's guest words and its depth-compare flags.
  • context is the Context context; member of ShaderResources (ShaderResources.hpp:713). So the first part of the key is the address of the ShaderResources object, not the identity or the content of the device context. A new ShaderResources at a reused stack or heap address gets the old object's verdicts.
  • The verdict also reads context fields that are not in the key:
    • nonSeamlessCubeMap, in the Require at :6282;
    • samplerAnisotropy, limits.maxSamplerAnisotropy, limits.maxSamplerLodBias, samplerMirrorClampToEdge and samplerFilterMinmax, through Sampler::Validate (Sampler.cpp:15-27).
    • A context with different features at the same address therefore gets the other context's verdict, in either direction.
  • The memo is a function-local static. It outlives every context, and verdicts.clear() runs only at 65536 entries.
  • samplerTableCapacity is checked before the lookup, so a capacity rejection is never cached or served stale.
  • No code comments, no debt change, no title-specific path. check_conventions.py --base 7482424113 and debt_fold.py --check pass on the merge.

Speed evidence. Missing.

  • AGENTS.md asks for tools/trace_digest.py summaries of main and of the change, from the same machine and scene.
  • The description reports addSamplerTable samples going from 654 to 163 in PPSA01317 (Café scene). The author says that tree carried other unmerged work and was "not a main vs change tools/trace_digest.py comparison".
  • The github-actions bot asked for both summary lines and traces. None are posted.

Existing runs.

  • The author ran -R "sampler|image_table", 46/46 on an RX 9070. That pattern does not select the two failing tests.
  • Doorriiaann: RTX 3070 on Linux, 41 matching tests pass on base 07336cc200 and on head, no VUID-. The same pattern limit applies.
  • oneandonlydean, on head merged onto main b9c8230488: agc_driver_graphics, agc_driver_graphics_maps_fallback and agc_graphics_profile_draw fail with "non-seamless sampler table has the wrong deferred poison count". He has held the PR.
  • MarcZX10 approved with no findings. He ran nothing.
  • This run adds:
    • the same failure on AMD Windows, on a newer main;
    • a probe that shows the cause is a verdict carried over between contexts, not a missing poison count in the cached path.

Probe.

  • samplerTableNonSeamlessCubeTests (tests/Graphics.cpp:8479) loops supported over {false, true}. Each pass builds auto context = mockContext(); and a stack ShaderResources at the same address, with the same guest words.
  • I made a local, uncommitted change: the loop follows GPUB_ORDER (f = false, t = true), and a --gpub-nonseamless argument runs only this test. I ran the test executable directly.
order main 7482424113 head
ft (the test's order) ok fails: wrong deferred poison count
tf ok fails: wrong deferred poison count
f ok ok
t ok ok
ff ok ok
tt ok ok
  • Every order on its own, and every repeat of the same context, passes. Only a change of nonSeamlessCubeMap at the same address fails.
  • ft is a stale rejection: with the feature present, an entry is poisoned because an earlier context lacked the feature.
  • tf is a stale acceptance: with the feature missing, the non-seamless entry is accepted and bound instead of poisoned (poison count 0, test expects 1). The test fails only on the count check; it does not show what sampler is bound.
  • In a title with one device these fields do not change between draws, so I expect the stale verdict to be the right one there. I did not test a title. Any process that builds contexts with different features (the test suite does) gets wrong verdicts.
  • One possible fix: key on the context fields the verdict reads instead of the address, or keep the memo in the Context or device and drop it with them.

Negative control. None needed. The PR adds no test, and the existing test fails on head and passes on main.

GPU.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R "^(agc_driver_graphics|agc_graphics_profile_draw|agc_driver_nested_sampler_table|agc_driver_pointer_phi_sampler_table)$" -V
run agc_driver_graphics (CPU) agc_graphics_profile_draw (CPU) nested_sampler_table pointer_phi_sampler_table
main Passed 10.90 s Passed 11.19 s Passed 1.03 s Passed 0.52 s
head 1 Failed 0.47 s Failed 0.48 s Passed 0.34 s Passed 0.33 s
head 2 Failed 0.46 s Failed 0.47 s Passed 0.29 s Passed 0.41 s
head 3 Failed 0.46 s Failed 0.46 s Passed 0.32 s Passed 0.41 s
  • (CPU) marks tests that run on the mock Vulkan and create no device. Both fail at the poison count check (tests/Graphics.cpp, samplerTableNonSeamlessCubeTests), so the rest of each suite did not run on head.
  • agc_driver_graphics_maps_fallback is registered only on Linux and does not exist in this Windows build.
  • No test skipped. The main run was the first after a rebuild, so its times are not comparable with the head times.

Validation.

  • Each log has 2 Insert instance layer "VK_LAYER_KHRONOS_validation" lines, from the two GPU tests.
  • was not found but was requested by env var VK_INSTANCE_LAYERS appears in none of them.
  • VUID- lines: 0 in every log, on main and head.

Host:

  • GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349
  • Validation layer: Khronos 1.4.363 (LunarG SDK)
  • CPU: Ryzen 9 9950X3D
  • OS: Windows 11 Pro 26300
  • Toolchain: WinLibs GCC 15.2, Release
  • Commits measured: main 7482424113; head 679382f362 (ccb2df2dd6 merged onto 7482424113)

AI-assisted: yes

@Remi-Bon

Copy link
Copy Markdown
Contributor Author

Speed capture: sampler table verdicts

Setup: Windows 11 (26300), AMD Radeon RX 9070, AMD proprietary driver 26.11.2 (LLPC), Ryzen 9 5950X, 32 GB. PPSA01317, Café scene, 3840x2160. Vulkan validation not loaded (speed captures).

main alone does not reach this scene (it stops at layered rendering with a depth target is unsupported, #7256), so this is not a main against change capture. It is an A/B inside one downstream tree (e2c5cb724bb5 plus uncommitted local split work, which carries this change), switching the change off or on with the setting named below. Both sides ran in the same session, after one warm-up run, one run each, APS5_TRACE_SECONDS=0:100 from the Café entry.

Common environment: APS5_ASYNC_COMPUTE_WORDS=0 APS5_SPLIT_TABLE_CALLS=1 APS5_SPLIT_DEFER_CALLEES=1 APS5_LOCAL_MSAA_STALE_READ=1 APS5_LOOP_GUARD=65536.

  • A, verdict lookup skipped (local test switch APS5_LOCAL_NO_SAMPLER_VERDICTS, memo still filled): no-verdicts
  • B, verdict memo used (default): gpu-rounds
A B
presents in the window 250 238
frame ms p50 / p90 / p99 / max 33.4 / 109.3 / 453.3 / 94451 33.5 / 120.5 / 473.9 / 87437
gpu busy ms per present 13.433 13.448

Phase totals over the window (ms, from the summary line):

phase A B change
Vulkan.Dispatch 7288 3208 -56.0 %
Vulkan.Dispatch.shader_resources 6707 2613 -61.0 %
Resources.Prepare 5209 1342 -74.2 %
Driver.SplitDispatch 93847 86706 -7.6 %

Result: Vulkan.Dispatch.shader_resources falls from 6707 ms to 2613 ms and Resources.Prepare from 5209 ms to 1342 ms over the window, which is where addSamplerTable runs. Driver.SplitDispatch is 8 % lower. This matches the CPU samples in the PR body (654 to 163).

Read this with care: one run per side, no repeat, so run-to-run noise is unmeasured. The worst frame is 87 to 94 s in all four captures (cold compile of split callee parts at Café entry), so frame percentiles above p99 say nothing about this change. tools/trace_digest.py output of both sides and the aps5-summary.jsonl lines are below; the two .json.gz traces are about 4.5 MB each, I can attach them on request.

aps5-summary.jsonl lines

verdict lookup skipped (local test switch APS5_LOCAL_NO_SAMPLER_VERDICTS, memo still filled):

{"commit":"e2c5cb724bb5","dirty":true,"env":{"APS5_ASYNC_COMPUTE_WORDS":"0","APS5_ASYNC_DRAW_COMPILE":"1","APS5_ASYNC_PIPELINE_WORDS":"50000","APS5_BATCH_CAP":"64","APS5_DRAW_PIPELINE":"1","APS5_GPU_CHECKPOINTS":"1","APS5_KEEP_SPECIALIZED_MIB":"1024","APS5_LOCAL_A2C_UNDITHERED":"1","APS5_LOCAL_MSAA_STALE_READ":"1","APS5_LOCAL_NO_SAMPLER_VERDICTS":"1","APS5_LOCAL_RETIRE_PARTIAL_FMASK_FILL":"1","APS5_LOCAL_SKIP_STATE_REFUSALS":"1","APS5_LOOP_GUARD":"65536","APS5_MAX_COMPUTE_SPIRV_WORDS":"1000000","APS5_NO_PIPELINE_LTO":"1","APS5_PIPELINED_DRAWS":"64","APS5_SKIP_REFUSED_DISPATCHES":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_SKIP_SHADER_FILE":"run287_skip.txt","APS5_SPLIT_CPU_ROUNDS":"1","APS5_SPLIT_DEFER_CALLEES":"1","APS5_SPLIT_TABLE_CALLS":"1","APS5_TRACE_SECONDS":"0:100","APS5_TRACE_TRIGGER_FILE":"<path>"},"gpu":"AMD Radeon RX 9070","driver":"AMD proprietary driver 26.11.2 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5950X 16-Core Processor","cpu_threads":32,"memory_mib":32687,"title_id":"PPSA01317","title":"Gran Turismo® 7","content_version":"01.710.000","resolution":"3840x2160","window":{"spec":"seconds 0:100","first_present":6893,"ms":107952.509},"presents":250,"frame_ms":{"p50":33.396,"p90":109.289,"p99":453.285,"max":94451.452},"gpu_busy_ms_per_present":13.433,"worker_busy_pct":{"queue worker 0x0":93.648,"queue worker 0x51":0.551,"queue worker 0x50":0.441,"queue worker 0x2a":0.273,"queue worker 0x23":0.083,"queue worker 0x2b":0.343,"queue worker 0x4a":0.114,"queue worker 0x4b":0.085},"phase_totals_ms":{"Driver.Completion":6.249,"Driver.Dispatch":98413.831,"Driver.Dispatch.capture_resources":80.869,"Driver.Dispatch.decode_key_device_setup":1030.412,"Driver.Dispatch.lookup_cache":18.599,"Driver.Dispatch.materialize":33.989,"Driver.Dispatch.prepared_invocation":12.321,"Driver.Draw":2959.207,"Driver.Draw.device_setup":37.446,"Driver.Draw.draw_handed_off":237.362,"Driver.Draw.prepare":2681.098,"Driver.DrawFinish":2476.877,"Driver.DrawFinish.draw_enqueued":845.027,"Driver.DrawFinish.post_compile_prepare":14.584,"Driver.DrawFinish.shader_compile_and_link":1498.574,"Driver.EndSubmission":181.324,"Driver.Packet":102879.853,"Driver.Packet.device_lock":12.940,"Driver.Packet.dispatch":98452.776,"Driver.Packet.draw":2969.664,"Driver.Packet.execute":76.821,"Driver.Packet.flush_between_packets":49.111,"Driver.Packet.memory_wait":871.421,"Driver.Packet.pipeline_drain":65.244,"Driver.Packet.pipeline_prepare":19.322,"Driver.Packet.prepare_memory":286.084,"Driver.Packet.rendering_wait":0.196,"Driver.Present":274.468,"Driver.Present.acquire_image":89.218,"Driver.Present.device_setup":0.145,"Driver.Present.gpu_mutex_wait":4.269,"Driver.Present.inflight_wait":0.697,"Driver.Present.present_display_buffer":66.863,"Driver.Present.queue_present":39.108,"Driver.Present.release_and_callback":0.292,"Driver.Present.render_fence_wait":73.158,"Driver.Present.resize":0.457,"Driver.Present.validate":0.092,"Driver.Rewind":61.573,"Driver.SplitDispatch":93847.013,"Driver.SplitDispatch.capture":1.710,"Driver.SplitLookup":95709.254,"Driver.SplitLookup.parts_for":1840.709,"Driver.Suspend":4.062,"GpuMutex.wait.dispatch":275.733,"GpuMutex.wait.draw":23.749,"GpuMutex.wait.end":151.442,"GpuMutex.wait.flush":17.502,"GpuMutex.wait.hook":6.971,"GpuMutex.wait.indirect":8.612,"GpuMutex.wait.label":81.078,"GpuMutex.wait.other":57.690,"GpuMutex.wait.present":3.607,"Graphics.Draw":2624.826,"Graphics.Draw.draw_and_resource_release":2406.402,"Graphics.Draw.index_upload":28.566,"Graphics.Draw.validate":111.810,"Graphics.Draw.vertex_upload":54.615,"Graphics.DrawWithRecipe":14.072,"Graphics.DrawWithRecipe.draw_and_resource_release":12.875,"Graphics.DrawWithRecipe.index_upload":0.032,"Graphics.DrawWithRecipe.validate":0.242,"Graphics.DrawWithRecipe.vertex_upload":0.767,"Graphics.Submit":0.265,"Graphics.Submit.command_end":0.013,"Graphics.Submit.queue_submit":0.250,"Graphics.Wait":16.730,"Graphics.Wait.fence_wait":16.727,"Recorder.Reap":58.249,"Recorder.Submit":385.917,"Recorder.Sync":68203.582,"Resources.Complete":1867.119,"Resources.Prepare":5209.368,"Shader.DrawStage":1495.566,"Shader.DrawStage.capture_resources":512.430,"Shader.DrawStage.materialize":837.213,"Shader.DrawStage.prepared_invocation":96.612,"Shader.PrepareArtifact":242.300,"Shader.Register":28.519,"Shader.ResolveAbi":220.678,"Shader.ResolveGraphicsAbi":32.353,"Shader.ResolveGraphicsStagesAbi":417.270,"VideoOut.Flip":292.778,"VideoOut.Flip.completion_mutex_wait":0.290,"VideoOut.Flip.config_mutex_wait":0.031,"VideoOut.Flip.frame_limit":0.137,"VideoOut.Flip.notify_game":3.502,"VideoOut.Flip.present":273.418,"VideoOut.Flip.validate":0.317,"VideoOut.Flip.vblank_wait":0.185,"VideoOut.Flip.window_prepare":0.377,"VideoOut.Flip.window_title":14.343,"Vulkan.Acquire":88.908,"Vulkan.Acquire.acquire_fence_wait":78.786,"Vulkan.Acquire.acquire_image":8.802,"Vulkan.Acquire.fence_reset":0.793,"Vulkan.Acquire.retired_swapchains":0.402,"Vulkan.ComputePipeline":616.881,"Vulkan.Dispatch":7287.983,"Vulkan.Dispatch.command_record":570.039,"Vulkan.Dispatch.shader_resources":6707.370,"Vulkan.DispatchRecipe":180.344,"Vulkan.DispatchRecipe.command_record":179.801,"Vulkan.DrawFromRecipe":14.214,"Vulkan.Present":38.587,"Vulkan.Present.command_record_scale":23.170,"Vulkan.Present.pixel_upload":1.781,"Vulkan.Present.queue_submit":13.420,"Vulkan.QueuePresent":38.541,"Vulkan.QueuePresent.queue_present":38.042,"Vulkan.Retire":75.109,"Vulkan.Retire.wait":71.354},"top_phases_ms_per_frame":{"Driver.Packet":411.519,"Driver.Packet.dispatch":393.811,"Driver.Dispatch":393.655,"Driver.SplitLookup":382.837,"Driver.SplitDispatch":375.388,"Recorder.Sync":272.814,"Vulkan.Dispatch":29.152,"Vulkan.Dispatch.shader_resources":26.829},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":726,"Graphics.Barrier.dcc-clear":864,"Graphics.Barrier.dcc-keys":698,"Graphics.Barrier.dispatch-lead":27774,"Graphics.Barrier.dispatch-trail":20234,"Graphics.Barrier.draw":21644,"Graphics.Barrier.indirect-args":8581,"Graphics.Barrier.label-run":17864,"Graphics.Barrier.present-blit":499,"Graphics.Barrier.shadow-publish":1226,"Graphics.Barrier.staging-in":10012,"Graphics.Barrier.staging-out":4733,"Graphics.Barrier.storage-upload":12508,"Graphics.Barrier.storage-writeback":15349,"Graphics.BarrierMerged.dispatch-lead":9622,"Graphics.BarrierMerged.label-run":75,"Graphics.BarrierMerged.shadow-publish":948,"Graphics.BarrierMerged.staging-in":4187,"Graphics.BarrierMerged.staging-out":4733,"Graphics.BarrierMerged.storage-writeback":5654,"Graphics.Copy":10829,"Graphics.Copy.bytes":9593330088,"Graphics.RenderPass":10115,"Graphics.RenderPass.Close.command":8403,"Graphics.RenderPass.Close.image":459,"Graphics.RenderPass.Close.key":225,"Graphics.RenderPass.Close.label":75,"Graphics.RenderPass.Close.new-batch":950,"Graphics.RenderPass.Continued":36785},"trace_dropped":false,"trace":"aps5-trace-e2c5cb724bb5-18404.json.gz"}

verdict memo used (default):

{"commit":"e2c5cb724bb5","dirty":true,"env":{"APS5_ASYNC_COMPUTE_WORDS":"0","APS5_ASYNC_DRAW_COMPILE":"1","APS5_ASYNC_PIPELINE_WORDS":"50000","APS5_BATCH_CAP":"64","APS5_DRAW_PIPELINE":"1","APS5_GPU_CHECKPOINTS":"1","APS5_LOCAL_A2C_UNDITHERED":"1","APS5_LOCAL_MSAA_STALE_READ":"1","APS5_LOCAL_RETIRE_PARTIAL_FMASK_FILL":"1","APS5_LOCAL_SKIP_STATE_REFUSALS":"1","APS5_LOOP_GUARD":"65536","APS5_MAX_COMPUTE_SPIRV_WORDS":"1000000","APS5_NO_PIPELINE_LTO":"1","APS5_PIPELINED_DRAWS":"64","APS5_SKIP_REFUSED_DISPATCHES":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_SKIP_SHADER_FILE":"run287_skip.txt","APS5_SPLIT_CPU_ROUNDS":"1","APS5_SPLIT_DEFER_CALLEES":"1","APS5_SPLIT_TABLE_CALLS":"1","APS5_TRACE_SECONDS":"0:100","APS5_TRACE_TRIGGER_FILE":"<path>"},"gpu":"AMD Radeon RX 9070","driver":"AMD proprietary driver 26.11.2 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5950X 16-Core Processor","cpu_threads":32,"memory_mib":32687,"title_id":"PPSA01317","title":"Gran Turismo® 7","content_version":"01.710.000","resolution":"3840x2160","window":{"spec":"seconds 0:100","first_present":6944,"ms":100681.130},"presents":238,"frame_ms":{"p50":33.466,"p90":120.525,"p99":473.854,"max":87437.299},"gpu_busy_ms_per_present":13.448,"worker_busy_pct":{"queue worker 0x0":93.280,"queue worker 0x51":0.698,"queue worker 0x50":0.576,"queue worker 0x2a":0.210,"queue worker 0x23":0.025,"queue worker 0x2b":0.412,"queue worker 0x4a":0.130,"queue worker 0x4b":0.086},"phase_totals_ms":{"Driver.Completion":6.381,"Driver.Dispatch":91230.252,"Driver.Dispatch.capture_resources":77.307,"Driver.Dispatch.decode_key_device_setup":1134.592,"Driver.Dispatch.lookup_cache":17.133,"Driver.Dispatch.materialize":65.793,"Driver.Dispatch.prepared_invocation":11.509,"Driver.Draw":2971.715,"Driver.Draw.device_setup":34.961,"Driver.Draw.draw_handed_off":223.580,"Driver.Draw.prepare":2709.947,"Driver.DrawFinish":2531.706,"Driver.DrawFinish.draw_enqueued":789.172,"Driver.DrawFinish.post_compile_prepare":14.134,"Driver.DrawFinish.shader_compile_and_link":1587.166,"Driver.EndSubmission":250.780,"Driver.Packet":95746.916,"Driver.Packet.device_lock":11.963,"Driver.Packet.dispatch":91267.650,"Driver.Packet.draw":2980.678,"Driver.Packet.execute":74.945,"Driver.Packet.flush_between_packets":40.287,"Driver.Packet.memory_wait":1011.665,"Driver.Packet.pipeline_drain":67.820,"Driver.Packet.pipeline_prepare":17.773,"Driver.Packet.prepare_memory":203.387,"Driver.Packet.rendering_wait":0.200,"Driver.Present":274.940,"Driver.Present.acquire_image":95.088,"Driver.Present.device_setup":0.131,"Driver.Present.gpu_mutex_wait":7.579,"Driver.Present.inflight_wait":0.678,"Driver.Present.present_display_buffer":65.081,"Driver.Present.queue_present":34.265,"Driver.Present.release_and_callback":0.303,"Driver.Present.render_fence_wait":71.151,"Driver.Present.resize":0.415,"Driver.Present.validate":0.101,"Driver.Rewind":58.424,"Driver.SplitDispatch":86705.562,"Driver.SplitDispatch.capture":1.862,"Driver.SplitLookup":88624.306,"Driver.SplitLookup.parts_for":1891.350,"Driver.Suspend":3.193,"GpuMutex.wait.dispatch":212.196,"GpuMutex.wait.draw":41.956,"GpuMutex.wait.end":130.717,"GpuMutex.wait.flush":2.244,"GpuMutex.wait.hook":6.703,"GpuMutex.wait.indirect":7.242,"GpuMutex.wait.label":69.845,"GpuMutex.wait.other":0.833,"GpuMutex.wait.present":6.930,"Graphics.Draw":2624.848,"Graphics.Draw.draw_and_resource_release":2398.466,"Graphics.Draw.index_upload":29.963,"Graphics.Draw.validate":128.594,"Graphics.Draw.vertex_upload":50.608,"Graphics.DrawWithRecipe":16.283,"Graphics.DrawWithRecipe.draw_and_resource_release":14.831,"Graphics.DrawWithRecipe.index_upload":0.050,"Graphics.DrawWithRecipe.validate":0.291,"Graphics.DrawWithRecipe.vertex_upload":0.917,"Graphics.Submit":0.125,"Graphics.Submit.command_end":0.010,"Graphics.Submit.queue_submit":0.114,"Graphics.Wait":6.793,"Graphics.Wait.fence_wait":6.791,"Recorder.Reap":53.478,"Recorder.Submit":343.775,"Recorder.Sync":65328.698,"Resources.Complete":1804.937,"Resources.Prepare":1341.693,"Shader.DrawStage":1612.458,"Shader.DrawStage.capture_resources":520.906,"Shader.DrawStage.materialize":939.455,"Shader.DrawStage.prepared_invocation":91.696,"Shader.PrepareArtifact":16.322,"Shader.Register":29.131,"Shader.ResolveAbi":125.250,"Shader.ResolveGraphicsAbi":33.093,"Shader.ResolveGraphicsStagesAbi":119.655,"VideoOut.Flip":298.324,"VideoOut.Flip.completion_mutex_wait":0.293,"VideoOut.Flip.config_mutex_wait":0.032,"VideoOut.Flip.frame_limit":0.147,"VideoOut.Flip.notify_game":10.371,"VideoOut.Flip.present":273.531,"VideoOut.Flip.validate":0.290,"VideoOut.Flip.vblank_wait":0.161,"VideoOut.Flip.window_prepare":0.380,"VideoOut.Flip.window_title":12.932,"Vulkan.Acquire":94.794,"Vulkan.Acquire.acquire_fence_wait":85.237,"Vulkan.Acquire.acquire_image":8.329,"Vulkan.Acquire.fence_reset":0.742,"Vulkan.Acquire.retired_swapchains":0.373,"Vulkan.ComputePipeline":823.736,"Vulkan.Dispatch":3208.175,"Vulkan.Dispatch.command_record":585.856,"Vulkan.Dispatch.shader_resources":2612.828,"Vulkan.DispatchRecipe":158.439,"Vulkan.DispatchRecipe.command_record":157.923,"Vulkan.DrawFromRecipe":16.447,"Vulkan.Present":37.478,"Vulkan.Present.command_record_scale":22.630,"Vulkan.Present.pixel_upload":1.532,"Vulkan.Present.queue_submit":13.110,"Vulkan.QueuePresent":33.709,"Vulkan.QueuePresent.queue_present":33.327,"Vulkan.Retire":72.900,"Vulkan.Retire.wait":69.321},"top_phases_ms_per_frame":{"Driver.Packet":402.298,"Driver.Packet.dispatch":383.478,"Driver.Dispatch":383.320,"Driver.SplitLookup":372.371,"Driver.SplitDispatch":364.309,"Recorder.Sync":274.490,"Vulkan.Dispatch":13.480,"Driver.Packet.draw":12.524},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":733,"Graphics.Barrier.dcc-clear":824,"Graphics.Barrier.dcc-keys":654,"Graphics.Barrier.dispatch-lead":27528,"Graphics.Barrier.dispatch-trail":19511,"Graphics.Barrier.draw":20686,"Graphics.Barrier.indirect-args":8526,"Graphics.Barrier.label-run":16149,"Graphics.Barrier.present-blit":475,"Graphics.Barrier.shadow-publish":1126,"Graphics.Barrier.staging-in":9533,"Graphics.Barrier.staging-out":4517,"Graphics.Barrier.storage-upload":11832,"Graphics.Barrier.storage-writeback":14764,"Graphics.BarrierMerged.dispatch-lead":9035,"Graphics.BarrierMerged.label-run":64,"Graphics.BarrierMerged.shadow-publish":856,"Graphics.BarrierMerged.staging-in":4018,"Graphics.BarrierMerged.staging-out":4517,"Graphics.BarrierMerged.storage-writeback":5323,"Graphics.Copy":10131,"Graphics.Copy.bytes":9483878868,"Graphics.RenderPass":9573,"Graphics.RenderPass.Close.command":7963,"Graphics.RenderPass.Close.image":426,"Graphics.RenderPass.Close.key":188,"Graphics.RenderPass.Close.label":64,"Graphics.RenderPass.Close.new-batch":927,"Graphics.RenderPass.Continued":35315},"trace_dropped":false,"trace":"aps5-trace-e2c5cb724bb5-25064.json.gz"}
tools/trace_digest.py, verdict lookup skipped (local test switch `APS5_LOCAL_NO_SAMPLER_VERDICTS`, memo still filled) (first lines)

249 frames over 13501.1 ms (no summary line found)

Slowest frames (largest slices inside each, inclusive)

  • present 7141: 2040.7 ms at 11460 ms: Driver.WorkerWait (queue worker 0x50) 2040.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x50) 2040.4, Driver.WorkerWait (queue worker 0x23) 2040.3, Driver.WorkerWait (queue worker 0x2b) 2039.6
  • present 6913: 453.3 ms at 2238 ms: Driver.WorkerWait (queue worker 0x2a) 453.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 453.3, Driver.WorkerWait (queue worker 0x23) 453.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x23) 453.3
  • present 7140: 262.4 ms at 11198 ms: Driver.WorkerWait (queue worker 0x4b) 262.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 262.4, Driver.WorkerWait (queue worker 0x50) 262.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x50) 262.1
  • present 7107: 213.7 ms at 9450 ms: Driver.WorkerWait (queue worker 0x4a) 213.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4a) 213.7, Driver.WorkerWait (queue worker 0x4b) 213.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 213.7
  • present 7087: 172.6 ms at 8560 ms: Driver.WorkerWait (queue worker 0x23) 172.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x23) 172.6, Driver.WorkerWait (queue worker 0x2b) 172.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2b) 172.6

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 7141: 2040.7 ms at 11460 ms, persistence 2028.0 ms
  • present 6913: 453.3 ms at 2238 ms, persistence 428.5 ms
  • present 7107: 213.7 ms at 9450 ms, persistence 184.5 ms
  • present 7087: 172.6 ms at 8560 ms, persistence 147.6 ms
  • present 6896: 147.7 ms at 390 ms, persistence 135.0 ms
  • present 7129: 171.4 ms at 10510 ms, persistence 134.2 ms
  • present 7105: 109.3 ms at 9301 ms, persistence 70.0 ms
  • present 7092: 68.5 ms at 8846 ms, persistence 43.5 ms
  • present 7122: 69.3 ms at 10186 ms, persistence 40.0 ms
  • present 7083: 64.4 ms at 8407 ms, persistence 38.7 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 54.2 0.0 Vulkan.ComputePipeline 0.0
queue worker 0x0 24.8 (46 %) 27.1 (50 %) 2.2 7.6 Driver.Packet 24.7, Driver.Rewind 0.2
queue worker 0x51 0.1 (0 %) 54.1 (100 %) 0.1 0.0 Driver.Packet 1.9, Driver.EndSubmission 0.5
tools/trace_digest.py, verdict memo used (default) (first lines)

237 frames over 13243.8 ms (no summary line found)

Slowest frames (largest slices inside each, inclusive)

  • present 7180: 2075.3 ms at 11169 ms: Driver.WorkerWait (queue worker 0x50) 2075.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x50) 2075.2, Driver.WorkerWait (queue worker 0x23) 2074.8, Driver.WorkerWait (queue worker 0x2b) 2074.1
  • present 6965: 473.9 ms at 2332 ms: Driver.WorkerWait (queue worker 0x2a) 473.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 473.9, Driver.WorkerWait (queue worker 0x23) 473.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x23) 473.9
  • present 7179: 244.6 ms at 10924 ms: Driver.WorkerWait (queue worker 0x4b) 244.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 244.6, Driver.WorkerWait (queue worker 0x23) 244.4, Driver.WorkerWait (queue worker 0x50) 244.3
  • present 7138: 168.1 ms at 8655 ms: Driver.WorkerWait (queue worker 0x23) 168.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x23) 168.1, Driver.WorkerWait (queue worker 0x2b) 168.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2b) 168.1
  • present 7147: 159.8 ms at 9152 ms: Driver.WorkerWait (queue worker 0x4a) 159.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4a) 159.8, Driver.WorkerWait (queue worker 0x4b) 159.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x4b) 159.8

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 7180: 2075.3 ms at 11169 ms, persistence 2072.2 ms
  • present 6965: 473.9 ms at 2332 ms, persistence 470.8 ms
  • present 7138: 168.1 ms at 8655 ms, persistence 144.5 ms
  • present 7147: 159.8 ms at 9152 ms, persistence 130.8 ms
  • present 6947: 133.1 ms at 390 ms, persistence 118.0 ms
  • present 7167: 137.9 ms at 10147 ms, persistence 102.5 ms
  • present 7049: 75.0 ms at 5619 ms, persistence 49.8 ms
  • present 7134: 66.8 ms at 8497 ms, persistence 40.6 ms
  • present 7145: 73.3 ms at 9040 ms, persistence 33.8 ms
  • present 7143: 67.0 ms at 8939 ms, persistence 33.1 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0 Vulkan.ComputePipeline 0.0
shader prepare 0.0 (0 %) 0.0 (0 %) 55.9 0.0
queue worker 0x0 25.5 (46 %) 28.1 (50 %) 2.3 7.4 Driver.Packet 25.3, Driver.Rewind 0.2
queue worker 0x51 0.1 (0 %) 55.7 (100 %) 0.1 0.0 Driver.Packet 2.5, Driver.EndSubmission 0.4

AI-assisted: yes

@Remi-Bon

Copy link
Copy Markdown
Contributor Author

@Helldiverr Fixed in 698042d3b9: the memo key no longer holds the ShaderResources address. It holds the context fields the verdict reads: limits.maxSamplerAnisotropy, limits.maxSamplerLodBias, samplerAnisotropy, samplerFilterMinmax, samplerMirrorClampToEdge and nonSeamlessCubeMap, plus the entry's guest words and depth-compare flags. A context with other features at the same address now gets its own verdict, in both the ft and tf orders.

ctest -R "(sampler|image_table|^agc_driver_graphics|agc_graphics_profile_draw)" passes 51/51 on this head with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, the Khronos validation layer inserted and no VUID-. agc_driver_graphics and agc_graphics_profile_draw pass again. The speed capture is in the comment above.

AI-assisted: yes

@Helldiverr

Copy link
Copy Markdown
Contributor

@Remi-Bon GPU rerun on RDNA4 (gfx1201) with the AMD Windows driver and the validation layer: the fix holds. The memo key now holds every context field the verdict reads, and no longer the ShaderResources address. agc_driver_graphics and agc_graphics_profile_draw pass 3 of 3 runs on the merge, with no VUID-. One gap is in the tests: dropping samplerFilterMinmax from the key fails no test.

Code. At the head, addSamplerTable (core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp):

  • The key is built at :6250-6256:
    • the bytes of limits.maxSamplerAnisotropy and limits.maxSamplerLodBias (:6250-6253);
    • one character each for samplerAnisotropy, samplerFilterMinmax, samplerMirrorClampToEdge and nonSeamlessCubeMap (:6254);
    • the entry's guest words (:6255);
    • its depth-compare flags (:6256).
  • What the verdict reads:
    • Sampler::Validate (Graphics/src/Sampler.cpp:15-27) reads samplerAnisotropy, limits.maxSamplerAnisotropy, limits.maxSamplerLodBias, samplerMirrorClampToEdge and samplerFilterMinmax.
    • The loop (:6267-6281) also reads nonSeamlessCubeMap (:6276).
    • ShaderAppliesLodBias, ReadsOpaqueBlackBorder and SingleLevelSamplerWords (:6273-6277) take only the resource or its words.
    • So every input of the verdict is in the key. A context with the same values may share an entry, which is correct.
  • Lookup and store:
    • The lookup (:6259-6266) and the store (:6282-6286) are under verdictMutex.
    • A capacity rejection (:6249) is neither looked up nor stored.
    • The map is cleared at 65,536 entries (:6284).
  • Checks:
    • The PR changes only ShaderResources.cpp: no comments, nothing title-specific, no debt change.
    • check_conventions.py --base 22413e6f7f and debt_fold.py --check pass on the merge.

Mutations. Each removes one field from the capability list at :6254, applied to the merge.

mutation tests result
drop samplerFilterMinmax the 48 tests below 46 passed, the same 2 not run as on main and the merge. No test notices.
drop nonSeamlessCubeMap agc_driver_graphics fails: AGC graphics: non-seamless sampler table has the wrong deferred poison count
  • Why the first mutation passes: the only test that runs the same table entry under two contexts in one process is samplerTableNonSeamlessCubeTests (core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:8508), and it changes only nonSeamlessCubeMap.
    • GuestSamplerResource.cpp:218-228 toggles samplerFilterMinmax, but it calls Sampler directly and never reaches the memo.
    • No test changes the anisotropy, LOD bias or mirror-clamp fields between two table draws either. Those were not mutated here.
  • Suggested test: a test in the style of samplerTableNonSeamlessCubeTests with a min/max-reduction S#, run with samplerFilterMinmax false and then true, would cover this field.

After the mutations, the file was restored and the merge rebuilt.

GPU.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R "(sampler|image_table|^agc_driver_graphics$|agc_graphics_profile_draw)" -V
run tests passed failed not run total
main 48 46 0 2 42.49 s
merge 1 / 2 / 3 48 46 0 2 60.73 / 41.32 / 40.83 s
mutation samplerFilterMinmax 48 46 0 2 44.55 s
mutation nonSeamlessCubeMap (^agc_driver_graphics$ only) 1 0 1 0 0.58 s
  • Passing: agc_driver_graphics and agc_graphics_profile_draw pass on main and on all three merge runs.
  • Your pattern: ^agc_driver_graphics without $ adds agc_driver_graphics_pipeline_outside_gpu_mutex and the three agc_driver_graphics_dump_* tests. All 5 pass on main and on the merge. agc_driver_graphics_maps_fallback is no longer on main.
  • Not run: agc_shader_sampler_limits and agc_shader_nested_sampler_snapshot_retry.
    • On this host, agc_shader_memory_tests.exe fails its post-link objcopy step (Invalid argument) on main and on the merge alike, so neither test ran on either side. This is not a result of the PR.
    • Neither test sets any of the key's context fields.
  • GPU: each of the 36 tests that create an instance selected AMD Radeon AI PRO R9700 vendor=0x1002 device=0x7551 subgroup=64.
  • The times are not a speed measurement.

Speed. Not measured here. Your capture is an A/B inside a downstream tree, with the lookup skipped or used. It is not the main against change tools/trace_digest.py pair that AGENTS.md asks for; you give the reason (main stops before the Café scene, #7256). Whether that is enough is up to the maintainers.

Validation.

  • The loader inserts the layer: Insert instance layer "VK_LAYER_KHRONOS_validation" appears 38 times in each 48-test log, from the 36 tests that create a Vulkan instance.
  • Tests with no instance: the other 10 create no Vulkan instance, on main and on the merge alike. agc_driver_graphics runs on mock Vulkan, and ngs2_sampler and guest_webrtc_resampler are audio tests. The others are agc_graphics_profile_draw, agc_process_sampler_stack, agc_driver_image_table_cache and the four agc_worker_sampler_* tests.
  • No log contains was not found but was requested by env var VK_INSTANCE_LAYERS.
  • VUID- lines: 0 in every log.

Host:

  • GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349, reported subgroup size 64
  • Validation layer: Khronos validation layer 1.4.363 (LunarG SDK)
  • CPU: Ryzen 9 9950X3D
  • OS: Windows 11 Pro 26300
  • Toolchain: WinLibs GCC 15.2, Release
  • Commits: head 698042d3b9, merged onto main 22413e6f7f as 0e25cd786e

AI-assisted: yes

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9895 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10351 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11825 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14262 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15529 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16953 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 17056 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17611 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20153 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20845 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22692 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23252 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23258 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23281 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24049 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24083 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24661 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25534 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25557 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 27171 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28142 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28250 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28488 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

…max reduction

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Remi-Bon

Copy link
Copy Markdown
Contributor Author

Pushed 88cf2d4: samplerTableMinmaxCapabilityTests builds the same sampler table with only samplerFilterMinmax changed (true, false, true) and checks the deferred poison count follows it. Removing samplerFilterMinmax from the verdict key makes the test fail; with the key restored agc_driver_graphics passes (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, no VUID- lines).

@Helldiverr

Copy link
Copy Markdown
Contributor

Rerun of 88cf2d4 on the R9700 with the validation layer: samplerTableMinmaxCapabilityTests fails when samplerFilterMinmax is dropped from the verdict key and passes with the key restored. Dropping the anisotropy flag, the mirror-clamp flag or either device limit still fails no test.

Remi-Bon, thanks for the follow-up test. This run checks the claim in your reply and the other key fields.

Measured (Windows, merge onto main)

New test. samplerTableMinmaxCapabilityTests is at core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:8537. It runs one table entry three times with samplerFilterMinmax true, false, true (:8557). The test's main() calls it after samplerTableNonSeamlessCubeTests (:16245-16246).

Mutations. Each removes one input from the key in core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp (:6250-6254 at the head). Each was applied to the merge, rebuilt and run with the full pattern below.

field dropped from the key result (52 tests) failing tests and message
samplerFilterMinmax (:6254) 48 passed, 2 failed, 2 not run agc_driver_graphics, agc_graphics_profile_draw: AGC graphics: guest sampler descriptor uses a min or max reduction which the device does not support
nonSeamlessCubeMap (:6254) 48 passed, 2 failed, 2 not run agc_driver_graphics, agc_graphics_profile_draw: AGC graphics: non-seamless sampler table has the wrong deferred poison count
samplerAnisotropy (:6254) 50 passed, 2 not run none
samplerMirrorClampToEdge (:6254) 50 passed, 2 not run none
limits.maxSamplerAnisotropy bytes (:6250) 50 passed, 2 not run none
limits.maxSamplerLodBias bytes (:6251) 50 passed, 2 not run none
none (key restored, rebuilt) 50 passed, 2 not run none
  • With samplerFilterMinmax dropped, the stale verdict lets the min/max sampler through, and the run stops at the Require in core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp:23. It does not reach the poison-count message of the new test. Either way the test fails. At 698042d the same mutation failed no test.
  • The 2 tests that did not run are the same on main and on every merge run (see below).
  • After the mutations the file was restored and the merge rebuilt.

Inferred

  • The four surviving mutations show that no focused test needs samplerAnisotropy, samplerMirrorClampToEdge, maxSamplerAnisotropy or maxSamplerLodBias in the key. samplerTableDeviceLimitTests (Graphics.cpp:8577) and samplerLodBiasTests (:8637) set these fields, but neither changes one between two passes over the same entry the way the new test does.
  • The three-pass pattern of samplerTableMinmaxCapabilityTests with an anisotropic or mirror-clamp S#, or with the limit changed between passes, would cover those four fields the same way.

GPU

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R "(sampler|image_table|^agc_driver_graphics|agc_graphics_profile_draw)" -V
run tests passed failed not run total
main 52 50 0 2 61.42 s
merge 1 / 2 / 3 52 50 0 2 48.95 / 52.69 / 58.55 s
merge, key restored after the mutations 52 50 0 2 64.42 s
  • agc_driver_graphics and agc_graphics_profile_draw pass on main and on all merge runs.
  • Not run: agc_shader_sampler_limits and agc_shader_nested_sampler_snapshot_retry. This is a host problem, not the PR. Windows Defender removes agc_shader_memory_tests.exe right after it links, so the post-link objcopy step fails and ctest finds no executable. The same happens on main. Our earlier comment gave only the objcopy error; this is its cause.
  • Each of the 40 tests that create a Vulkan instance selected AMD Radeon AI PRO R9700 vendor=0x1002 device=0x7551 subgroup=64.
  • The times are not a speed measurement.

Validation

  • Insert instance layer "VK_LAYER_KHRONOS_validation" appears 46 times in every log, from the 40 tests that create an instance.
  • No log contains was not found but was requested by env var VK_INSTANCE_LAYERS.
  • VUID- lines: 0 in every log, on main, the three merge runs, the six mutations and the restored run.
  • tools/check_conventions.py --base 99fb98ee6c and tools/debt_fold.py --check pass on the merge.

Existing runs

  • Remi-Bon reported that dropping samplerFilterMinmax makes the new test fail and that agc_driver_graphics passes with the key restored, with no VUID- lines. This run confirms both on the R9700.
  • Our earlier run at 698042d is the one that found that dropping samplerFilterMinmax failed no test.

Host

  • GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349
  • Validation layer: Khronos validation layer 1.4.363 (LunarG SDK)
  • CPU: Ryzen 9 9950X3D
  • OS: Windows 11 Pro 26300
  • Toolchain: WinLibs GCC 15.2, Release
  • Commits: head 88cf2d43e5, merged onto main 99fb98ee6c as 0c9b36c220

AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed — looks good

The changed sampler verdict cache includes the device capabilities and limits used by validation, and the regression test exercises min/max support changing across consecutive contexts.

What I ran

Reviewed head 88cf2d43e5be9e7168674e8466fbe0f65da5cc47 against the prepared diff. No build or tests were run; the test results in the PR description are author-reported.

Results

Check Result Note
Diff and changed code passed Both changed files read at the pinned head
Build and tests not run Author reports 46 tests passed

Findings

Blocking

None.

Non-blocking

None.

Not verified

No build or tests were run. Runtime behavior beyond the inspected code is not verified. The full files were excluded from the review folder for size; changed lines and relevant function context were read through the repository reader. Read: ShaderResources.cpp lines 6210–6310 and 2485–2510; Sampler.cpp lines 1–60; Graphics.cpp lines 8525–8590. Excluded by folder-size rule: the remaining contents of ShaderResources.cpp and Graphics.cpp.

To get this to a good state

Nothing is required.

samplerTableCapabilityTests runs one table entry three times per field,
with the field supported, unsupported, then supported again, for min/max
reduction, anisotropic filtering, the anisotropy and LOD bias limits and
mirror-once clamping. Dropping any of them from the verdict key now fails
a test.

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

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 2207e08fe6dc70fe980804b32dc56075fcfa8973 using repo_read.py to inspect the prepared diff and targeted source ranges. No build or tests were run.

Results

Check Result Note
Changed code review passed Targeted changed hunks and validation logic inspected
Tests and build not run No execution available in this review

Negative control

Not run; no test execution was available.

Findings

Blocking

None.

Non-blocking

None.

Sources

The verdict memo key includes the sampler descriptor words, depth-compare flags, and the device capabilities and limits used by validation. Capacity-overflow entries bypass memo lookup and insertion. Changed implementation at the reviewed head

Not verified

Build and test results were not independently verified. Read the changed ranges in core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp and core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, plus the sampler validation function in core/libs/prx/libSceAgcDriver/Graphics/src/Sampler.cpp. The full changed files were excluded from the review bundle and were not read in full.

To get this to a good state

Nothing is required.

@ycbuzi

ycbuzi commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Tested 2207e08fe6 merged into main, with the whole ctest suite on each machine below. Nothing fails that does not also fail on main on the same machine.

  • Windows Server 2022 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 3 tests failed out of 7492; 99% tests passed, 2 tests failed out of 7492. 2 of the failing tests fail on main too. run
  • Windows Server 2025 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 1 tests failed out of 7492; 99% tests passed, 1 tests failed out of 7492. 1 of the failing tests fail on main too. run

GPU (software Vulkan): 6 GPU tests (AGC) passed twice on Mesa lavapipe (Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2)) on a GitHub-hosted Ubuntu 24.04 runner, with the Khronos validation layer on and the shader cache off, alongside main 9a1d772cf1: no Vulkan validation message appears that main does not also produce. run

Not covered: GPU hardware. lavapipe runs Vulkan on the CPU, so this says nothing about how real GPU drivers handle the changed paths.

AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports.

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

Labels

agc libSceAgc* perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants