fix(shader): clear BDA ABI after removing address bindings #7817
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7817"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T08:49:21Z.
What
After descriptor specialization, full SPIR-V optimization can remove the last fault-buffer descriptor while the materialized program retains the prepared artifact's BDA ABI version. The driver rejects the otherwise valid shader with
AGC graphics: incompatible BDA ABI version.Clear the materialized BDA ABI version when neither an address-table nor a fault-buffer binding survives. Retain the existing ABI version for live bindings; driver validation remains unchanged. Add focused optimizer-disabled/full tests covering both removable 32-bit atomic fault machinery and a 64-bit atomic whose fault buffer must remain.
Tested
Linux, Radeon RX 6650 XT (RADV, Mesa 26.2.4-arch1.1), SPIRV-Tools enabled. Single commit on upstream main
52f8222af1c251818210862e4eeae941cb853e85.Before the fix on the local integration base,
agc_shader_specialized_bda_abi_fullfails withfinal fault binding and BDA ABI disagree; optimizer-disabled control passes.On main plus this change: built
agc_shader_memory_tests,agc_driver_graphics_tests,agc_spirv_optimizer_tests; all five CTests pass:agc_shader_specialized_bda_abi_none,agc_shader_specialized_bda_abi_full,agc_shader_memory,agc_driver_graphics,agc_spirv_optimizer.Additional native smoke test on the existing Crimson Spires integration branch plus this fix (not clean main):
PPSA03568,APS5_SPIRV_OPT=full, reaches the driving cutscene and closes normally, native exit 0. The prior integration build aborted with the ABI error. This is crash-fix evidence, not a performance comparison or a claim that this change alone brings up the title.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass. Open-PR overlap audit run; no matching ABI implementation found in the shared-file patches inspected. Some comparisons remain unavailable because those PRs conflict with main.Independent Windows validation reported by @LeandroLP23 (full report): AMD Radeon 860M (RDNA 3.5), AMD Windows driver 32.0.13058.8001, Windows 11 (reported by @LeandroLP23); WinLibs GCC 15.2.0, Release, SPIRV-Tools enabled,
ANYPS5_NO_SHADER_CACHE=1. With the PR head merged into main118266aec, directagc_shader_memory_tests --specialized-bda-abiruns pass all three cases with bothAPS5_SPIRV_OPT=noneandfull. With main'sRecompiler.cppand this PR's tests, optimizer-disabled passes and full fails withspecialized buffer atomic: final fault binding and BDA ABI disagree. The default shader-memory executable also passes. These are the tester's Windows results, not our own Windows execution.Additional isolated current-main check on upstream
9d2d40f5eedfa8c5f4312517175147eb0181001a: the same five focused CTests pass with only this fix applied (baa24e013e7612783684e83772962cb4b2fb0bca). In matching native Crimson Spires startup runs withAPS5_SPIRV_OPT=full, main aborts withcompute shader 0x200a430000: AGC graphics: incompatible BDA ABI versionabout 100 seconds after launch; main plus this fix passes that point and later aborts at about 124 seconds with the separateAGC graphics: non-finite register at DWORD 9failure. Both processes exited, configurations were restored, and neither reached the driving scene. This isolates removal of the ABI blocker; it does not establish title bring-up or a performance gain.Additional independent Windows validation reported by @savvaniss (full report): Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. PR head52491e93fmerged into main85029a00f: all 16 ShaderMemory CTests pass three times on both Intel UHD Graphics 770 (driver 32.0.101.7088) and AMD Radeon RX 9070 XT (driver 32.0.31041.1004;VkCacheemptied first). The comparison runs pass the 15 tests registered on main; the new test is not registered there, so those runs do not demonstrate the new test failing before the fix. These are the contributor's reported results, not our own Windows runs.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-19T10:44:07Z.
AMD's own Windows driver, with SPIRV-Tools. AMD Radeon 860M (RDNA 3.5,
1002:1114), driver 32.0.13058.8001, Windows 11, WinLibs GCC 15.2.0, Release,ANYPS5_NO_SHADER_CACHE=1. Head merged intomain118266aec(clean merge). "Main's sources" means this PR's test files overmain's other files.That build has
BUILD_TESTING=OFF, so I ranagc_shader_memory_tests --specialized-bda-abidirectly, with the environment this PR registers (ANYPS5_NO_SHADER_CACHE=1,APS5_SPIRV_OPT=none|full,libconPATH).APS5_SPIRV_OPT=noneAPS5_SPIRV_OPT=fullmain'sRecompiler.cppspecialized buffer atomic: final fault binding and BDA ABI disagreeagc_shader_memory_testswith no arguments also passes on this head. This is the same split you saw on RADV, here on AMD's own driver.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-19T12:38:21Z.
Review: COMMENTED
Verified the diff, conventions, and test coverage in PR #7817:
core/shader/recompiler/Recompiler.cpp, resettingbdaAbi = 0when full SPIR-V optimization eliminates both address-table and fault-buffer bindings correctly aligns the materialized shader artifact with the driver's descriptor expectations, preventing falseincompatible BDA ABI versionrejections.tests/ShaderMemory.cppregistered underCMakeLists.txtcover both optimizer disabled (none) and enabled (full) paths, validating that 32-bit atomic fault machinery is stripped cleanly while live 64-bit atomic fault buffers remain intact.conventions,eligibility,intake,labels,report).Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T14:34:02Z.
AMD and Intel Windows data: the 16 tests built from
tests/ShaderMemory.cpppass with this PR on an AMD RX 9070 XT and an Intel UHD 770, including the newagc_shader_specialized_bda_abi_none.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This head52491e93fmerged intomain85029a00f. "Without" means only this PR's diff totests/ShaderMemory.cpp, applied tomain85029a00f.tests/ShaderMemory.cppmainpassThe without run cannot show the new test failing: it is registered by this PR's
CMakeLists.txtchange, so it does not exist onmain.AI-assisted: yes (Claude Code)