Repository navigation
Description
What happens
Hades II crashes before its first frame on AnyKyty under Windows, on every launch (7 of 7, with and without a replayed controller recording). The game's LoadTaskScheduler thread writes through a null pointer inside the guest libc's memcpy, right after the game opens /app0/Content/Game/GUI/Platform/PlayStation/LaunchScreen.sjson:
FATAL: unhandled exception 0xc0000005 on thread 16372 'LoadTaskScheduler'
rip 0x00007ffb7ddf3fb0 libc.prx.guest.prx+0x13fb0
write of 0x0000000000000000
rax 0000000000000000 rbx 0000000000000000 rcx 0000000000000030 rdx 0000000000004000
rsi 00000000015e2e2b rdi 0000000000000000 rbp 000000fd1858f130 rsp 000000fd1858f130
frame pointer chain:
#0 PPSA36082.exe+0x29fbae
#1 PPSA36082.exe+0x29f775
#2 PPSA36082.exe+0x29fecd
#3 PPSA36082.exe+0x29fcdb
#4 PPSA36082.exe+0x242e91
#5 PPSA36082.exe+0x23f723
#6 PPSA36082.exe+0x1e4166
#7 PPSA36082.exe+0x27057d
#8 PPSA36082.exe+0x6e5af
#9 PPSA36082.exe+0x3eed1e
#10 libkernel.prx+0x8885f
The other six launches stop at the same place (libc.prx.guest.prx+0x13fb0, once +0x13dba), with the same frame chain, rdi = 0 and a copy of about 16 KiB (rdx 0x3ff0 to 0x4000). Nothing about memory or mapping is logged before it. The process had about 3 GB committed, and Windows had about 11 GB of commit left.
Upstream AnyPS5 main 47139cd (default backend, same machine, same day) hit the same crash once in 8 launches: same rip, rdi = 0, rdx 0x4000, and the same game frames except one return address in the same caller (PPSA36082.exe+0x1e4138 instead of +0x1e4166); the other 7 played. So the race is probably not the Kyty core's alone, but the Kyty backend makes it certain here.
Call trace
Two more launches converted with --trace-imports and run with APS5_TRACE_CALLS=all, APS5_CRASH_INDIRECT_MEMORY=1 and APS5_CRASH_STACK_BYTES=4096 crash the same way (libc.prx.guest.prx+0x13fb0). The last 64 traced calls in both reports all come from one other game thread, which polls in a loop from PPSA36082.exe+0x3eeb4b..+0x3eebc9: libSceSaveDataDialog KK3Bdg1RWK0, libkernel -2IRUCO--PM and 1j3S3n-tTW4, libSceUserService yH17Q6NWtVg, about 69 to 117 million times each before the crash. So the ring holds nothing from LoadTaskScheduler. I have not checked whether upstream main polls the same way. The full reports (stack bytes and pointer contents included) are available.
Build
- AnyKyty
a4b4360d66(AnyKytybranch), built as the Windows job ofanykyty.ymldoes: WinLibs GCC 15.2.0 (15.2.0posix-14.0.0-ucrt-r7) and LLVM 21.1.8, Release,-DANYPS5_GPU_BACKEND=kyty -DBUILD_TESTING=OFF. ThinLTO off (the Windows default), PGO profile used. Targetskyty_gpu libs relinker. - No
KYTY_*settings: the log says[kyty] runtime started, settings: Kyty's defaults. Native ray tracing came on ([kyty] native ray tracing on NVIDIA GeForce RTX 4060).
Host
Windows 10 22H2 (19045), Ryzen 5 5600, RTX 4060 (NVIDIA 621.14), 32 GB RAM.
Not tried yet
Linux, and turning off the fork's switches one by one (KYTY_REPLAY_GPU_PAGE_READS=0, KYTY_REPLAY_AFTER_READBACK=0, KYTY_WRITE_FAULT_BLOCKS=0, KYTY_FAST_TLS=0, KYTY_NATIVE_RT=0). I can run any of these, or a debug build, if it helps. The full stderr.log of a launch is available.
Activity
simnJS commentedon Nov 22, 2026
@talha-devp thanks, that's a very clean report: 7/7 launches, the upstream comparison, and the trace ring. Since upstream
mainalso hits it once in 8 launches on the same frames, this looks like a race in the game's load path that Kyty's timing makes systematic, not a bug in the Kyty GPU core itself. Nothing in the GPU side touchesLoadTaskScheduler's buffers.What the data says so far:
memcpywrites ~16 KiB (rdx0x3ff0-0x4000) tordi = 0right afterLaunchScreen.sjsonis opened. So the destination buffer was never set, or came back null. Three things would narrow it down:PPSA36082.exe+0x29fbae/+0x29f775, in your own local disassembly of the converted exe (please don't post game code here). Isrdithe result of an allocation (libcmalloc/memalign,sceKernelMapFlexibleMemory,mmap, or a game pool), or a field of a load-request object filled by another thread?KK3Bdg1RWK0/-2IRUCO--PM/1j3S3n-tTW4/yH17Q6NWtVg, ~100M calls each). If you can leave those NIDs out of the trace, or trace onlyLoadTaskScheduler, check whether an allocation or mapping call on that thread returns null or an error code shortly before the crash. A silent allocation failure that the game doesn't check would fit "null destination, fixed size" very well.mainspins the same way, and whether one of those calls returns a status the game doesn't expect (a dialog that never reaches "finished", for example). The load path may be waiting on state that this loop is supposed to set up.If you track it down, a PR is very welcome. The fix will most likely be in
libkernel,libcorlibSceSaveDataDialograther than in the GPU side, so it should go upstream too. I've labelled the issue for Windows and game-specific testing.talha-devp commentedon Nov 22, 2026
@simnJS Thank you for your feedback! I will try a PR when my Claude resets tomorrow :) Currently 96% used...
talha-devp commentedon Nov 23, 2026
@simnJS Tracked down, fix in #286.
Answers to your three points:
sceKernelAllocateMainDirectMemoryandsceKernelMapDirectMemory: 512 MiB, 6 GiB and 128 MiB, all succeed), and nothing asks the kernel for more later. The 512 MiB pool simply fills up.What fills the pool: reading the game's pool and resource loader state from outside the process every 0.5 to 2 ms (
ReadProcessMemory, so the timing stays as it is; under a debugger the crash goes away):7de61e3451main47139cd910The loader's copy fences always completed at once, and the Kyty GPU threads were idle. The game tiles its textures with the CPU into its 6 GiB GPU pool, and on Windows each first write to a 4 KiB page of that never-touched direct memory takes a demand-zero fault. The loader falls behind the two
LoadTaskSchedulerthreads, and their staging buffers pile up until the pool is full. It is the Windows half of what #163 fixed on Linux; upstreammainavoids it because its GPU driver imports guest memory into Vulkan, which keeps it resident.#286 populates each new direct mapping on Windows the way the Linux
populatebacking does (read once on several threads while a quarter of host memory stays free;KYTY_DIRECT_MEMORY_PAGES=demandkeeps the old behaviour). With it, Hades II started 10 of 10 times (15 of 15 crashed before), page faults during the load dropped to 180 to 400/s and the pool peaked at 359 to 388 MiB. The cost is about 0.9 s once at start, and the mapped direct memory becomes resident.Thanks for the pointers, they helped a lot.
fix(kyty): populate direct memory mappings on Windows too
simnJS commentedon Nov 26, 2026
Fixed on
AnyKytyby your #286 (62fb28865c, Windows direct mappings populated as on Linux, theneb5103d101, reads throughReadProcessMemorythat stop at a page that goes away) and #301 (47326de335, populate as much as fits, so 16 GB hosts aren't skipped). With #286 the title started 10 of 10 times instead of crashing 15 of 15. Thanks @talha-devp for tracking the staging pool down from outside the process; that was the hard part.