Skip to content

fix(kyty): catch compile-ahead translation stops on Windows - #299

Closed
Ryongen wants to merge 1 commit into
simnJS:AnyKytyfrom
Ryongen:fix/kyty-windows-contain-compile-ahead
Closed

Ryongen wants to merge 1 commit into
simnJS:AnyKytyfrom
Ryongen:fix/kyty-windows-contain-compile-ahead

Conversation

@Ryongen

@Ryongen Ryongen commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

What

On Windows a translation stop inside a compile-ahead job ended the run even with KYTY_FALLBACKS=1 (#297). The Kyty code (clang, native SEH unwind data) throws through libc's __cxa_throw, and libc's unwinder gave up on two things:

  • a native frame with a handler, in a module that has DWARF tables but no .sehgcc personality table. That table (SehPersonalities.cpp) was only linked on SEH toolchains, so libSceAgcDriver.prx and the Kyty test executables never had it. It is now built on every MinGW toolchain and attached to Kyty::gpu when the libraries use DWARF exceptions.
  • the GCC-built frames of libSceAgcDriver.prx itself: its .eh_frame was only renamed to .ehfram in the NID-patched copy, so the unpatched copy the tests load was not unwound. It now gets configure_windows_unwind like the other libraries.

With both, Fallback::Containable() returns true on Windows as on Linux, kyty_shim_fallback and kyty_shim_speculative_compile run on Windows too, and the Windows-only uncontained mode goes. KYTY_FALLBACKS stays off by default on Windows.

Tested

Windows 10, RTX 2070 SUPER, rebased on 8bf7cc52cf. On base both tests end with [libc] unhandled exception 'N6Common13SoftExitErrorE' / terminate called; with this change both pass. All 103 kyty_shim tests and the 192 exception, unwind and rethrow tests pass. With ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer (layer 1.4.363), ctest -R kyty_shim on base and on this change: the loader inserts the layer in both logs, neither has a VUID- error, and both fail the same two tests (kyty_shim_bda_load_forms, kyty_shim_wave_split_written_reads: replay did not complete), which skip on this machine without ANYPS5_REQUIRE_VULKAN.

Grand Theft Auto V (PPSA38500 01.002.001) with KYTY_FALLBACKS=1: the run used to end at the first compile-ahead stop (#294, about 55 s in). It now runs about 2 minutes, skipping 27 compute shaders that fail to compile, which are now all listed in one run: 26 buffer descriptor is not a valid runtime value and one VOPC SDWA modifier CFG failure (0x10b76d3854f99f9e). Then the title crashes itself on purpose in a worker thread (mov dword ptr [0], 0x21), probably because of the skipped work.

Checklist

The kyty code throws through libc's unwinder, which could not walk its SEH frames without the personality table or see the driver's DWARF frames under the long section name. Link the table into kyty consumers, rename the driver's section, and contain the stop as on Linux.
@simnJS simnJS added bug Something isn't working area: windows Windows build and runtime area: shaders Shader recompiler, SPIR-V, pipeline creation and compile stalls labels Nov 25, 2026
@simnJS

simnJS commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Merged into AnyKyty as ce1c67df6a (fast-forward, your commit as is): CI green on Linux, sanitizers, lavapipe and Windows, with kyty_shim_fallback and kyty_shim_speculative_compile now running on Windows too. Thanks a lot, Ryongen, this also closes #297.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: shaders Shader recompiler, SPIR-V, pipeline creation and compile stalls area: windows Windows build and runtime bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kyty: on Windows, a translation stop in a compile-ahead job is not contained by KYTY_FALLBACKS

2 participants