SPIR-V validation after optimization fails on a specialized module and aborts the title (Demon's Souls, Linux) #4205
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 btsouth on 2026-10-12T01:19:37Z.
With
ANYPS5_ENABLE_SPIRV_TOOLS=ONandAPS5_SPIRV_OPT=none, specialized modules are still optimized (thenoneshortcut inValidateAndOptimizeSpirvonly applies whenspecializeis false). In Demon's Souls PPSA01342 v1.005 (US), one of them failed validation after optimization during presentation and the process aborted:The module passed the validation that runs before optimization, so the invalid structure comes from the optimizer passes. It is the same validation rule as #1921, which was about the recompiler's own output.
Skipping optimization of specialized modules avoids the crash here, and the title then presents frames. A narrower fix could be to log the failure and keep the unoptimized module when the optimized one fails validation, since the input already validated. I have not tested that change on its own.
Setup: main
bab7b328with #4049 and #758 merged locally, Release, Arch Linux kernel 7.2.8, GCC 16.2.1, RTX 4070 SUPER on driver 615.78.08. I did not capture the module. I can rerun with a shader dump if that would help.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T01:26:22Z.
I confirmed
ValidateAndOptimizeSpirvvalidates input before optimization, then throws if the optimized module fails validation. I am investigating a generic fallback to that validated input, with a regression test that exercises post-optimization validation failure. Could you attach the specialized SPIR-V dump (and, if possible, the corresponding unspecialized module) or a minimal reproducer? That would let me verify the same optimizer failure path against this report.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T06:18:14Z.
#4018 is on main now. It fixes this validation error (
The continue construct ... is not structurally post dominated by the back-edge block) for a loop shader of the same title. Could you rerun on current main without #4241, and attach the specialized module if it still fails?Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-14T05:36:10Z.
@oneandonlydean rerun on current
mainwithout #4241: neither failure reproduces.Setup: Demon's Souls PPSA01341 v1.07, Linux, RTX 5070 Ti, NVIDIA 595.91.
main7a0c838cawithANYPS5_ENABLE_SPIRV_TOOLS=ONand the default optimizer (noAPS5_SPIRV_OPT). The build also has local merges of #758, without which the title stops before this point, and #5181, which keeps memory under my run cap. No #4241.Result in a 1200 s run: initialization finished at 13.8 s and the main loop started at 51.5 s. The title ran at about 17.9 fps for about 600 s, and then the tutorial level loaded, compiling 2857 new modules, until the time limit. The log has no
validation after optimizationornot structurally post dominatederrors and no shader registration failures. The level itself wasn't reached in this run, because compiling with the tools on is slower.On the 10-11 base (
7a84b222, tools on) the same title aborted at t+19 on shader 0x2489e0100 (word 6177, #4018's shader). WithAPS5_SPIRV_OPT=noneit aborted after frame 3 on a specialized module (word 10069), the failure reported here. #4018 and #4600 have merged since.From the Demon's Souls side, this can close.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:43:16Z.
Closing: fixed on main by #4018 and #4600; fisherjoey's 1200 s Demon's Souls run on current
mainshows neither validation failure. If it comes back on current main, comment here with the shader and the log line.