Skip to content

fix(shader): give a registration result one empty table column per static image table - #21180

Closed
CPritch wants to merge 1 commit into
boykopovar:mainfrom
CPritch:fix/shader-prebuild-tables
Closed

CPritch wants to merge 1 commit into
boykopovar:mainfrom
CPritch:fix/shader-prebuild-tables

Conversation

@CPritch

@CPritch CPritch commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

RegistrationResult built its resource snapshot with no image table columns. materializeResult then threw "image table snapshot disagrees with the static tables" for every shader with an image table or a sampler table, and the shader library prebuild logged "shader library prebuild skipped" for it. Only shaders without such tables ever prebuilt. This follows on from #8678.

RegistrationResult now sizes snapshot.tables.tables to one empty column per static image or sampler table, the count ResourceMaterializer::ResolveImageTables expects.

agc_driver_image_table now prebuilds the fragment library of a shader with an image table through RegistrationResult and PrebuildGraphicsLibraries.

Tested

Linux, NVIDIA GeForce RTX 5060 Laptop GPU (driver 615.78.08), Khronos validation layer, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. No title was run.

  • main plus the new test: ctest -R '^agc_driver_image_table$' -V fails with "image table snapshot disagrees with the static tables".
  • this PR: the same command passes, with no VUID- and no layer-missing message.
  • all 1798 AGC driver and shader recompiler tests under the validation layer: 0 failed, 23 skipped for device limits, no VUID-.

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 5060 Laptop GPU, driver 615.78.08, Linux
  • AI-assisted: yes

🤖 Generated with Claude Code

…atic image table

RegistrationResult built its snapshot with no image table columns, so
materializeResult threw "image table snapshot disagrees with the static
tables" for every shader with an image table or a sampler table, and the
shader library prebuild skipped it. The snapshot now holds one empty column
per static table.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added shader core/shader agc libSceAgc* labels Nov 16, 2026
@NathanFahey23

Copy link
Copy Markdown
Contributor

Windows NVIDIA check of head 3a3aaa0d6b, merged onto main 1403ec8de7 (779589bee8, clean merge).

Setup: Windows 11 Home 10.0.26300, i9-13900K, WinLibs GCC 15.2.0, Release, RTX 4080 (10de:2704, driver 32.0.16.2101), ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, Khronos validation layer loaded. GPU set: ctest -R '^(agc_\|shader\|video_out\|guest_video)' --parallel 4, one run per side.

main 1403ec8de7 merge 779589bee8
GPU set 1910 pass, 20 skipped, 1 failed 1911 pass, 20 skipped, 0 failed
VUID- lines 0 0
agc_driver_image_table* (this PR changes ImageTable.cpp) 29 of 29 pass 29 of 29 pass
homebrew, 30 s each (tools/title_run.py, cold shader cache) Jelly5 rendering 118.0, VLC rendering 119.6, DriftCheck rendering 59.9, PS5SX2 rendering 59.8, DOOM rendering 36.4 Jelly5 rendering 118.2, VLC rendering 119.6, DriftCheck rendering 59.9, PS5SX2 rendering 59.8, DOOM rendering 36.4

main's one failure is agc_driver_unregistered_label_on_gpu (the label held 0x00000000 when a later label had landed). That's the known intermittent #17937: alone it failed 1 of 20 reruns on main. It passed on the merge and this PR doesn't touch it.

The one test not run on both sides is agc_driver_upload_cache_read_only_flush: its executable does not build on Windows on this main (setenv, fixed by #19899). The homebrew titles are Jelly5, VLC, DriftCheck, PS5SX2 and DOOM; fps is one run each, for whether they still render, not a performance comparison.

Not checked: AMD, Linux, macOS, any commercial title.

AI-assisted: yes

@tablefrogpillow

Copy link
Copy Markdown
Contributor

Linux/AMD cross-HW confirmation (3 gens) — complementing the Windows/NVIDIA check above. agc_driver_image_table on head 3a3aaa0d6b, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 + KHRONOS validation layer (confirmed loaded via VK_LOADER_DEBUG=layer, so 0-VUID is meaningful):

  • Vega GCN5 (RADV VEGA10, Wave64): PASS, 0 VUID
  • RDNA2 (RADV RAPHAEL_MENDOCINO): PASS, 0 VUID
  • RDNA3 (RADV NAVI31): PASS, 0 VUID

With the fix, image/sampler-table shaders prebuild and execute — no "image table snapshot disagrees", no "shader library prebuild skipped". The per-case result lines are byte-identical across RDNA2/RDNA3 (no cross-gen divergence in the image/sampler-table execution).

Negative control — reverting only the Recompiler.cpp RegistrationResult sizing (back to no image-table columns), rebuilt: agc_driver_image_table FAILS with exactly image table snapshot disagrees with the static tables on both RDNA2 and RDNA3 — confirms the test genuinely gates on the fix. (Recompiler/registration-level throw, host-GPU-independent.)

The fix's effect is deterministic recompiler/registration output (identical across gens), so this is real-AMD execution confirmation across 3 gens rather than a cross-gen divergence result.

AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 3a3aaa0d6b1e4db516c39f8a886c8995cfa3a73b. I read the prepared description, commits, manifest, diff, and both changed files at the pinned head through repo_read.py. No tests or build commands were run; test results in the description are author-reported.

Results

Check Result Note
Changed code review passed Both changed files read
Tests in this review not run Author reports test runs

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not independently run the reported Linux/Vulkan tests or verify physical-console behavior. The listed changed files were both read. files.json was not available through the reader; no excluded files were identified from the manifest.

To get this to a good state

Nothing is required.

@github-actions

github-actions Bot commented Nov 16, 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 5609 core/shader/recompiler/Recompiler.cpp
PR 6412 core/shader/recompiler/Recompiler.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 6488 core/shader/recompiler/Recompiler.cpp
PR 6924 core/shader/recompiler/Recompiler.cpp
PR 7642 core/shader/recompiler/Recompiler.cpp
PR 7684 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 8939 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9356 core/shader/recompiler/Recompiler.cpp
PR 9387 core/shader/recompiler/Recompiler.cpp
PR 9457 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9508 core/shader/recompiler/Recompiler.cpp
PR 9633 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9749 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9790 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 9852 core/shader/recompiler/Recompiler.cpp
PR 9897 core/shader/recompiler/Recompiler.cpp
PR 9969 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 10193 core/shader/recompiler/Recompiler.cpp
PR 10359 core/shader/recompiler/Recompiler.cpp
PR 10652 core/shader/recompiler/Recompiler.cpp
PR 11483 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 12944 core/shader/recompiler/Recompiler.cpp
PR 13928 core/shader/recompiler/Recompiler.cpp
PR 13929 core/shader/recompiler/Recompiler.cpp
PR 14032 core/shader/recompiler/Recompiler.cpp
PR 14853 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
core/shader/recompiler/Recompiler.cpp
PR 14944 core/shader/recompiler/Recompiler.cpp
PR 15548 core/shader/recompiler/Recompiler.cpp
PR 15555 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 16391 core/shader/recompiler/Recompiler.cpp
PR 16472 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 16631 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 16812 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 16814 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 17056 core/shader/recompiler/Recompiler.cpp
PR 18106 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 18107 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 20030 core/shader/recompiler/Recompiler.cpp
PR 20111 core/shader/recompiler/Recompiler.cpp
PR 20248 core/shader/recompiler/Recompiler.cpp
PR 20519 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
core/shader/recompiler/Recompiler.cpp
PR 22071 core/shader/recompiler/Recompiler.cpp
PR 22424 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
core/shader/recompiler/Recompiler.cpp
PR 22647 core/shader/recompiler/Recompiler.cpp
PR 23242 core/shader/recompiler/Recompiler.cpp
PR 24523 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
core/shader/recompiler/Recompiler.cpp
PR 24987 core/shader/recompiler/Recompiler.cpp
PR 25010 core/shader/recompiler/Recompiler.cpp

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 3a3aaa0d6b, applied with git apply on main fd4aeed483 together with the other 27 PRs of one batch (#11049, #20072, #20406, #22100, #22892, #23774, #24199, #24495, #15314, #21221, #21486, #22597, #22839, #22895, #23550, #24672, #14573, #16873, #17113, #17879, #19183, #20057, #22066, #22219, #22781, #22958, #24478). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_image_table, agc_driver_image_table_cache, agc_driver_image_table_packed and 3 more (6 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 8 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked, agc_storage_write_back_host_retile. Traced to other PRs of the batch, each by reverting it and testing again: #21486 (agc_driver_graphics, agc_graphics_profile_draw), #24672 (guest_kernel_sys_neo_mode); none is in this PR's area. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): guest_indexed_draw. The 2125 agc_/video tests on the iGPU have 5 failing: agc_driver_graphics, agc_driver_stencil_plane_memory, agc_driver_store_over_untracked, agc_graphics_profile_draw, agc_storage_write_back_host_retile (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

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