Skip to content

fix(shader): print the shader hash of a SPIR-V emission failure in hex - #7610

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/spirv-failure-hash-hex
Oct 20, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/spirv-failure-hash-hex

Conversation

@milescoviello

@milescoviello milescoviello commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What

FailProgram and SpirvValueEmitContext::Fail in SpirvEmitter.cpp built their message as "SPIR-V emission failed: hash=0x" + std::to_string(shaderHash), so the hash printed after 0x was in decimal. In #5398 the failure was quoted as hash=0x74955231232, which is shader 0x1173ae1000, the address the same issue gives for it elsewhere. Both now print the hash in hex through one helper, FailureText. The rest of the message is unchanged.

ExitDescriptorBindingFailure in SpirvDescriptors.cpp prints the hash in decimal without 0x. This PR doesn't change it, because #6947 edits that file's includes at the line the change would need.

Tested

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

  • New agc_spirv_failure_text (CPU only). It emits a compute program with hash 0x1173ae1000 twice: once without its compute input info (FailProgram) and once with an unlowered Unreachable (Fail(inst)). Both messages must start with SPIR-V emission failed: hash=0x1173ae1000 stage= and keep their reason.
    • With this change: passes, 3 runs of 3.
    • With main's SpirvEmitter.cpp: fails with got "SPIR-V emission failed: hash=0x74955231232 stage=4 reason=compute input info is missing".
    • With only the Fail(inst) site reverted: fails on the second case with hash=0x74955231232 stage=4 opcode=Unreachable.
  • The 63 tests matching spirv|shader|guarded|wave32|recompil|agc_driver_graphics$ pass. No test or tool reads the old text.

tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py lists only open pull requests that add tests to libSceAgcDriver/CMakeLists.txt, plus some that conflict with main and touch SpirvEmitter.cpp. None of the latter edit these two functions or the includes.

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); the new test runs on the CPU only; AMD Radeon RX 7900 XT, RADV Mesa 25.2.8 (by @DavidAmsellem)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

The SPIR-V emission failures printed the shader hash with std::to_string
after "hash=0x", so the hash read as a hex number that was the decimal one.
Shader 0x1173ae1000 was reported as hash=0x74955231232. Both now print it in
hex, as the driver's own messages print the shader address.

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 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6488 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6611 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6682 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7392 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7446 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7464 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7484 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7647 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7922 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 7948 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8004 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8160 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8161 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@github-actions github-actions Bot added build shader core/shader agc libSceAgc* labels Oct 18, 2026
@DavidAmsellem

Copy link
Copy Markdown
Contributor

Tested on AMD on Linux, which this PR had not covered.

  • GPU: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), radv, Mesa 25.2.8-0ubuntu0.24.04.4
  • OS: Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3
  • Built 1f9ac4080 merged into main 0bc3003f8, Release, BUILD_TESTING=ON

agc_spirv_failure_text passes.

Full ctest with ANYPS5_REQUIRE_VULKAN=1: 1479 of 1481. Both failures also happen on main
without this PR and are unrelated to it:

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @DavidAmsellem for the AMD Linux run. Added to the description.

AI-assisted: yes (Claude Code)

@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@adriadam10
adriadam10 merged commit 891d567 into boykopovar:main Oct 20, 2026
14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Rechecked against current main: both emission-failure sites still go through FailureText and print the hash in hex, and agc_spirv_failure_text pins the exact text for FailProgram and Fail(inst) and fails on main's decimal output. Registration follows the neighbouring SPIR-V tests; merged.

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @adriadam10 for the recheck and the merge.

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* build shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants