Skip to content

fix(shader): trace whole-quad masks through descriptor phis - #14830

Merged
adriadam10 merged 4 commits into
boykopovar:mainfrom
JJenkx:fix/shader-descriptor-web-wqm-20261101
Nov 6, 2026
Merged

adriadam10 merged 4 commits into
boykopovar:mainfrom
JJenkx:fix/shader-descriptor-web-wqm-20261101

Conversation

@JJenkx

@JJenkx JJenkx commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What

The descriptor-merge analysis recognizes program-counter, EXEC and ballot values in an arm that is not a reconstructible texture descriptor. It traces those origins through uniform operations, but stopped at WqmU64. A whole-quad expansion of an EXEC/lane mask therefore blocked the complete descriptor merge during preparation, including its valid texture arms.

Traverse WqmU64 when checking control-mask provenance. The original input must still trace to a recognized control value; this does not classify every whole-quad expression as a mask. The existing behavior remains: selecting a valid arm reads its texture, selecting the mask arm raises a descriptor fault at the read, and disabled lanes neither fault nor write.

Evergate PPSA01886's private request after #14822 exposed this omission. An offline trial gets past the whole-quad-mask rebuild refusal and reaches a separate buffer-read rematerialization refusal. No additional native launch or title-level gain is claimed for this change.

Tested

Earlier qualification of committed head e236db5e701e21f554298fb92306be8e8c655db1, rebased directly on main e0caf1360035286bd22b9f2a3030e97b880ffb28; independent of #14822 and #14636.

AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Arch Linux 7.2.11, Khronos validation 1.4.363. Same focused CTest selection on main production plus the new fixtures and on this commit:

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R '^agc_(shader_memory|driver_descriptor_web_faults)$' -V
  • Main plus fixtures: both fail on the new whole-quad-mask path, with zero VUIDs or skips.
  • Change: 2/2 pass, zero VUIDs or skips. Both runs actually inserted the Khronos instance/device layer and report no missing-layer warning.
  • Planning checks cover the EXEC-derived whole-quad mask. Removed the user-data whole-quad exception assertion requested in review: it constrained an unimplemented reconstruction path rather than valid implemented behavior.
  • Three added GPU cases check the valid texture's returned value, the selected mask's expected descriptor fault, and untouched output/no fault with zero active lanes. Existing cases remain.
  • The change was committed before building/testing. Its receipt records the exact head, clean working tree before/after, unchanged head, and unchanged SHA-256 for three sources, two test binaries, the static compiler and driver library.
  • Focused driver/test builds, conventions and whitespace checks pass on the revised head. The original overlap check found no direct conflict; 32 older branches already conflicting with main could not be integrated automatically. Their shared-file changes were inspected for mask-provenance changes and no duplicate was identified. Those complete combinations are unqualified.

Build/test logs, exact-head receipt and source diff, SHA-256 f4d4104b7d6bf59e1293b3d724afc55fe9546a6d220211b13be3d17ecbe080be. Synthetic source and tests only; no proprietary game assets, requests or saves.

Direct provenance follow-up (2026-11-01)

Addressed the nonblocking direct-provenance coverage request in review5729999743. New exact head: 6c10eaa9585ebe01e2b0656f1cd0f415d4f83370, a focused follow-up to e236db5e701e21f554298fb92306be8e8c655db1.

The existing bounded HoldsControlValue traversal now lives in the existing internal ShaderRecompiler::Detail instruction-predicate module, and the descriptor tracker calls that same production predicate with its unchanged depth 8 bound. Its traversal is unchanged after whitespace/name normalization. No public or test-only ResourceTracker API was added.

The direct IR assertions check WqmU64(GetExec) has a control origin and WqmU64 of user-data-only words does not. They neither call the rematerializer nor expect a planner exception, so future WQM rematerialization can be implemented without changing their contract. Existing planner and GPU output/fault/disabled-lane cases remain.

Qualification, Release/SPIRV-Tools ON, AMD Radeon RX 6650 XT / RADV Mesa 26.2.6 / Linux 7.2.11-arch1-1:

  • Same focused agc_shader_memory and agc_driver_descriptor_web_faults selection on current main 93dbd0f82aea684e95f15f06e7d42c0064af18cf and the exact change: main 2/2, change 2/2, 0 VUIDs, 0 skips, no missing-layer message. The physical descriptor execution case actually inserts Khronos; the shader-memory group is CPU. This current-main control is unmodified main; the earlier main-plus-new-fixtures negative remains separately pinned historical evidence.
  • Removing only WQM traversal makes the positive assertion fail with “a whole-quad EXEC mask lost its control origin”. Treating every WQM as a control origin makes the negative assertion fail with “a whole-quad user-data value acquired a control origin”. Both are intentional production-only mutation failures in the new direct checks, not unsupported-operation expectations.
  • Restored source: 2/2 pass again, zero VUIDs/skips, and the shader-memory binary hash exactly matches its initial candidate hash. Source is clean; head unchanged throughout. Both complete harnesses (including mutation builds/tests/restoration) ran under the title-free infrastructure reservation/FIFO with service-owned PTYs and exited 0; reservation released.
  • Conventions/whitespace pass; current-main merge preview clean. No new title, performance, Windows or console claim. Earlier external reports retain their original pins.

Evidence: frozen source, raw paired logs, mutation failures and restored hashes (SHA-256 5639dd666ace9cf200e3ecedfe26156cdf104fa0a2a716efbf06ffced283d5aa, downloaded bytes and internal manifest verified).
AI-assisted: yes.

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; the Evergate request remains blocked later
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Arch Linux 7.2.11
  • 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 — no blocking findings

The WqmU64 provenance change is supported by the exact-head GPU evidence in the attached artifact; required hosted build jobs are still pending, so this is a comment rather than an approval.

What I ran

Reviewed head c39c4178055b0fb60c7193b0947f624f0366c98a against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958; the merge preview is clean. Environment: Debian GNU/Linux 12, Python 3.11.2, Git 2.39.5. I did not build or run the GPU tests locally.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...c39c4178055b0fb60c7193b0947f624f0366c98a
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14830
curl -fsSL <artifact URL> -o /tmp/descriptor-web-wqm-linux-20261101.tar.gz
sha256sum /tmp/descriptor-web-wqm-linux-20261101.tar.gz
sha256sum -c SHA256SUMS

Results

Check Result Note
Diff and conventions passed No whitespace errors; conventions passed
Source and test review passed WQM follows control-mask provenance; user-data-only WQM remains rejected
Author GPU artifact passed Digest and source hashes match; baseline 0/2, PR 2/2
Hosted checks pending Windows and relinker jobs are still running or queued
Local build and GPU run not run Not run independently here
Precheck helper coverage not run ABI and test-quality helpers are absent from the isolated PR snapshot
Commands and raw results

git diff --check ...: no output; exit status 0. The precheck reported All conventions checks passed. It also reported the ABI and test-quality helpers missing from its isolated PR snapshot; these are local review helpers and their absence is not a PR defect. Its stack report said PR #14830: clean against current base and No declared PR dependencies were found.

The downloaded artifact SHA-256 was:

87600cf263e570eeba3c893a57980ef742ee5595e89db42de9a8f8ad8ed1949a  /tmp/descriptor-web-wqm-linux-20261101.tar.gz

sha256sum -c SHA256SUMS reported OK for every included file. Its gate records say:

main: head=f2d874c1fdccf781c0fa5d86619bb5dd8894b958; exit=8; summary=0% tests passed, 2 tests failed out of 2; Khronos instance/device inserted=True/True; VUID count=0
change: head=c39c4178055b0fb60c7193b0947f624f0366c98a; exit=0; summary=100% tests passed out of 2; Khronos instance/device inserted=True/True; VUID count=0

The artifact's SHA-256 values for ResourceTracker.cpp, ShaderMemory.cpp and DescriptorWebFaults.cpp matched the blobs at this exact head. These GPU results are author-supplied evidence; I inspected the included gate records and logs but did not reproduce the build or run.

Hosted checks at the final refresh: conventions pass, intake pass, labels pass, library-portability pass, relinker-asan pass; Windows and three relinker jobs pending; Linux, register-context and write-watch skipped.

Negative control

The author-supplied baseline run used the pre-change source with the new fixtures: both focused tests failed (0 skipped). The exact-head run passed both. I did not independently mutate the PR source or rerun either case.

Findings

Blocking

None found in the reviewed three-file diff.

Non-blocking

The remaining Windows and relinker hosted jobs must finish before approval; their results may change the review outcome.

Sources

Not verified

I did not independently build or run the GPU tests, verify on another GPU/driver, test a console or title, or run complete Windows/macOS builds. The full-stack combinations of the 32 older conflicting branches identified by the author's overlap scan are not qualified by this review.

To get this to a good state

No code change is requested. Once the pending hosted jobs finish, I will re-check their results on this head; if the head changes, I will rerun the relevant checks against the new SHA.

@MarcZX10

MarcZX10 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Correction — reproducible artifact commands

The review’s command block used a placeholder URL; these are the exact download and checksum commands I ran.

curl -fsSL 'https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/descriptor-web-wqm-linux-20261101.tar.gz' -o /tmp/descriptor-web-wqm-linux-20261101.tar.gz
sha256sum /tmp/descriptor-web-wqm-linux-20261101.tar.gz
mkdir -p /tmp/descriptor-web-wqm-artifact && tar -xzf /tmp/descriptor-web-wqm-linux-20261101.tar.gz -C /tmp/descriptor-web-wqm-artifact && cd /tmp/descriptor-web-wqm-artifact/descriptor-web-wqm-linux-20261101 && sha256sum -c SHA256SUMS

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks for the focused fix: letting HoldsControlValue walk through WqmU64 (core/shader/recompiler/Optimization/src/ResourceTracker.cpp:1392) is the only production change, it stays bounded by the existing phi tracking and search depth, and the new EXEC-derived planner entry and the three GPU cases cover it well. One request:

Please drop or replace the new exception assertion at core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:5501-5503, which requires GetResourcePlan to keep refusing a descriptor built from s_wqm_b64 of user data. That refusal is not about an invalid shader: WqmU64 is simply missing from the runtime-value whitelist (IsRuntimeUniformOp in core/shader/recompiler/Optimization/src/SrtWalker/SrtInstructionPredicates.cpp), so Rematerialize cannot rebuild it (ResourceTracker.cpp:1155-1156), the runtime validator rejects it (core/shader/recompiler/Optimization/src/SrtWalker/SrtRuntimeValidator.cpp:149-150), and the planner reports "not a valid runtime value" (ResourceTracker.cpp:2065-2066). Tests check implemented behaviour or argument validation, never that an unimplemented case throws; this one would fail as soon as someone adds that reconstruction. If you want a negative control, check directly that a whole-quad mask of user data is not classified as control-derived, without requiring the whole plan to throw.

Reviewed at c39c417805.

@github-actions github-actions Bot added shader core/shader agc libSceAgc* labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 12132 core/shader/recompiler/Optimization/src/ResourceTracker.cpp L1452-1488, L1571

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 5371 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6280 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 7085 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 7223 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 7410 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7642 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 7684 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 8004 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 9020 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 9183 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 9335 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 9748 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 9852 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 9889 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 9897 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 10233 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 10359 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 10757 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 10867 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 11351 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 11483 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 12324 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 12548 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/SrtWalker/SrtInstructionPredicates.cpp
PR 12828 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 13928 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 13929 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 14032 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 14853 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 14944 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head c39c417 merged onto main f2d874c · tested 2026-11-01 19:47 UTC · 22 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,443 passed · 8 failed (0 new, 4 also fail on main, 4 unstable on main) · 46 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,497 of 3,168 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 (936 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lookup_log_fits_build 44.7 s, ⚠️ agc_driver_graphics_maps_fallback 30.5 s, ⚠️ agc_driver_graphics 30.4 s
Unstable on main (4, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_job_manager_compute_capacity: failed in 1 of the last 10 main runs
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
agc_submit_progress: failed in 5 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 7 of the last 10 main runs
Failing on main too (4, not counted against this PR)
agc_driver_dcc_keys_first_write
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 484 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (484 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 476 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-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (46)
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_pipeline_binary_vulkan: skipped, the device lacks VK_KHR_pipeline_binary
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
Reproduce
git fetch origin c39c4178055b0fb60c7193b0947f624f0366c98a f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff c39c4178055b0fb60c7193b0947f624f0366c98a
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.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-checked — same head, changes requested

I missed a new planner test that asserts an internal failure caused by the still-unsupported WqmU64 rematerializer instead of directly checking the intended provenance property.

What I ran

Re-checked head c39c4178055b0fb60c7193b0947f624f0366c98a against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. Linux x86_64; read the exact test, planner path, runtime-op predicate, review thread and hosted check state. No build or tests were run in this corrective pass.

gh api repos/boykopovar/AnyPS5/pulls/14830 --jq '[.state,.head.sha,.base.sha] | @tsv'
gh pr checks 14830 --repo boykopovar/AnyPS5
git show refs/review/inspect/14830-20261101T2001Z:core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
git show refs/review/inspect/14830-20261101T2001Z:core/shader/recompiler/Optimization/src/ResourceTracker.cpp

Results

Check Result Note
Exact head passed Unchanged
New planner assertion failed It pins an incidental unsupported-op error
Hosted Windows and Linux relinker passed These are not the focused GPU tests
Hosted macOS relinker not run Two jobs remain pending
Local build and GPU tests not run No compilation in this pass
Unedited hosted-check output
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948597195
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948597788
relinker (macos-latest, clang++)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948596308
relinker (ubuntu-latest, g++)	pass	4m20s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948596323
windows	pass	4m16s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948596255
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948597680
relinker (windows-latest, g++)	pass	9m29s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948596267
library-portability	pass	1m45s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263663/job/124948563092
relinker-asan	pass	2m30s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948596227
eligibility	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948563115
report	pass	1m28s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263574/job/124948562940
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263596/job/124948564286
intake	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263780/job/124948565087
conventions	pass	17s	https://github.com/boykopovar/AnyPS5/actions/runs/41340263726/job/124948564457
relinker (macos-latest, clang++, x86_64)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41340263551/job/124948596359
open	c39c4178055b0fb60c7193b0947f624f0366c98a	f2d874c1fdccf781c0fa5d86619bb5dd8894b958

Negative control

Not run. The assertion is in a C++ test that requires a build; no test binary was available in this pass.

Findings

Blocking

ShaderMemory.cpp expects GetResourcePlan to fail with “not a valid runtime value” for a descriptor containing WqmU64 derived from user data. At this head, WqmU64 is specially traversed only by HoldsControlValue; the runtime-op predicate and Rematerialize still reject it, so planning fails before this assertion demonstrates that user data was not treated as control provenance. This locks an incidental unsupported-operation error into the test and can fail when runtime rematerialization is correctly extended. Please replace it with a direct provenance assertion or another test that distinguishes user-data origin without depending on this planner error.

Non-blocking

None.

Sources

Not verified

No local build or GPU run was performed. The PR description reports matched main/change validation-layer tests on an AMD RX 6650 XT; I did not independently reproduce those captures. The two macOS relinker checks remain queued.

To get this to a good state

Replace the planner-error assertion with a direct test of the provenance distinction, then rerun the same build and focused tests on the updated head.

@JJenkx
JJenkx force-pushed the fix/shader-descriptor-web-wqm-20261101 branch from c39c417 to e236db5 Compare November 1, 2026 19:50
@JJenkx

JJenkx commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Removed the three-line GetResourcePlan exception assertion rather than constraining future user-data WqmU64 reconstruction. The EXEC-derived planner check and all three new GPU output/fault/disabled-lane checks remain.

Rebased onto current main e0caf1360035. Revised head e236db5e701e21f554298fb92306be8e8c655db1: same two focused tests fail against main production plus the positive fixtures and pass 2/2 against the change, on the RX 6650 XT with actual Khronos instance/device validation, shader caches disabled, zero skips and zero VUIDs. Exact clean committed-head receipts and unchanged source/binary hashes are included in the updated evidence archive; SHA-256 f4d4104b7d6bf59e1293b3d724afc55fe9546a6d220211b13be3d17ecbe080be. PR description updated.

@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

The new head removes the planner assertion that pinned an internal error, and the descriptor-phi folding cases now cover the whole-quad mask. One negative property is no longer tested, which is recorded as non-blocking. Approval waits for the macOS relinker jobs, which were queued at review time.

What I ran

  • Head e236db5e701e21f554298fb92306be8e8c655db1; base e0caf13600. 3 files, +14/-2 against the base: ResourceTracker.cpp (1/1), ShaderMemory.cpp (2/1 net), DescriptorWebFaults.cpp (11/0). Two commits since the previously reviewed head c39c417805: 21d01bbc26 (the tracker change and the new tests) and e236db5e70 (removes one planner assertion). I read the whole diff.
  • The tracker change (ResourceTracker.cpp lines 1384-1398) lets WqmU64 pass through the control-value walk, the same way CompositeExtractU32x4 and the runtime-uniform ops already do, so a whole-quad mask derived from a control mask can be recognised as a control value.
  • The previously requested change (from another reviewer, on c39c417805) was that the planner test pinned an internal failure of the unsupported WqmU64 rematerialiser. e236db5e70 removes the expectFailure for the whole-quad case that used "GetImageResource dword 0 is not a valid runtime value".
  • Non-blocking: that same removal also removes the only assertion that a whole-quad expansion without a control-mask origin is not planned. The new folding cases check that the masked loop folds and faults, but not that an uncontrolled mask is rejected. A replacement that checks the provenance rule directly, rather than an internal error, would restore that coverage.
  • Hosted, queried at this head before writing this table: conventions, eligibility, labels, library portability, report, windows, and the relinker jobs on ubuntu (g++ and asan) and windows (g++) passed; linux, register-context and write-watch skipped; the two macOS relinker jobs queued.
  • Precheck report at this exact head (head and base unchanged at completion). Its ABI and test-quality rows failed because their helpers are not in the head tree; the PR changes no export.

Results

Check Result Note
Diff check passed
Conventions and PR template passed precheck and hosted conventions passed
Mergeability and dependencies passed depends on none
Tracker change passed WqmU64 is traced the same way as the other pass-through ops
Removed internal-error assertion passed the pinned internal error is gone
Negative provenance coverage not run the uncontrolled whole-quad rejection is no longer asserted (non-blocking)
GPU execution test (DescriptorWebFaults.cpp) not run needs a GPU; the author's GPU runs are not verified here
Build and runtime tests not run no build
Negative controls not run no build
Hosted CI not run windows and the ubuntu and windows relinker jobs passed; the two macOS relinker jobs queued
Commands and unedited precheck output

Commands:

  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14830 --output-dir <scratch>/precheck/14830 (report.md in that directory).
  • Delta since the previous review: git diff c39c4178055b0fb60c7193b0947f624f0366c98a e236db5e701e21f554298fb92306be8e8c655db1.
  • Hosted checks: gh api repos/boykopovar/AnyPS5/commits/e236db5e701e21f554298fb92306be8e8c655db1/check-runs.

Precheck table (unedited):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check e0caf1360035286bd22b9f2a3030e97b880ffb28...e236db5e701e21f554298fb92306be8e8c655db1
conventions_and_pr_template passed /marc/Conlyse-VIEJO/.venv/bin/python3 tools/check_conventions.py --base e0caf1360035286bd22b9f2a3030e97b880ffb28 --head e236db5e701e21f554298fb92306be8e8c655db1 --title fix(shader): trace whole-quad masks through descriptor phis --body /dev/shm/reviewer-run/precheck/14830/pr-body.md
changed_export_abi_audit failed /marc/Conlyse-VIEJO/.venv/bin/python3 tools/pr_abi_audit.py --base e0caf1360035286bd22b9f2a3030e97b880ffb28 --head e236db5e701e21f554298fb92306be8e8c655db1 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /marc/Conlyse-VIEJO/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14830 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14830/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /marc/Conlyse-VIEJO/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14830/head-e236db5e701e-1de54405/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14830/head-e236db5e701e-1de54405 --json core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp core/libs/prx/libSceAgcDriver/tests/execution/DescriptorWebFaults.cpp core/shader/recompiler/Optimization/src/ResourceTracker.cpp
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run here. The planner test and the GPU test need a build and a GPU.

Findings

Blocking

None.

Non-blocking

  • After e236db5e70, no test asserts that a whole-quad expansion without a control-mask origin is rejected. Please add that check back in a form that tests provenance (the planner should refuse the uncontrolled mask for that reason), rather than an internal error.

Sources

  • Tracker change:
    if (depth == 0u) {
    return false;
    }
    if (value->IsPhi()) {
    if (std::ranges::find(seen, value) != seen.end()) {
    return false;
    }
    seen.push_back(value);
    } else if (!Detail::IsRuntimeUniformOp(value->Opcode()) && value->Opcode() != IrOpcode::CompositeExtractU32x4 && value->Opcode() != IrOpcode::WqmU64) {
    return false;
    }
    for (std::size_t index = 0; index < value->ArgumentCount(); index++) {
    if (HoldsControlValue(value->Argument(index), depth - 1u, seen)) {
    return true;
    }
  • Planner tests:
    restoredSamplerCode.erase(restoredSamplerCode.end() - 6, restoredSamplerCode.end() - 1);
    planRestoredSampler(restoredSamplerCode, "descriptor Phi: an S# copied out and back in three nested loops without a masked write was planned as more than one sampler");
    const auto entryWrites = [&](std::initializer_list<std::uint32_t> words) {
    auto code = loopCode;
    code.insert(code.begin() + 8, words);
    return code;
    };
    const std::array<std::pair<std::vector<std::uint32_t>, const char*>, 4> controlEntries{{
    {entryWrites({0xbe8e1f00u}), "descriptor Phi: a loop entry whose T# registers hold the program counter was not folded onto the loop's two SRT T#s with a fault"},
    {entryWrites({0xbe8e037eu}), "descriptor Phi: a loop entry whose T# registers hold EXEC was not folded onto the loop's two SRT T#s with a fault"},
    {entryWrites({0xbe8e0a7eu}), "descriptor Phi: a loop entry whose T# registers hold a whole-quad EXEC mask was not folded with a fault"},
    {entryWrites({0x7d840080u, 0xbe8e036au}), "descriptor Phi: a loop entry whose T# registers hold a compare mask was not folded onto the loop's two SRT T#s with a fault"},
    }};
    for (const auto& [code, message] : controlEntries) {
    auto request = makeRequest(code);
    const auto plan = GetResourcePlan(request);
    require(plan->info.images.size() == 2u && plan->info.usesFaultBuffer, message);
    }
    auto unwritten = loopCode;
    unwritten[4] = 0xf4080200u;
    auto unwrittenRequest = makeRequest(unwritten);
  • GPU test:
    const auto selected = Run(device, WebCode, UndefinedFormat, SecondSelector);
    Require(Faulted(selected.log, SamplePc), "descriptor web faults: a lane selecting an undefined arm did not fault at the read:\n" + selected.log);
    const auto selectedNoLanes = Run(device, NoLaneWebCode, UndefinedFormat, SecondSelector);
    Require(Clean(selectedNoLanes.log) && selectedNoLanes.word == Untouched, "descriptor web faults: an undefined arm faulted or wrote with no lane enabled:\n" + selectedNoLanes.log);
    auto wholeQuad = WebCode;
    wholeQuad[17] = 0xbe8e0a7eu;
    const auto wholeQuadValid = Run(device, wholeQuad, Format8888UNorm, ValidSelector);
    Require(Clean(wholeQuadValid.log) && Reads(wholeQuadValid.word, FirstTexel), "descriptor web faults: an unselected whole-quad mask changed the valid arm's read:\n" + wholeQuadValid.log);
    const auto wholeQuadFolded = Run(device, wholeQuad, Format8888UNorm, FoldedSelector);
    Require(Faulted(wholeQuadFolded.log, SamplePc), "descriptor web faults: a selected whole-quad mask did not fault at the read:\n" + wholeQuadFolded.log);
    auto wholeQuadNoLanes = NoLaneWebCode;
    wholeQuadNoLanes[17] = 0xbe8e0a7eu;
    const auto wholeQuadDisabled = Run(device, wholeQuadNoLanes, Format8888UNorm, FoldedSelector);

Not verified

  • No build or test run here, and the GPU test was not run.
  • Whether the planner rejects the uncontrolled whole-quad case for the intended reason at this head was not traced.
  • The macOS relinker jobs had not finished at review time.

To get this to a good state

  • Add back a provenance assertion for the uncontrolled whole-quad mask (non-blocking). Approval waits for the macOS relinker jobs on this head.

@JJenkx

JJenkx commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Windows GPU check of head e236db5e70, merged onto main 5bae1a4bc2 (clean merge), run through the shared GPU queue.

  • Machine: Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, AMD Radeon RX 6700 XT, AMD proprietary driver 26.10.1, WinLibs GCC 15.2.0 UCRT r7, Release, BUILD_TESTING=ON, Vulkan Validation Layers 1.4.363.
  • Full CTest run: 3265/3280 pass and 12 skip, all for lack of a device feature or host capability.
  • The PR's tests pass: agc_shader_memory and agc_driver_descriptor_web_faults.
  • Three failures:
    • agc_driver_sample_order_grid_reference and ngs2_pitchshift also fail on main on this machine. The latter is the UCRT exp2f difference that fix(libSceNgs2): compute the PitchShift ratio with libc's msun exp2f #12864 addresses.
    • agc_driver_sample_multisample_target failed once in the full run ("native buffer recipe dispatch: missing refusal"). Rerun on its own, it passes 3/3 on this PR's build and 3/3 on main 0580e5c951, so it looks like a one-off in that run. That test's buffer-load shader does not go through the WqmU64 descriptor path this PR changes.
  • Validation layers: they report the same three VUIDs as main (vkDestroyDevice-device-05137, VkPipelineColorBlendStateCreateInfo-pAttachments-00605, VkSubmitInfo-pSignalSemaphores-03242), and nothing new.
  • Not run: no title.

@JJenkx

JJenkx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the nonblocking direct-provenance coverage request in review5729999743. New exact head: 6c10eaa9585ebe01e2b0656f1cd0f415d4f83370, a focused follow-up to e236db5e701e21f554298fb92306be8e8c655db1.

The existing bounded HoldsControlValue traversal now lives in the existing internal ShaderRecompiler::Detail instruction-predicate module, and the descriptor tracker calls that same production predicate with its unchanged depth 8 bound. Its traversal is unchanged after whitespace/name normalization. No public or test-only ResourceTracker API was added.

The direct IR assertions check WqmU64(GetExec) has a control origin and WqmU64 of user-data-only words does not. They neither call the rematerializer nor expect a planner exception, so future WQM rematerialization can be implemented without changing their contract. Existing planner and GPU output/fault/disabled-lane cases remain.

Qualification, Release/SPIRV-Tools ON, AMD Radeon RX 6650 XT / RADV Mesa 26.2.6 / Linux 7.2.11-arch1-1:

  • Same focused agc_shader_memory and agc_driver_descriptor_web_faults selection on current main 93dbd0f82aea684e95f15f06e7d42c0064af18cf and the exact change: main 2/2, change 2/2, 0 VUIDs, 0 skips, no missing-layer message. The physical descriptor execution case actually inserts Khronos; the shader-memory group is CPU. This current-main control is unmodified main; the earlier main-plus-new-fixtures negative remains separately pinned historical evidence.
  • Removing only WQM traversal makes the positive assertion fail with “a whole-quad EXEC mask lost its control origin”. Treating every WQM as a control origin makes the negative assertion fail with “a whole-quad user-data value acquired a control origin”. Both are intentional production-only mutation failures in the new direct checks, not unsupported-operation expectations.
  • Restored source: 2/2 pass again, zero VUIDs/skips, and the shader-memory binary hash exactly matches its initial candidate hash. Source is clean; head unchanged throughout. Both complete harnesses (including mutation builds/tests/restoration) ran under the title-free infrastructure reservation/FIFO with service-owned PTYs and exited 0; reservation released.
  • Conventions/whitespace pass; current-main merge preview clean. No new title, performance, Windows or console claim. Earlier external reports retain their original pins.

Evidence: frozen source, raw paired logs, mutation failures and restored hashes (SHA-256 5639dd666ace9cf200e3ecedfe26156cdf104fa0a2a716efbf06ffced283d5aa, downloaded bytes and internal manifest verified).
AI-assisted: yes.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 6c10eaa merged onto main 0dbf9fb · tested 2026-11-02 02:16 UTC · 26 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,442 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,493 of 3,164 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 (931 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lookup_log_fits_build 63.6 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 1 of the last 10 main runs
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 7 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 (5 IDs in 484 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (484 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 476 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-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
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 6c10eaa9585ebe01e2b0656f1cd0f415d4f83370 0dbf9fb7d2d3a16859a0b3bb7b8b86bc93bea9ef
git checkout 0dbf9fb7d2d3a16859a0b3bb7b8b86bc93bea9ef && git merge --no-ff 6c10eaa9585ebe01e2b0656f1cd0f415d4f83370
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.

@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; the shader and SRT tests passed on Windows, and the descriptor web-fault checks did not run

This PR moves HoldsControlValue out of ResourceTracker into a shared predicate in SrtInstructionPredicates.cpp, and adds WqmU64 to the opcodes it traces through. The move is mechanical. The new opcode changes which whole-quad masks count as control values. I read the production change in full. The Windows run passed agc_shader_memory and agc_shader_srt_read_patching, but the new whole-quad checks are in an execution test that Windows does not run.

What I ran

  • Head 6c10eaa9585ebe01e2b0656f1cd0f415d4f83370; base e0caf1360035286bd22b9f2a3030e97b880ffb28. 5 files, +72/-39: SrtWalker/SrtInstructionPredicates.cpp (+41), Optimization/src/ResourceTracker.cpp (-39), SrtInstructionPredicates.hpp (+1), libSceAgcDriver/tests/ShaderMemory.cpp (+19) and tests/execution/DescriptorWebFaults.cpp (+11).
  • Read the production change in full: the removed static member and its recursive helper, the free function in Detail, the one new opcode case (value->Opcode() != IrOpcode::WqmU64), and the changed call site.
  • Test changes: read the three added Require checks in DescriptorWebFaults.cpp by their messages. ShaderMemory.cpp (+19) was not read.
  • DescriptorWebFaults.cpp is one of the tests/execution/*.cpp files that the build globs (CMakeLists.txt line 556). Windows builds it as a skip stub unless it is listed in ANYPS5_AGC_EXECUTION_TESTS, and the Windows list is F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown.
  • Hosted, Windows CTest: 21 of 21 passed. agc_shader_memory (Test #1918) and agc_shader_srt_read_patching (Test #1902) passed. No case for DescriptorWebFaults appears in the run.
  • Read-only checks from the trusted main checkout: diff check and conventions passed. ABI audit not applicable. Stack check: clean, no declared dependencies, no errors.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed stack check: clean; no declared dependencies
ABI audit not applicable no export changed
agc_shader_memory (hosted, Windows) passed Test #1918
agc_shader_srt_read_patching (hosted, Windows) passed Test #1902
Moved HoldsControlValue and the WqmU64 case (read) passed by reading the move is mechanical; no blocking defect found in the read
Whole-quad checks in DescriptorWebFaults.cpp (hosted, Windows) not verified an execution stub on Windows; no case in the run
ShaderMemory.cpp additions not verified not read
Relinkers, relinker-asan and library-portability (hosted) passed all succeeded
Negative controls not run no local build
Read-only check output

Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: clean, no declared dependencies, no errors. Hosted: gh api repos/boykopovar/AnyPS5/commits/6c10eaa9585ebe01e2b0656f1cd0f415d4f83370/check-runs, and the Windows job log (21 of 21).

Negative control

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

Findings

Blocking

None from the code read.

Non-blocking

  • WqmU64 now counts as a control value that the walk traces through. The walk treats only runtime-uniform values this way, so the change assumes a whole-quad mask is uniform for every use that reaches it. That assumption is not verified here. The new checks in DescriptorWebFaults.cpp are the stated evidence, and they did not run on Windows.

Sources

Not verified

  • The whole-quad checks in DescriptorWebFaults.cpp (execution stub on Windows, no case in the run).
  • The ShaderMemory.cpp additions.
  • That a whole-quad mask is uniform for every use the walk reaches.

To get this to a good state

  • Run DescriptorWebFaults at this head on a host that builds the execution tests, or add it to the Windows execution list. Nothing else blocking.

@JJenkx

JJenkx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX10 The exact-head Linux execution evidence already covers the requested compiled-host alternative: qualification for 6c10eaa9. DescriptorWebFaults was built as the real execution target on RX 6650 XT / RADV, with actual Khronos instance/device layer insertion: main and change both passed the same two focused tests, with zero skips or VUID IDs. The CPU direct-provenance assertions also have two production-only negative controls and a passing restored run.

This is Linux evidence; the hosted Windows execution-list limitation remains as you described. No additional source change or run is claimed.

This also supplies the execution qualification for your earlier change request on this head; please re-review when available. AI-assisted: yes (Codex).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
# Conflicts:
#	core/shader/recompiler/Optimization/src/ResourceTracker.cpp
@JJenkx

JJenkx commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (4f41f4c375) into this branch to resolve the conflict in ResourceTracker.cpp. New head: f2260726fe.

What the conflict was: #12132 (merged on main) renamed the tracker's local HoldsControlValue to HoldsFoldableValue. It also added LaneId, ImageRead, ImageSampleExplicitLod, ImageSampleImplicitLod and ImageSampleRaw as roots, because a descriptor web can now fold paths that depend on the lane index or on texels. This branch had moved the same helper into ShaderRecompiler::Detail and let it pass through WqmU64.

Resolution: the shared predicate is now Detail::HoldsFoldableValue. It has main's roots and this branch's WqmU64 propagation, and the tracker's call keeps depth 8. So the "traversal unchanged" sentence in the description no longer holds exactly. The predicate is the union of both changes, and nothing else differs. The two direct provenance checks in verifyDescriptorPhis now call it by the new name; what they assert is unchanged.

Tested on the merge head (Release, AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Linux 7.2.11):

  • agc_shader_memory_tests: all 22 tests pass, including agc_shader_descriptor_phis and agc_shader_memory.
  • agc_driver_descriptor_web_faults, with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1: passes (1 of 1, "descriptor web fault tests passed"; no VUID- in its output).

AI-assisted: yes.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head f226072 merged onto main 4f41f4c · tested 2026-11-03 11:50 UTC · 34 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,687 passed · 4 failed (0 new, 2 also fail on main, 2 unstable on main) · 48 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,739 of 3,811 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 (922 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 4 of the last 10 main runs
agc_driver_submit_progress: failed in 5 of the last 10 main runs
Failing on main too (2, not counted against this PR)
agc_driver_image_table
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 517 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (517 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 509 more
VUID-vkCmdCopyImage-srcImage-01548 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-vkCmdCopyImage-srcImage-01551 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (48)
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_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
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 co
Reproduce
git fetch origin f2260726fea78e72ab7b90fb573afbd7112fcf00 4f41f4c375f5abb487dbd184fbc150f31994d762
git checkout 4f41f4c375f5abb487dbd184fbc150f31994d762 && git merge --no-ff f2260726fea78e72ab7b90fb573afbd7112fcf00
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.

@adriadam10 adriadam10 self-assigned this Nov 6, 2026
@adriadam10
adriadam10 merged commit 493aab5 into boykopovar:main Nov 6, 2026
15 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the WqmU64 traversal in HoldsFoldableValue (the move to SrtInstructionPredicates.cpp is mechanical after #12132, depth bound unchanged), the direct provenance assertions (positive for EXEC, negative for user data), the three GPU cases, and the NVIDIA/Windows reports on this head; merged.

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

Labels

agc libSceAgc* shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants