[GAME STATUS]: Dead Cells (PPSA15552) - hard hang on Linux/RADV: gfx queue stuck on IT_WAIT_REG_MEM_64 (fence 0x219f399d8 never written) #1189

Closed
opened 2026-11-26 09:47:10 +00:00 by github-bot · 6 comments
Owner

@⁠tyyyyyyyyyyyyyyyy on GitHub · 2026-10-08 06:02 UTC · original

Game title

Dead Cells

Game ID / serial

PPSA15552 (tested both the 01.000 and 01.005 dumps)

KytyPS5 version

KytyPS5-2026-10-08-5a88080-3-g88213526 (= upstream 5a880808 + a one-line local patch making
VK_KHR_fragment_shader_barycentric optional, which is required to run at all on RDNA1/RADV). The hang also
reproduces on my earlier builds 1f6031e, d10eab0, f127dc8.

OS

Ubuntu 24.04.3 LTS, kernel 6.17.0-20-generic. Also reproduced on Batocera 41 (X11).

GPU + driver

AMD Radeon RX 5700 (Navi10 / RDNA1), RADV, Mesa 25.2.8 (also 25.3.6), Vulkan 1.4.318.
On Windows the same emulator code runs Dead Cells fine, so this appears Linux/RADV-specific.

Description

The game hard-hangs (screen frozen, process stays alive, no crash / exception / GPU reset in dmesg, no output in
the log after the freeze). It triggers a few seconds into gameplay and the exact spot varies with present mode, e.g.:

  • after the intro when the character transforms,
  • when opening the in-game Sound options menu,
  • after an R1 action at the "chopping block".

--present-mode Immediate / Fifo and --vblank-frequency 60 / 75 only change when it hangs; they never fix
it. The warning: NGS2 custom module/control ... ignored lines are benign audio skips and not related.

Root cause (gdb on a RelWithDebInfo build)

At the hang:

  • The guest thread is blocked in Libs::Graphics::GuestGpu::SuspendPoint
    (src/graphics/guest_gpu/graphicsRun.cpp:175) on m_suspend_point_ready->acquire().
  • The GuestGpu command loop (ThreadRun, graphicsRun.cpp:481) is stuck in the "all queues blocked" branch.
  • Inspecting the GuestGpu instance: m_submission_count = 3, m_queues[0].front().type = Graphics,
    ...front().blocked = true, ...front().command_execution.m_suspended = true, ...m_made_progress = false.
    m_queues[0][1] is the SuspendPoint submission stuck behind it.
  • Decoding the suspended command buffer (offset_dw = 3341, header 0xc0079300) gives opcode 0x93 =
    IT_WAIT_REG_MEM_64 with func = 3 (EQUAL), ctrl = 0x113, addr = 0x219f399d8, ref = 1,
    mask = 0xffffffffffffffff — i.e. the GPU waits for *(u64*)0x219f399d8 == 1, but that value stays 0 forever
    (verified in gdb). So the gfx queue never drains, the SuspendPoint behind it is never processed, and the guest
    deadlocks.

This reads like a host-written GPU fence / flip counter that the Linux present path never writes.

Reproduction

  1. Run Dead Cells (PPSA15552) on the Linux build.
  2. Play ~30-60s (intro transformation, sound menu, or early combat).
  3. It freezes. Attach gdb: sudo gdb -p $(pidof kyty_emulator) -batch -ex "set pagination off" -ex "thread apply all bt".

Evidence

Guest thread:

#5  Libs::Graphics::GuestGpu::SuspendPoint (this=...) at src/graphics/guest_gpu/graphicsRun.cpp:175
#6  0x... in Libs::Graphics::Gen5::AgcSuspendPoint () at src/libs/agc.cpp:1555
#7+ <guest addresses>

GuestGpu loop + queue state:

Thread (graphicsRun.cpp:481):
481   gpu->m_work_available.WaitFor(&gpu->m_queue_mutex, 100);
(gdb) p gpu->m_submission_count              -> 3
(gdb) p gpu->m_queues[0].front().type        -> SubmissionType::Graphics
(gdb) p gpu->m_queues[0].front().blocked     -> true
(gdb) p gpu->m_queues[0].front().command_execution.m_suspended -> true
(gdb) p gpu->m_queues[0].front().command_execution.m_made_progress -> false
(gdb) p gpu->m_queues[0][1].type             -> SubmissionType::SuspendPoint

Command buffer at the suspend point:

0x201c03434: 0xc0079300 0x00000113 0x19f399d8 0x00000002
0x201c03444: 0x00000001 0x00000000 0xffffffff 0xffffffff
0x201c03454: 0x00000019 ...
=> header 0xc0079300 : opcode 0x93 (IT_WAIT_REG_MEM_64), ctrl=0x113 (func=3 EQUAL)
   addr = (0x19f399d8 & ~7) | ((0x00000002 & 0x3ffff) << 32) = 0x219f399d8
   ref  = 0x0000000000000001 , mask = 0xffffffffffffffff
(gdb) x/2xg 0x219f399d8  -> 0x0000000000000000   (never becomes 1)

Barycentric note: on RDNA1/RADV, upstream requires VK_KHR_fragment_shader_barycentric at device selection but RADV
does not expose it for gfx10.1, so a fork/local patch is needed to boot. Dead Cells' own shaders may also rely on
custom (non-perspective) interpolation; not sure if related.

**@⁠tyyyyyyyyyyyyyyyy** on GitHub · 2026-10-08 06:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189) ### Game title Dead Cells ### Game ID / serial PPSA15552 (tested both the 01.000 and 01.005 dumps) ### KytyPS5 version `KytyPS5-2026-10-08-5a88080-3-g88213526` (= upstream `5a880808` + a one-line local patch making `VK_KHR_fragment_shader_barycentric` optional, which is required to run at all on RDNA1/RADV). The hang also reproduces on my earlier builds `1f6031e`, `d10eab0`, `f127dc8`. ### OS Ubuntu 24.04.3 LTS, kernel 6.17.0-20-generic. Also reproduced on Batocera 41 (X11). ### GPU + driver AMD Radeon RX 5700 (Navi10 / RDNA1), **RADV**, Mesa 25.2.8 (also 25.3.6), Vulkan 1.4.318. **On Windows the same emulator code runs Dead Cells fine**, so this appears Linux/RADV-specific. ### Description The game hard-hangs (screen frozen, process stays alive, no crash / exception / GPU reset in `dmesg`, no output in the log after the freeze). It triggers a few seconds into gameplay and the exact spot varies with present mode, e.g.: - after the intro when the character transforms, - when opening the in-game **Sound** options menu, - after an R1 action at the "chopping block". `--present-mode Immediate` / `Fifo` and `--vblank-frequency 60` / `75` only change *when* it hangs; they never fix it. The `warning: NGS2 custom module/control ... ignored` lines are benign audio skips and not related. ### Root cause (gdb on a RelWithDebInfo build) At the hang: - The guest thread is blocked in `Libs::Graphics::GuestGpu::SuspendPoint` (`src/graphics/guest_gpu/graphicsRun.cpp:175`) on `m_suspend_point_ready->acquire()`. - The `GuestGpu` command loop (`ThreadRun`, `graphicsRun.cpp:481`) is stuck in the "all queues blocked" branch. - Inspecting the `GuestGpu` instance: `m_submission_count = 3`, `m_queues[0].front().type = Graphics`, `...front().blocked = true`, `...front().command_execution.m_suspended = true`, `...m_made_progress = false`. `m_queues[0][1]` is the `SuspendPoint` submission stuck behind it. - Decoding the suspended command buffer (`offset_dw = 3341`, header `0xc0079300`) gives opcode `0x93` = **`IT_WAIT_REG_MEM_64`** with `func = 3 (EQUAL)`, `ctrl = 0x113`, `addr = 0x219f399d8`, `ref = 1`, `mask = 0xffffffffffffffff` — i.e. the GPU waits for `*(u64*)0x219f399d8 == 1`, but that value stays **0** forever (verified in gdb). So the gfx queue never drains, the `SuspendPoint` behind it is never processed, and the guest deadlocks. This reads like a host-written GPU fence / flip counter that the Linux present path never writes. ### Reproduction 1. Run Dead Cells (PPSA15552) on the Linux build. 2. Play ~30-60s (intro transformation, sound menu, or early combat). 3. It freezes. Attach gdb: `sudo gdb -p $(pidof kyty_emulator) -batch -ex "set pagination off" -ex "thread apply all bt"`. ### Evidence Guest thread: ``` #5 Libs::Graphics::GuestGpu::SuspendPoint (this=...) at src/graphics/guest_gpu/graphicsRun.cpp:175 #6 0x... in Libs::Graphics::Gen5::AgcSuspendPoint () at src/libs/agc.cpp:1555 #7+ <guest addresses> ``` GuestGpu loop + queue state: ``` Thread (graphicsRun.cpp:481): 481 gpu->m_work_available.WaitFor(&gpu->m_queue_mutex, 100); (gdb) p gpu->m_submission_count -> 3 (gdb) p gpu->m_queues[0].front().type -> SubmissionType::Graphics (gdb) p gpu->m_queues[0].front().blocked -> true (gdb) p gpu->m_queues[0].front().command_execution.m_suspended -> true (gdb) p gpu->m_queues[0].front().command_execution.m_made_progress -> false (gdb) p gpu->m_queues[0][1].type -> SubmissionType::SuspendPoint ``` Command buffer at the suspend point: ``` 0x201c03434: 0xc0079300 0x00000113 0x19f399d8 0x00000002 0x201c03444: 0x00000001 0x00000000 0xffffffff 0xffffffff 0x201c03454: 0x00000019 ... => header 0xc0079300 : opcode 0x93 (IT_WAIT_REG_MEM_64), ctrl=0x113 (func=3 EQUAL) addr = (0x19f399d8 & ~7) | ((0x00000002 & 0x3ffff) << 32) = 0x219f399d8 ref = 0x0000000000000001 , mask = 0xffffffffffffffff (gdb) x/2xg 0x219f399d8 -> 0x0000000000000000 (never becomes 1) ``` Barycentric note: on RDNA1/RADV, upstream requires `VK_KHR_fragment_shader_barycentric` at device selection but RADV does not expose it for gfx10.1, so a fork/local patch is needed to boot. Dead Cells' own shaders may also rely on custom (non-perspective) interpolation; not sure if related.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:47:10 +00:00
Author
Owner

@⁠tyyyyyyyyyyyyyyyy on GitHub · 2026-10-08 06:04 UTC · original

Additional finding: the fence value IS written by IT_WRITE_DATA, but never takes effect

Dumping the same stuck Graphics command buffer around the suspend point (base 0x201c00000, offset_dw=3341,
header 0xc0079300 = IT_WAIT_REG_MEM_64 waiting *(u64*)0x219f399d8 == 1) shows that just before the wait
there is an IT_WRITE_DATA (opcode 0x37) that targets the exact same address with value 1:

0x201c0331c: 0xc0043700            # IT_WRITE_DATA, dw_num=4
0x201c03320: 0x00100200            # write_control (dst_sel=4, write_one_address=0)
0x201c03324: 0x19f399d8            # dst lo
0x201c03328: 0x00000002            # dst hi
0x201c0332c: 0x00000001            # data[0] = 1
0x201c03330: 0x00000000            # data[1] = 0  -> 64-bit value 1
...
0x201c03434: 0xc0079300 0x00000113 0x19f399d8 0x00000002  # IT_WAIT_REG_MEM_64, func=3 EQUAL, ref=1

So dst = 0x19f399d8 | (0x2 << 32) = 0x219f399d8 and data = 1. CommandProcessor::WriteData should do
memcpy(dst, src, 2*4) = write 1 (low) / 0 (high). Yet at the moment of the wait,
x/2xg 0x219f399d8 returns 0x0000000000000000.

So the IT_WRITE_DATA does not take effect (or is later undone / goes to a different mapping), and then the
WAIT_REG_MEM_64 spins forever, blocking the gfx queue and the SuspendPoint behind it.

Things worth checking on the Linux/RADV path:

  • CommandProcessor::WriteData (graphicsRun.cpp) — is dst a raw pointer, or should the GPU VA be translated
    through the page manager? WaitRegMem reads the same raw pointer, so if one path translates and the other does
    not, the write and the wait would disagree.
  • Whether the write is subject to predication skip (m_predicate_skip) at that point.
  • Memory aliasing / region mapping on Linux (write to a backing copy that the CPU-side read doesn't observe).

(Build: upstream 5a880808 + barycentric-optional patch. Reproduced identically on 1f6031e..f127dc8. Ubuntu
24.04, RADV, RX 5700. On Windows it does not hang.)

**@⁠tyyyyyyyyyyyyyyyy** on GitHub · 2026-10-08 06:04 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189#issuecomment-6053501868) ## Additional finding: the fence value IS written by `IT_WRITE_DATA`, but never takes effect Dumping the same stuck Graphics command buffer around the suspend point (base `0x201c00000`, `offset_dw=3341`, header `0xc0079300` = `IT_WAIT_REG_MEM_64` waiting `*(u64*)0x219f399d8 == 1`) shows that **just before the wait** there is an `IT_WRITE_DATA` (opcode `0x37`) that targets the exact same address with value 1: ``` 0x201c0331c: 0xc0043700 # IT_WRITE_DATA, dw_num=4 0x201c03320: 0x00100200 # write_control (dst_sel=4, write_one_address=0) 0x201c03324: 0x19f399d8 # dst lo 0x201c03328: 0x00000002 # dst hi 0x201c0332c: 0x00000001 # data[0] = 1 0x201c03330: 0x00000000 # data[1] = 0 -> 64-bit value 1 ... 0x201c03434: 0xc0079300 0x00000113 0x19f399d8 0x00000002 # IT_WAIT_REG_MEM_64, func=3 EQUAL, ref=1 ``` So `dst = 0x19f399d8 | (0x2 << 32) = 0x219f399d8` and `data = 1`. `CommandProcessor::WriteData` should do `memcpy(dst, src, 2*4)` = write `1` (low) / `0` (high). Yet at the moment of the wait, `x/2xg 0x219f399d8` returns `0x0000000000000000`. So the `IT_WRITE_DATA` does **not** take effect (or is later undone / goes to a different mapping), and then the `WAIT_REG_MEM_64` spins forever, blocking the gfx queue and the `SuspendPoint` behind it. Things worth checking on the Linux/RADV path: - `CommandProcessor::WriteData` (`graphicsRun.cpp`) — is `dst` a raw pointer, or should the GPU VA be translated through the page manager? `WaitRegMem` reads the same raw pointer, so if one path translates and the other does not, the write and the wait would disagree. - Whether the write is subject to predication skip (`m_predicate_skip`) at that point. - Memory aliasing / region mapping on Linux (write to a backing copy that the CPU-side read doesn't observe). (Build: upstream `5a880808` + barycentric-optional patch. Reproduced identically on `1f6031e`..`f127dc8`. Ubuntu 24.04, RADV, RX 5700. On Windows it does not hang.)
Author
Owner

@⁠tyyyyyyyyyyyyyyyy on GitHub · 2026-10-08 06:06 UTC · original

Decisive experiment: forcing the fence value in gdb unblocks the queue

While hung, I set the awaited value directly from gdb:

(gdb) set {unsigned long long}0x219f399d8 = 1

The front Graphics submission then completed and the gfx queue advanced to the next (also Graphics) submission
(buffer 0x202400040, offset_dw=1810) which is again dormant on the same kind of wait — so the fence value really
is the gate, and the guest's own preceding IT_WRITE_DATA is what fails to set it.

Note the value reverted to 0 afterwards (something writes 0 back / the next iteration), and the buffer repeats the
IT_WRITE_DATA(1 -> 0x219f399d8) / IT_WAIT_REG_MEM_64(0x219f399d8 == 1) pair many times (same buffer layout at
0x202401c60..):

0x202401c60: 0xc0043700 0x00100200 0x19f399d8 0x00000002
0x202401c70: 0x00000001 0x00000000 0xc0027904 0x00000342
0x202401c80: 0xc8020002 0x19f399d8 0xc0079300 0x00000113
0x202401c90: 0x19f399d8 0x00000002 0x00000001 0x00000000
0x202401ca0: 0xffffffff 0xffffffff ...

So the emulator writes the fence (IT_WRITE_DATA) and immediately waits for it (IT_WAIT_REG_MEM) in the same command
stream, yet the wait sees 0 — meaning CommandProcessor::WriteData to this guest address does not become visible
to the command processor's WaitRegMem read
on the Linux/RADV path. Prime suspects: GPU-VA→host translation
differences between the write and the read, memory aliasing / region remapping, or the write going to a staging
copy. On Windows the same command stream works.

Happy to run any additional gdb/experiments you suggest (watchpoints, breakpoints on WriteData/WaitRegMem, etc.).

**@⁠tyyyyyyyyyyyyyyyy** on GitHub · 2026-10-08 06:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189#issuecomment-6053526481) ## Decisive experiment: forcing the fence value in gdb unblocks the queue While hung, I set the awaited value directly from gdb: ``` (gdb) set {unsigned long long}0x219f399d8 = 1 ``` The front `Graphics` submission then completed and the gfx queue advanced to the next (also `Graphics`) submission (buffer `0x202400040`, `offset_dw=1810`) which is again dormant on the same kind of wait — so the fence value really is the gate, and the guest's own preceding `IT_WRITE_DATA` is what fails to set it. Note the value reverted to `0` afterwards (something writes 0 back / the next iteration), and the buffer repeats the `IT_WRITE_DATA(1 -> 0x219f399d8)` / `IT_WAIT_REG_MEM_64(0x219f399d8 == 1)` pair many times (same buffer layout at `0x202401c60`..): ``` 0x202401c60: 0xc0043700 0x00100200 0x19f399d8 0x00000002 0x202401c70: 0x00000001 0x00000000 0xc0027904 0x00000342 0x202401c80: 0xc8020002 0x19f399d8 0xc0079300 0x00000113 0x202401c90: 0x19f399d8 0x00000002 0x00000001 0x00000000 0x202401ca0: 0xffffffff 0xffffffff ... ``` So the emulator writes the fence (IT_WRITE_DATA) and immediately waits for it (IT_WAIT_REG_MEM) in the same command stream, yet the wait sees 0 — meaning **`CommandProcessor::WriteData` to this guest address does not become visible to the command processor's `WaitRegMem` read** on the Linux/RADV path. Prime suspects: GPU-VA→host translation differences between the write and the read, memory aliasing / region remapping, or the write going to a staging copy. On Windows the same command stream works. Happy to run any additional gdb/experiments you suggest (watchpoints, breakpoints on `WriteData`/`WaitRegMem`, etc.).
Author
Owner

@⁠tyyyyyyyyyyyyyyyy on GitHub · 2026-10-08 06:14 UTC · original

Definitive: WriteData IS called with the fence value, yet the wait still sees 0

Ran Dead Cells under gdb with a breakpoint on Libs::Graphics::CommandProcessor::WriteData (letting SIGSEGV/SIGBUS
pass through so the demand-paging handler works normally). The breakpoint fired thousands of times, including
exactly:

WD dst=0x219f399d8 dw=2 v0=00000001 v1=00000000
WD dst=0x219f399d8 dw=2 v0=00000001 v1=00000000
...

So WriteData(dst=0x219f399d8, src={1,0}, dw_num=2) is executed — the game does write the 64-bit value 1 to the
fence address. The stream then reaches IT_WAIT_REG_MEM_64 (*(u64*)0x219f399d8 == 1) and hangs, and reading that
same address from a second gdb attach gives 0. (The write count stops growing the moment it hangs, and the last
writes are the = 1 ones — nothing resets it afterwards.)

So on Linux/RADV the write to guest GPU address 0x219f399d8 is not visible to the command processor's own read
of the same address — i.e. a guest-memory mapping/aliasing (or demand-paging handler) issue, not a missing command.
On Windows the same stream works. The demand-paging path (common/hostException.cpp → g_handler, "retry the faulting
instruction against the fixed mapping") is a prime suspect (e.g. the fix-up mapping a fresh/other generation of the
page so the write is lost).

Anyone reproducing: run with handle SIGSEGV nostop noprint pass under gdb and log WriteData to see this. Happy to
run more experiments.

**@⁠tyyyyyyyyyyyyyyyy** on GitHub · 2026-10-08 06:14 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189#issuecomment-6053647901) ## Definitive: `WriteData` IS called with the fence value, yet the wait still sees 0 Ran Dead Cells under gdb with a breakpoint on `Libs::Graphics::CommandProcessor::WriteData` (letting SIGSEGV/SIGBUS pass through so the demand-paging handler works normally). The breakpoint fired **thousands of times**, including exactly: ``` WD dst=0x219f399d8 dw=2 v0=00000001 v1=00000000 WD dst=0x219f399d8 dw=2 v0=00000001 v1=00000000 ... ``` So `WriteData(dst=0x219f399d8, src={1,0}, dw_num=2)` **is executed** — the game does write the 64-bit value `1` to the fence address. The stream then reaches `IT_WAIT_REG_MEM_64 (*(u64*)0x219f399d8 == 1)` and **hangs**, and reading that same address from a second gdb attach gives **0**. (The write count stops growing the moment it hangs, and the last writes are the `= 1` ones — nothing resets it afterwards.) So on Linux/RADV the write to guest GPU address `0x219f399d8` is **not visible** to the command processor's own read of the same address — i.e. a guest-memory mapping/aliasing (or demand-paging handler) issue, not a missing command. On Windows the same stream works. The demand-paging path (`common/hostException.cpp` → `g_handler`, "retry the faulting instruction against the fixed mapping") is a prime suspect (e.g. the fix-up mapping a fresh/other generation of the page so the write is lost). Anyone reproducing: run with `handle SIGSEGV nostop noprint pass` under gdb and log `WriteData` to see this. Happy to run more experiments.
Author
Owner

@⁠tyyyyyyyyyyyyyyyy on GitHub · 2026-10-08 06:15 UTC · original

Where the write appears to be lost

Guest GPU page faults go through Loader::KytyExceptionHandler (runtimeLinker.cpp:659) →
Libs::LibKernel::Memory::HandleGpuFault (kernel/memory.cpp:934) → RenderContext::HandleFault
(graphics/host_gpu/renderer/renderContext.cpp:57):

bool RenderContext::HandleFault(PageFaultAccess access, uint64_t fault_vaddr) noexcept {
    constexpr uint64_t fault_size = 1;
    if (!IsMapped(fault_vaddr, fault_size)) return false;
    if (access == PageFaultAccess::Write) {
        m_buffer_cache.InvalidateMemory(fault_vaddr, fault_size);
        m_texture_cache.InvalidateMemory(fault_vaddr, fault_size);
    } else {
        m_buffer_cache.ReadMemory(fault_vaddr, fault_size);
    }
    return true;   // retry the faulting instruction
}

So the guest address space is identity-mapped and a write to a mapped page is retried after cache invalidation. In our
case WriteData does run (dst=0x219f399d8, value=1), and the wait reads the same numeric address — so on a
consistent mapping the wait should pass. It does not (reads 0), which points at a coherence/aliasing problem between
what the command processor writes and what its own WaitRegMem reads
(buffer/texture cache invalidation or a
remapping of the same guest VA). Worth instrumenting HandleFault / BufferCache::InvalidateMemory /
m_mapped_ranges for 0x219f399d8 on Linux.

This is as far as I can get from the outside; it needs knowledge of the guest-memory/cache architecture. All
experiments + logs are in this thread; happy to run more (breakpoints on the above, etc.).

**@⁠tyyyyyyyyyyyyyyyy** on GitHub · 2026-10-08 06:15 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189#issuecomment-6053658527) ## Where the write appears to be lost Guest GPU page faults go through `Loader::KytyExceptionHandler` (`runtimeLinker.cpp:659`) → `Libs::LibKernel::Memory::HandleGpuFault` (`kernel/memory.cpp:934`) → `RenderContext::HandleFault` (`graphics/host_gpu/renderer/renderContext.cpp:57`): ```cpp bool RenderContext::HandleFault(PageFaultAccess access, uint64_t fault_vaddr) noexcept { constexpr uint64_t fault_size = 1; if (!IsMapped(fault_vaddr, fault_size)) return false; if (access == PageFaultAccess::Write) { m_buffer_cache.InvalidateMemory(fault_vaddr, fault_size); m_texture_cache.InvalidateMemory(fault_vaddr, fault_size); } else { m_buffer_cache.ReadMemory(fault_vaddr, fault_size); } return true; // retry the faulting instruction } ``` So the guest address space is identity-mapped and a write to a mapped page is retried after cache invalidation. In our case `WriteData` **does** run (`dst=0x219f399d8, value=1`), and the wait reads the same numeric address — so on a consistent mapping the wait should pass. It does not (reads 0), which points at a **coherence/aliasing problem between what the command processor writes and what its own `WaitRegMem` reads** (buffer/texture cache invalidation or a remapping of the same guest VA). Worth instrumenting `HandleFault` / `BufferCache::InvalidateMemory` / `m_mapped_ranges` for `0x219f399d8` on Linux. This is as far as I can get from the outside; it needs knowledge of the guest-memory/cache architecture. All experiments + logs are in this thread; happy to run more (breakpoints on the above, etc.).
Author
Owner

@⁠tyyyyyyyyyyyyyyyy on GitHub · 2026-10-08 06:20 UTC · original

Found the mechanism: guest CPU and emulated GPU race on the same fence word

Hardware watchpoint on *(u64*)0x219f399d8 (with SIGSEGV passed through) shows the value flipping 1 ↔ 0:

WATCH#1 val=1   <- CommandProcessor::WriteData  (from CpOpWriteData, the GPU command "write 1")
WATCH#2 val=0   <- guest JIT code (pc 0x00000009016592a9)
WATCH#3 val=1   <- CommandProcessor::WriteData
WATCH#4 val=0   <- guest JIT code
...

So the emulated GPU writes 1 (the fence) and the guest CPU writes 0 to the same address, interleaved. The guest's GPU command stream does IT_WRITE_DATA(1 -> 0x219f399d8) then IT_WAIT_REG_MEM_64(0x219f399d8 == 1), but by the time the wait runs, the guest CPU has already stored 0 again, so the wait never satisfies, the gfx queue stalls, and SuspendPoint deadlocks.

This is a CPU/GPU ordering (race) difference: on Windows the same title works, on Linux/RADV the emulated GPU command is applied too late relative to the guest CPU's next store (or the wait is evaluated when the CPU has already reset it). The RenderContext::HandleFault path was not even hit for this address, so it is not a demand-paging issue but ordering/timing.

Note the store is normal guest code (a plain store to the fence), so the fix likely lives in how/when Kyty runs guest GPU submissions relative to guest CPU threads (ordering / synchronization of submitted command buffers vs CPU writes), not in a single handler. Worth a closer look at GuestGpu submission timing and whether a submitted buffer's writes should be visible before the guest can proceed.

Happy to instrument further on request (e.g. log guest pc/symbol of the 0-store, or trace the submission/wait ordering).

**@⁠tyyyyyyyyyyyyyyyy** on GitHub · 2026-10-08 06:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189#issuecomment-6053736336) ## Found the mechanism: guest CPU and emulated GPU race on the same fence word Hardware watchpoint on `*(u64*)0x219f399d8` (with SIGSEGV passed through) shows the value flipping **1 ↔ 0**: ``` WATCH#1 val=1 <- CommandProcessor::WriteData (from CpOpWriteData, the GPU command "write 1") WATCH#2 val=0 <- guest JIT code (pc 0x00000009016592a9) WATCH#3 val=1 <- CommandProcessor::WriteData WATCH#4 val=0 <- guest JIT code ... ``` So the **emulated GPU writes `1`** (the fence) and the **guest CPU writes `0`** to the *same address*, interleaved. The guest's GPU command stream does `IT_WRITE_DATA(1 -> 0x219f399d8)` then `IT_WAIT_REG_MEM_64(0x219f399d8 == 1)`, but by the time the wait runs, the guest CPU has already stored `0` again, so the wait never satisfies, the gfx queue stalls, and `SuspendPoint` deadlocks. This is a **CPU/GPU ordering (race) difference**: on Windows the same title works, on Linux/RADV the emulated GPU command is applied too late relative to the guest CPU's next store (or the wait is evaluated when the CPU has already reset it). The `RenderContext::HandleFault` path was not even hit for this address, so it is not a demand-paging issue but ordering/timing. Note the store is normal guest code (a plain store to the fence), so the fix likely lives in how/when Kyty runs guest GPU submissions relative to guest CPU threads (ordering / synchronization of submitted command buffers vs CPU writes), not in a single handler. Worth a closer look at `GuestGpu` submission timing and whether a submitted buffer's writes should be visible before the guest can proceed. Happy to instrument further on request (e.g. log guest pc/symbol of the 0-store, or trace the submission/wait ordering).
Author
Owner

@⁠Nmzik on GitHub · 2026-10-18 16:45 UTC · original

Duplicate of #1493.

Consolidating compatibility evidence for PPSA15552 in the newer report #1493. This older report has no posted screenshots or video in its body or comments. Its logs and discussion remain available here; this closure consolidates reports and does not mark the reported behavior as fixed.

**@⁠Nmzik** on GitHub · 2026-10-18 16:45 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1189#issuecomment-6252475718) Duplicate of #1493. Consolidating compatibility evidence for PPSA15552 in the newer report #1493. This older report has no posted screenshots or video in its body or comments. Its logs and discussion remain available here; this closure consolidates reports and does not mark the reported behavior as fixed.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/KytyPS5--KytyPS5#1189
No description provided.