Skip to content

perf(shader): leave out the dead code pass after masked-select elimination - #7522

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:perf/skip-dce-after-mse
Nov 8, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:perf/skip-dce-after-mse

Conversation

@milescoviello

@milescoviello milescoviello commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What

PrepareResourceProgram's simplification step runs MaskedSelectEliminator::Eliminate. When it removed selects, the step then ran DeadCodeEliminator::Eliminate over the whole program, after refolding first if a packed ancillary input is live.

MaskedSelectEliminator::Eliminate already runs dead code elimination at the end of every round that removes a select. It returns only after a round that removes nothing, and such a round doesn't change the program. So the program it returns is already free of dead code. Without the ancillary refolding, the following pass had nothing to remove. It now runs only after that refolding, which can create dead code.

To check this, I logged the instructions each Eliminate(IrProgram&) call removed, by call site, over 466 dumped shader requests (below). This call ran 833 times, never with a live ancillary input, and removed nothing each time. Over the 355 PPSA30839 requests plus PPSA31162's 46, it took 115 ms in 712 calls.

agc_masked_select routes its 39 cases through one eliminate() helper. After an elimination that removed selects, that helper now runs one more dead code pass and fails if it removes anything. That is the property this PR relies on. With the dead code pass inside MaskedSelectEliminator::Eliminate removed, 4 cases fail with "dead code is left after the selects were removed".

HostInterpolationChecker::Lower has the same pattern on its own path. I left it as it is, since #6222 and #7332 add code right after that line.

Tested

Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02.

  • ctest -R "^agc_|^shader_ir" on 3e3e8b9: 710/710 pass (3 skipped: host import sparse, sparse dma-buf import, stencil ref export). That run also had the HostInterpolationChecker change, which I then dropped. On the final code, the 6 tests matching masked_select|interpolat|barycentric pass.
  • agc_shader_replay --spv (Release, ANYPS5_ENABLE_SPIRV_TOOLS off, ANYPS5_NO_SHADER_CACHE=1) on 466 shader requests I had dumped with APS5_DUMP_SHADERS: 355 from MXGP 26 (PPSA30839), 107 from PPSA31162 and 4 from another app. All 462 .spv files (a few names repeat across the dumps) have the same SHA-256 on main 3e3e8b9 and with this PR, and the replay output is identical.
  • Whole-replay CPU time of the 355 PPSA30839 requests moves less than the run-to-run spread (25,445 to 26,781 ms on main, 25,161 to 25,493 ms with this PR), so I'm only claiming the 115 ms of the removed pass.

Title level: no speed claim.

tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py lists only conflicting PRs that it could not compare on Recompiler.cpp; none of their diffs touch these lines.

Title capture

As the perf label asks, these are captures of one title and scene on one machine. MXGP26 (PPSA30839) ran from boot with APS5_TRACE_SECONDS=0:60, ANYPS5_NO_SHADER_CACHE=1 and a fresh run directory (cold AnyPS5 and NVIDIA caches), so the shaders compile inside the window. NVIDIA RTX 4070 Ti (595.99.02), Ubuntu 24.04, release libs, Xvfb display, no input. main dbac9fa was captured five times: before the PR captures, after them, and three more times in a row after that. Each PR capture and the first two main captures followed a rebuild of the release libraries; the last three main captures did not, and they came out lower. The change is main with this PR merged on top as a local merge commit (81180e30362c). The time is the wall time of the Shader.PrepareArtifact slices on the shader prepare threads in each trace.

capture presents frame p50 / p90 artifacts prepared prepare time, total per artifact, mean / median
main 1 194 16.7 / 32.8 ms 935 87.3 s 93.4 / 27.7 ms
main 2 195 16.7 / 34.0 ms 956 91.4 s 95.6 / 29.6 ms
main 3 166 16.7 / 28.4 ms 961 82.1 s 85.4 / 27.3 ms
main 4 161 16.7 / 27.9 ms 946 77.6 s 82.1 / 24.7 ms
main 5 183 16.7 / 22.7 ms 939 78.4 s 83.5 / 22.8 ms
this PR 195 16.7 / 28.7 ms 941 90.6 s 96.2 / 25.3 ms

The five main captures span 17.7% in total prepare time, and the 13 prepare threads run in parallel with the title, so a title capture can't resolve a recompiler change of a few percent. The replay measurement above is this change's measurement. This PR's capture falls inside the range of the five main captures.

main 1 trace, digest, main 2 trace, digest, main 3 trace, digest, main 4 trace, digest, main 5 trace, digest, this PR trace, digest

{"commit":"dbac9fa15b61","dirty":false,"env":{"APS5_TRACE_SECONDS":"0:60"},"gpu":"NVIDIA GeForce RTX 4070 Ti","driver":"NVIDIA 595.99.02","os":"Linux 6.8.0-147-generic","resolution":"3840x2160","window":{"spec":"seconds 0:60","first_present":0,"ms":120148.301},"presents":194,"frame_ms":{"p50":16.686,"p90":32.765,"p99":2921.590,"max":112847.624},"gpu_busy_ms_per_present":6.483,"worker_busy_pct":{"queue worker 0x0":88.481,"queue worker 0x20":73.127},"top_phases_ms_per_frame":{"Driver.Packet":1000.862,"Driver.Packet.dispatch":503.561,"Driver.Dispatch":503.451,"Shader.PrepareArtifact":450.125,"Driver.Packet.memory_wait":424.003,"Vulkan.GraphicsPipeline":132.519,"Vulkan.GraphicsPipelineLibrary":126.497,"Vulkan.GraphicsPipelinePrebuild":77.312},"trace_dropped":false,"trace":"aps5-trace-dbac9fa15b61-3.json.gz"}
{"commit":"81180e30362c","dirty":false,"env":{"APS5_TRACE_SECONDS":"0:60"},"gpu":"NVIDIA GeForce RTX 4070 Ti","driver":"NVIDIA 595.99.02","os":"Linux 6.8.0-147-generic","resolution":"3840x2160","window":{"spec":"seconds 0:60","first_present":0,"ms":112864.040},"presents":195,"frame_ms":{"p50":16.689,"p90":28.698,"p99":1844.369,"max":106806.209},"gpu_busy_ms_per_present":4.938,"worker_busy_pct":{"queue worker 0x0":88.961,"queue worker 0x20":71.973},"top_phases_ms_per_frame":{"Driver.Packet":931.461,"Driver.Packet.dispatch":472.715,"Driver.Dispatch":472.625,"Shader.PrepareArtifact":464.413,"Driver.Packet.memory_wait":389.638,"Vulkan.GraphicsPipeline":119.169,"Vulkan.GraphicsPipelineLibrary":113.480,"Vulkan.GraphicsPipelinePrebuild":69.047},"trace_dropped":false,"trace":"aps5-trace-81180e30362c-3.json.gz"}
  • Khronos validation layer (LunarG SDK 1.4.363), NVIDIA RTX 4070 Ti (595.99.02), Ubuntu 24.04: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_' -V on main e2a2914 and on main + this PR (cabf6ad, a local merge). main: 815 of 815 pass; with this PR: 815 of 815 pass. Neither log reports the layer missing. VUIDs on main: VUID-VkImageViewCreateInfo-usage-02275 ×6, VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 ×18, VUID-vkCmdCopyBuffer-srcBuffer-00118 ×2, VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285 ×2, VUID-vkCmdWaitEvents-srcStageMask-01158 ×2, VUID-vkSetEvent-event-09543 ×2; with this PR: VUID-VkImageViewCreateInfo-usage-02275 ×6, VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 ×18, VUID-vkCmdCopyBuffer-srcBuffer-00118 ×2, VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285 ×2, VUID-vkCmdWaitEvents-srcStageMask-01158 ×2, VUID-vkSetEvent-event-09543 ×2. None is new with this PR.
  • Windows 11 Pro 26220, RTX 4070 (NVIDIA 596.21), WinLibs GCC 15.2 r7, Release, by @screamm (comment): stacked with perf(shader): keep one use list per IR value #7520 on main 1d41645 + perf(shader): leave out the both-zero select of f16 min and max #7516 + perf(shader): end dead code elimination when no released value is left dead #7494: agc_masked_select with the no-dead-code check and the 41-test set pass 3 of 3; identical shader-cache entries and replay hashes against two main runs (Showcase PPSA99005, RetroArch PPSA99169, vkQuake PPSA99010), static frames bit-identical, and draw-path recompile time within main's spread.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04 (Linux 6.8); NVIDIA RTX 4070 (596.21), Windows 11 (@screamm)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

…ation

MaskedSelectEliminator::Eliminate runs dead code elimination after
every round that removes a select, and returns after a round that
removes nothing, which changes nothing. So the program it returns is
already free of dead code, and the dead code pass the pipeline ran
right after it, when no packed ancillary input is live, never removed
anything. It now runs only after the ancillary refolding.

agc_masked_select now checks, after each elimination that removed
selects, that a further dead code pass removes nothing.

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

github-actions Bot commented Oct 18, 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 5021 core/shader/recompiler/Recompiler.cpp
PR 5609 core/shader/recompiler/Recompiler.cpp
PR 6412 core/shader/recompiler/Recompiler.cpp
PR 6488 core/shader/recompiler/Recompiler.cpp
PR 6858 core/shader/recompiler/Recompiler.cpp
PR 6924 core/shader/recompiler/Recompiler.cpp
PR 7642 core/shader/recompiler/Recompiler.cpp
PR 8004 core/shader/recompiler/Recompiler.cpp
PR 9356 core/shader/recompiler/Recompiler.cpp
PR 9387 core/shader/recompiler/Recompiler.cpp
PR 9508 core/shader/recompiler/Recompiler.cpp
PR 9748 core/shader/recompiler/Recompiler.cpp
PR 9897 core/shader/recompiler/Recompiler.cpp
PR 10193 core/shader/recompiler/Recompiler.cpp
PR 10359 core/shader/recompiler/Recompiler.cpp
PR 10652 core/shader/recompiler/Recompiler.cpp
PR 10757 core/shader/recompiler/Recompiler.cpp
PR 11551 core/shader/recompiler/Recompiler.cpp
PR 12324 core/shader/recompiler/Recompiler.cpp
PR 12828 core/shader/recompiler/Recompiler.cpp
PR 13928 core/shader/recompiler/Recompiler.cpp
PR 13929 core/shader/recompiler/Recompiler.cpp
PR 14853 core/shader/recompiler/Recompiler.cpp
PR 14871 core/shader/recompiler/Recompiler.cpp
PR 14944 core/shader/recompiler/Recompiler.cpp
PR 15343 core/shader/recompiler/Recompiler.cpp
PR 15548 core/shader/recompiler/Recompiler.cpp

@DavidAmsellem

Copy link
Copy Markdown
Contributor

First AMD-on-Linux (RADV) run of this PR. Merged onto main 0fbfd91e5 (clean merge), built in full and compared with the same main, on the same machine.

AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.

Full suite (ANYPS5_REQUIRE_VULKAN=1 ctest -j8): 1637/1639 with this PR, against 1637/1639 on main. The failures are the same two on both, so this PR adds none: agc_driver_image_table_vouched_lookups (#7766, fixed by #7916) and agc_driver_guest_memory_lifetime (#7784). The PR adds no new ctest entry, and no test is skipped or removed compared with main. This checks correctness only: I did not measure the speed-up.

GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38

AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor Author

@DavidAmsellem thank you, the gfx1100 full-suite run is in the description now.

AI-assisted: yes (Claude Code)

@github-actions

Copy link
Copy Markdown

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

@milescoviello

Copy link
Copy Markdown
Contributor Author

The title capture the perf label asks for is now in the description, with both summary lines, the traces and the digests: MXGP26 from boot, a cold shader cache, main dbac9fa against main + this PR (81180e30362c). The five main captures span 17.7% in total shader prepare time, so the capture can't resolve this change, and the replay measurement in the description is still its measurement. This PR's capture falls inside the range of the five main captures.

AI-assisted: yes (Claude Code)

@screamm

screamm commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Windows run of #7520 and #7522 together. Host: Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 driver 596.21, Ryzen 7 5700X, WinLibs MinGW-w64 GCC 15.2 r7, Release. I stacked #7520 at d484281b6 and #7522 at cabf6ad53 on main 1d4164552 + #7516 (f099292f8) + #7494 (0aab6c1f3). None of the four shares a file, and all merges were clean. Targeted build: the shader and AGC test targets plus libs. MinGW accepts the new static_assert(sizeof(IrValue) == 128).

  • shader_ir_use_rewrite with the tightened allocation bounds: 3 of 3. agc_masked_select with the new "no dead code left" check: 3 of 3. The rest of the 41-test set also passed 3 of 3, none skipped: the ^shader_|^agc_shader_ set, agc_ir_reclaim, agc_constant_phi and the f16/f32 min/max GPU tests.
  • Shader output, three homebrews, fresh shader cache directory per run, 60 s: Showcase PPSA99005 52 entries, RetroArch PPSA99169 24, vkQuake PPSA99010 52. Entry count, keys and payloads are the same for two main runs and this stack. I matched keys with the source-version word masked and compared payloads with host pointers masked: 5 Showcase entries hold a host address and differ between two main runs too. Showcase's two dumped compute requests replay (agc_shader_replay --spv) to identical SHA-256 on main and the stack.
  • One cold-cache title pass of the stack per title, 90 s, run after a main/perf(shader): leave out the both-zero select of f16 min and max #7516+perf(shader): end dead code elimination when no released value is left dead #7494 A B A B. Settings: ANYPS5_NO_SHADER_CACHE=1, a freshly relinked run directory, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_TRACE_SUMMARY_EVERY=10. No stop line. These titles compile on the draw path; they have no Shader.PrepareArtifact slices. Draw-path recompile time over the run, summed from the [draw] driver phases lines:
    • vkQuake 2245.5 ms against main 2594.5 / 2223.2 ms.
    • Showcase 39.7 ms against main 46.8 / 35.0 ms.
    • RetroArch 9111 presents against 8924 / 9118 on main, p50 8.34 ms in all.
    • All within the main range. This is one run, so it shows no regression, not a speed-up.
  • Frame dumps: vkQuake's static console and loading screens are bit-identical with main. The animated frames differ between two main runs too, so they can't be compared.
  • A negative control doesn't apply to a bit-exact optimisation. I didn't repeat your two negative checks (main against the new UseRewrite bound, and MaskedSelect without the inner DCE).
  • tools/check_conventions.py --base origin/main and git diff --check: pass.

Not checked: a full build, the agc_driver_ GPU suite (the RADV full-suite run above covers that on AMD), replay CPU time, an A B A B of these two on their own, AMD/Intel on Windows.

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @screamm, the first Windows title runs of this one, and the identical cache entries and replay hashes are the right check for a bit-exact change. Added to the description.

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor Author

A data point from a second title, and it doesn't show a gain here. Crimson Desert (PPSA25286) replay: a fixed subset of 152 of its 6,065 registration requests, agc_shader_replay --prepare, Release, task-clock, 8 interleaved runs per build, i7-13700K:

build median range
main 5d10ea9 16.72 s 16.41 to 19.02 s
main + this PR (cabf6ad, merged cleanly) 16.69 s 16.42 to 22.44 s

The medians are within noise of each other; one run on each side was slowed by other load on the host. The prepared SPIR-V of the 152 requests is byte-identical to main's.

In this title's profile, the dead-code passes inside MaskedSelectEliminator::Eliminate are about 6 % of that function. Most of its time is in UnreadLanes: settle 38 %, its own loop 28 %, readerOf 10 %. So there's little here for this PR to remove. The MXGP replay numbers in the description stand as they are.

AI-assisted: yes (Claude Code)

@TechLevelZero

TechLevelZero commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head cabf6ad merged onto main 88e804b · tested 2026-11-02 14:57 UTC · 17 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,495 passed · 6 failed (0 new, 3 also fail on main, 3 unstable on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,546 of 3,234 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (970 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_graphics 36.7 s, ⚠️ agc_driver_graphics_maps_fallback 36.0 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 2 of the last 10 main runs
agc_submit_progress: failed in 8 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 8 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 495 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (495 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 487 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (45)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_o
Reproduce
git fetch origin cabf6ad533639eabb96111bc9c4be745ab862a84 88e804b0a7df1f1ac373a9e2f72fb378d925fdd4
git checkout 88e804b0a7df1f1ac373a9e2f72fb378d925fdd4 && git merge --no-ff cabf6ad533639eabb96111bc9c4be745ab862a84
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

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

Windows 11, AMD RX 9070 XT, WinLibs GCC 15.2.0, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, merged onto current main f6232fcfda (clean merge): agc_masked_select passes, including the new check in eliminate() that one more DeadCodeEliminator pass removes nothing after selects were removed. With main's core/shader/recompiler/Recompiler.cpp restored it passes too. That's expected: the test checks the property this PR relies on, inside MaskedSelectEliminator::Eliminate, not the removed call. The removed pass is still in PrepareResourceProgram on current main (the merge is clean). I didn't reproduce the timing; the summary lines and digests in the description are the performance evidence.

@milescoviello

Copy link
Copy Markdown
Contributor Author

@BunnyFl thanks for the Windows and AMD run. Yes, the new check in MaskedSelectEliminator::Eliminate pins the property the removed pass relied on (a further DeadCodeEliminator pass removes nothing after the select removal), so it passes with or without the Recompiler.cpp change. The performance side rests on the summary lines and digests in the description.

AI-assisted: yes (Claude Code)

@adriadam10
adriadam10 merged commit 27b8916 into boykopovar:main Nov 8, 2026
18 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked that MaskedSelectEliminator::Eliminate runs dead code elimination after every round that removes selects and exits only after a round that changes nothing, so the extra pass outside the ancillary refold never had work; the new check in agc_masked_select pins that property. The earlier agc_driver_sgpr_pattern_fill_keys failure was a flake in code this diff doesn't touch: the rerun of that Build is green on linux. Matches the AMD, Windows and NVIDIA runs in the thread; merged.

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

Labels

agc libSceAgc* perf Performance change shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants