Repository navigation
Conversation
05f7f85 to
29a8a0d
Compare
|
Windows red/green of head Setup: Windows 11 Pro (10.0.26200), WinLibs GCC 15.2.0 r7 UCRT, Release,
In the red arm the default, AI-assisted: yes. |
…d of aborting PlanRegistered decodes a shader when it is registered and defers it to its first use when the decoder refuses an instruction it does not support (UnsupportedInstructionError). Every other decoder failure, such as an unknown instruction family, an unimplemented VOP2/VOP3 opcode or an unsupported scalar source operand (std::invalid_argument, and std::runtime_error from the memory-op decoder), escaped the registration call and aborted the title. Registration does not run the code; the GPU only executes it at a dispatch or draw. Registration now defers on any decoder failure, and the stage still throws if the code fails to decode when it is used. The prepared-shaders registration test re-registered garbage code and expected the call to throw; it now expects the registration to succeed and restores the valid code before dispatching. A new mode, deferred_unknown_word, registers a program with an unknown-family word and checks that its dispatch fails with that decoder message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29a8a0d to
ea23d0e
Compare
|
The This PR adds a test mode to Could a maintainer rerun the AI-assisted: yes. |
|
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.
|
|
Ran this PR merged onto
Failures
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing in the reviewed changes blocks merging; the registration deferral and tests match the stated behavior.
What I ran
Reviewed head ea23d0e6548734e42962f1b2500914fc945a43de using repo_read.py. No commands or tests were run by me; test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Change review | passed | Three changed files read |
| Tests | not run | Results reported by author |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read ShaderRegistry.cpp, agc_driver_prepared_shaders_tests.cmake, and PreparedShaders.cpp, including the changed hunks and relevant surrounding functions. All three files listed in the manifest as reviewed were read. files.json was not available through the reader, so I could not confirm whether it lists exclusions. I did not run the tests or verify the behavior in the title.
To get this to a good state
Nothing is required.
ligmaSec
left a comment
There was a problem hiding this comment.
The trial merge onto c1601e56d5 conflicts in the prepared-shader execution fixture and its CMake registration. Please limit deferred registration to decoder failures. The new std::exception catch also handles allocation failure from decoding, which would mark a resource failure as a deferred shader. Keep the unknown-word case, the existing unsupported-instruction case, and the test that a deferred failure reaches its first-use boundary.
AI-assisted: yes.
What
PlanRegistered(ShaderRegistry.cpp) decodes a shader as soon as it is registered. If the decoder refuses an instruction it doesn't support (UnsupportedInstructionError), the shader is deferred to its first use. Every other decoder failure escaped the registration call and aborted the title. Those failures are:std::invalid_argument: an unknown instruction family, an unimplemented VOP2/VOP3 opcode, or an unsupported scalar source operand;std::runtime_errorfrom the memory-op decoder.Registration doesn't run the code; the GPU only executes it at a dispatch or draw. With this PR, registration defers on any decoder failure: it logs the existing "could not be prepared at registration (...); preparing it when it is used" line. A stage whose code still fails to decode when it is used throws there as before.
RESIDENT EVIL requiem (PPSA31246, #11599) hit this in about one New Game load in four on Windows, 2–4 minutes into loading, each time with a different message:
unknown RDNA instruction family at program counter 0x00001504 raw word 0xc3800000unknown RDNA instruction family at program counter 0x00002304 raw word 0xff08aa1funsupported scalar source operand code 112 at program counter 32216VOP2 opcode is not implementedBoth symbolized stacks end in
PlanRegistered→RdnaInstructionDecoder::Decode→DecodeRdnaProgram.Tests:
tests/execution/PreparedShaders.cppre-registered a shader with garbage code (0xffffffff) and expected the call to throw. It now expects the registration to succeed, then restores the valid code before its dispatches. Its later check, that a dispatch of an invalid program fails, is unchanged.deferred_unknown_word, sharing a helper withdeferred_undecodable: it registers a program whose second word is0xc3800000, one of the words from the requiem aborts. Registration must not throw, and the dispatch must fail withunknown RDNA instruction family.Tested
Windows 11 (26200), Ryzen 7 9800X3D, RX 9070 XT (AMD 26.6.2 / 32.0.31021.1015), MinGW GCC 15.2, Release,
main4f41f4c.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R agc_driver_prepared_shaders -V:VUID-linesmaincode and testsmain'sShaderRegistry.cppwith this PR's testsdeferred_unknown_wordwithunknown RDNA instruction family at program counter 0x00000004 raw word 0xc3800000The loader log shows
VK_LAYER_KHRONOS_validationinserted in every run.Not yet run in the title with this change on its own; the requiem stack it was found on has other local changes.
tools/pr_overlap.pyreports a one-line conflict with #9563 in the test's argument check.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)🤖 Generated with Claude Code