Wine: the world stops ~3 min in while Wine reports RtlReleaseSRWLockExclusive on a lock that is not held (x231, three threads) #774

Open
opened 2026-11-26 04:13:57 +00:00 by github-bot · 8 comments
Owner

@⁠MrCloudy2 on GitHub · 2026-11-24 10:14 UTC · original

An observation from Linux/Wine. I'm filing it because I found no issue or PR that mentions it. It is one run so far, and I have not shown that the lock is what stops the title, so read it as a lead.

Setup

  • RTX 3060 12 GB, driver 620.73.04, CachyOS (kernel 7.3), 31 GB RAM.
  • Proton-CachyOS 11.0 wine run directly (not through the Proton script) with WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core,d3d9=n". vkd3d-proton 3.2.0 (from Proton Experimental), DXVK dxgi.
  • Diag build of main 8e79c80 + #151 #190 #454 #493 #579 + #177's key fix, cross-compiled with xwin. Own 1.0.2.1 copy.
  • VICTORY_NO_WATCHDOG=1, VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains, network off.
  • WINEDEBUG=err+vulkan,err+seh. The default err channel would show the same lines; they were hidden in my earlier runs only because I ran with -all.

What happened

  • Menus, loading, world: the menus run at 27–30 fps. The world load opens the story000* archives. World audio plays, and the screen stays mostly black, as expected on this host.
  • ~3 min into the world: from that point Wine logs, 231 times and from three different threads (01ec, 0224, 021c), on one lock address:
    01ec:err:sync:RtlReleaseSRWLockExclusive Lock 000000002CEF84A0 is not owned exclusive!
    
    The first one comes right after a batch of shader does not translate warnings and vkd3d-proton's "application has stopped creating new PSOs" disk-cache flush.
  • Afterwards: the frame-progress lines stop. The last was frame 1024, about 2 minutes before the first lock message, and no frame 2048 followed. The audio stops a little later. The process stays alive with no exception, no crashes.log entry, and no device removal, until killed.

Why it may matter

Wine checks this case and Windows does not. ReleaseSRWLockExclusive on a lock that is free or held shared silently corrupts the lock state on Windows, while Wine prints the error. VIctory has no SRW-lock code of its own (grep -ri srwlock crates finds nothing), so the caller is the title through its kernel32 imports, or vkd3d-proton, DXVK or the driver underneath. A lock released by someone who doesn't hold it, by three threads, could be what deadlocks the title's threads here. The world hangs reported on Windows (#71, #325, #619, #625) end with the host GPU hung. This one ends with no GPU error.

Not done yet

  • Naming the caller: a +relay/backtrace on RtlReleaseSRWLockExclusive, or VICTORY_STACKS at the moment of the first message.
  • A second run to see whether it repeats (running now; I'll add the result here).
  • A run on Windows for comparison (I have no Windows machine).

AI-assisted (Claude Code); run and observed on the machine above.

**@⁠MrCloudy2** on GitHub · 2026-11-24 10:14 UTC · [original](https://github.com/Marvisak/VIctory/issues/774) An observation from Linux/Wine. I'm filing it because I found no issue or PR that mentions it. It is one run so far, and **I have not shown that the lock is what stops the title**, so read it as a lead. ### Setup * RTX 3060 12 GB, driver 620.73.04, CachyOS (kernel 7.3), 31 GB RAM. * Proton-CachyOS 11.0 wine run directly (not through the Proton script) with `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core,d3d9=n"`. vkd3d-proton 3.2.0 (from Proton Experimental), DXVK dxgi. * Diag build of `main` `8e79c80` + #151 #190 #454 #493 #579 + #177's key fix, cross-compiled with xwin. Own 1.0.2.1 copy. * `VICTORY_NO_WATCHDOG=1`, `VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains`, network off. * `WINEDEBUG=err+vulkan,err+seh`. The default `err` channel would show the same lines; they were hidden in my earlier runs only because I ran with `-all`. ### What happened * **Menus, loading, world:** the menus run at 27–30 fps. The world load opens the `story000*` archives. World audio plays, and the screen stays mostly black, as expected on this host. * **~3 min into the world:** from that point Wine logs, 231 times and from three different threads (`01ec`, `0224`, `021c`), on **one** lock address: ``` 01ec:err:sync:RtlReleaseSRWLockExclusive Lock 000000002CEF84A0 is not owned exclusive! ``` The first one comes right after a batch of `shader does not translate` warnings and vkd3d-proton's "application has stopped creating new PSOs" disk-cache flush. * **Afterwards:** the frame-progress lines stop. The last was frame 1024, about 2 minutes before the first lock message, and no frame 2048 followed. The audio stops a little later. The process stays alive with no exception, no `crashes.log` entry, and no device removal, until killed. ### Why it may matter Wine checks this case and Windows does not. `ReleaseSRWLockExclusive` on a lock that is free or held shared silently corrupts the lock state on Windows, while Wine prints the error. VIctory has no SRW-lock code of its own (`grep -ri srwlock crates` finds nothing), so the caller is the title through its kernel32 imports, or vkd3d-proton, DXVK or the driver underneath. A lock released by someone who doesn't hold it, by three threads, could be what deadlocks the title's threads here. The world hangs reported on Windows (#71, #325, #619, #625) end with the host GPU hung. This one ends with no GPU error. ### Not done yet * Naming the caller: a `+relay`/backtrace on `RtlReleaseSRWLockExclusive`, or `VICTORY_STACKS` at the moment of the first message. * A second run to see whether it repeats (running now; I'll add the result here). * A run on Windows for comparison (I have no Windows machine). AI-assisted (Claude Code); run and observed on the machine above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:57 +00:00
Author
Owner

@⁠MrCloudy2 on GitHub · 2026-11-24 10:21 UTC · original

Second run, same machine and logging (WINEDEBUG=err+vulkan,err+seh,err+sync). The build differs: it also has the wave64 stack (#223 → #233 → #320 → #439).

  • No RtlReleaseSRWLockExclusive ... not owned exclusive messages this time (0, against 231 in the first run).
  • The title still slowed to a near stop in the world. Frame 1024 was presented ~25 s after the world archives opened. No frame 2048 followed in the next ~6 min before I ended the run. Audio dropped during a frame-rate dip in the load, came back on the dark scene, and the process stayed alive.

So the lock messages are not required for this stall. The stall looks like the very low world frame rate others report (e.g. 0.2–1 fps in #752) rather than a deadlock. The lock misuse is still real in the first run, but I can't tie it to the stall. I'll leave this open as a Wine-specific observation in case someone sees the messages again; close it if that's not useful.

**@⁠MrCloudy2** on GitHub · 2026-11-24 10:21 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7128663982) Second run, same machine and logging (`WINEDEBUG=err+vulkan,err+seh,err+sync`). The build differs: it also has the wave64 stack (#223 → #233 → #320 → #439). * **No** `RtlReleaseSRWLockExclusive ... not owned exclusive` messages this time (0, against 231 in the first run). * The title still slowed to a near stop in the world. Frame 1024 was presented ~25 s after the world archives opened. No frame 2048 followed in the next ~6 min before I ended the run. Audio dropped during a frame-rate dip in the load, came back on the dark scene, and the process stayed alive. So the lock messages are **not** required for this stall. The stall looks like the very low world frame rate others report (e.g. 0.2–1 fps in #752) rather than a deadlock. The lock misuse is still real in the first run, but I can't tie it to the stall. I'll leave this open as a Wine-specific observation in case someone sees the messages again; close it if that's not useful.
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 11:27 UTC · original

Another data point, on RDNA4 + Wine 11.22, so it is not specific to your NVIDIA/CachyOS run and not fixed by vkd3d 3.2:

  • GPU/OS: AMD RX 9060 XT (RDNA4, RADV 26.3.1), Arch Linux, kernel 6.18.x.
  • Build: VIctory main ffe310e, release MSVC build (cargo xwin), package 1.0.2.1, build unknown (b99f876b…b5c35a79d5decd9f716504239e93).
  • Stack: Wine 11.22 (system), DXVK 3.1.1 dxgi, vkd3d-proton 3.2.0 (Proton Experimental DLLs), WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n", VICTORY_KEYS=….
  • Run: menus 30 fps, intro 11–15 fps, loading, world at 0.2–0.4 fps with the dark frozen background.

Observed: 211 err:sync:RtlReleaseSRWLockExclusive Lock 0000001ECE4B84A0 is not owned exclusive! lines starting ~3 minutes into the world (another run used lock 00000061744B84A0), from four threads (01dc, 01d8, 01e0, 01e8), right after a batch of shader does not translate warnings.

Two outcomes in different runs:

  1. frames kept presenting at 0.2–0.4 fps for ~2 more minutes, then host GPU device removed … 0x887A0005 after a 7-list submission (the #714 signature);
  2. another run was still presenting when I killed it; no crashes.log entry in either.

So the lock warning does not by itself stop our frame-progress lines, but the run that ended in device removal had it. The caller remains unnamed — I did not run +relay or a stacks build.

Not tested: +relay/VICTORY_STACKS around the first message, a Windows comparison, and the #454/#493/#579 stack.

**@⁠DaviTostes** on GitHub · 2026-11-24 11:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7130124980) Another data point, on RDNA4 + Wine 11.22, so it is not specific to your NVIDIA/CachyOS run and not fixed by vkd3d 3.2: - **GPU/OS:** AMD RX 9060 XT (RDNA4, RADV 26.3.1), Arch Linux, kernel 6.18.x. - **Build:** VIctory `main` `ffe310e`, release MSVC build (`cargo xwin`), package 1.0.2.1, `build unknown (b99f876b…b5c35a79d5decd9f716504239e93)`. - **Stack:** Wine 11.22 (system), DXVK 3.1.1 `dxgi`, vkd3d-proton **3.2.0** (Proton Experimental DLLs), `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n"`, `VICTORY_KEYS=…`. - **Run:** menus 30 fps, intro 11–15 fps, loading, world at 0.2–0.4 fps with the dark frozen background. **Observed:** 211 `err:sync:RtlReleaseSRWLockExclusive Lock 0000001ECE4B84A0 is not owned exclusive!` lines starting ~3 minutes into the world (another run used lock `00000061744B84A0`), from four threads (`01dc`, `01d8`, `01e0`, `01e8`), right after a batch of `shader does not translate` warnings. Two outcomes in different runs: 1. frames kept presenting at 0.2–0.4 fps for ~2 more minutes, then `host GPU device removed … 0x887A0005` after a **7-list** submission (the #714 signature); 2. another run was still presenting when I killed it; no `crashes.log` entry in either. So the lock warning does not by itself stop our frame-progress lines, but the run that ended in device removal had it. The caller remains unnamed — I did not run `+relay` or a stacks build. **Not tested:** `+relay`/`VICTORY_STACKS` around the first message, a Windows comparison, and the #454/#493/#579 stack.
Author
Owner

@⁠Mumogg on GitHub · 2026-11-24 15:08 UTC · original

Two findings for this issue, from an RTX 5070 Ti under Wine: who releases the lock, and what the process is doing when the frames stop. They turn out to be separate things.

Setup: RTX 5070 Ti, driver 615.78.08, Nobara 44, Wine 11.21 Staging, vkd3d-proton and DXVK dxgi.dll from GE-Proton11-14. Diag build of ffe310e + #454 #177 #259 #233 #646 #578 + #334 #493 #724 #725 + the #783 fallback + #909. VICTORY_NO_WATCHDOG=1, VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains.

1. The lock is vkd3d-proton's, and it is released twice by one function

WINEDEBUG=+relay with RelayInclude set to the ntdll.Rtl*SRWLock* entry points gives the return address of every call. Kept only for the lock named in the error (it ends in …F84B0 here in every run), one run into the world:

Call on that lock Return address Count
RtlAcquireSRWLockExclusive d3d12core.dll+0x4a3bc8 1,545
RtlReleaseSRWLockExclusive d3d12core.dll+0x4a3cf4 1,547
RtlReleaseSRWLockExclusive d3d12core.dll+0x4a3c55 1,292
err:sync:RtlReleaseSRWLockExclusive … is not owned exclusive! 1,295

Every error follows the same three calls on one thread: acquire at +0x4a3bc8, release at +0x4a3c55, release at +0x4a3cf4. The title is not involved (no call on that lock comes from the title's image), and neither is VIctory.

The strings next to that code name the function: vkd3d_try_allocate_device_memory (libs/vkd3d/memory.c), and the lock is memory_info->budget_lock. The path is still in upstream master as I read it today: inside the candidate loop, when the fixed ReBAR budget would be exceeded the lock is released and the loop continues (a failed vkAllocateMemory releases it too); if that was the last candidate, the loop ends with rebar_budget still true, and the block after the loop skips its own pthread_mutex_lock (it assumes the lock is still held when rebar_budget && respect_budget) and calls pthread_mutex_unlock again. So each allocation refused for the ReBAR budget releases the lock twice. Wine reports it; on Windows the second release goes unreported.

That makes the message a symptom of those refused allocations rather than of a title lock. Its start "right after a batch of shader warnings" fits a point where the host starts allocating a lot. I have not reported it to vkd3d-proton.

2. When the frames stop, one title thread is spinning and nothing is inside VIctory

The stop is intermittent here: about half of the 6 to 8 min runs, 3 to 5 min after launch, with no Xid in the kernel log and no device removal. With VICTORY_STACKS every 40 s, one run that stopped at 231 s has four dumps taken after the stop:

  • No thread is in victory_gpu or any other VIctory code except idle waits (DirectStorage workers, pipeline workers, the decoder).
  • Of the 60 unnamed threads (55 with title frames), 59 are stopped inside ntdll system calls (waits), the same in both dumps.
  • One title worker thread is running, at the same place in two dumps 40 s apart: title+0x50eb81f, called from +0x31962 < +0x317fd < +0x25d801b < the job loop at +0x221c29c. Before the stop that thread was idle in the job loop like the others.

From its code that place is a lookup in an open-addressing table that compares a group of tags and, on no match, steps to the next group with no test for an empty slot, so it never ends for a key that is not in the table. I have not found which key or table it is, or why the key is missing; a registration that did not happen (a load that failed or came late) would do it. Nothing here shows the lock of point 1 is related: the double release happens over a thousand times in runs that do not stop as well.

So on this machine the "world stops, process stays alive" case is the title waiting on a worker that will not return, not a host lock.

Not tested: Windows, AMD, whether the same thread and place show in other people's stops (a VICTORY_STACKS dump after the stop would tell), more than one stopped run with dumps.

AI-assisted (Claude Code): it set up the relay trace, symbolized and compared the dumps and wrote this comment. No game data attached.

**@⁠Mumogg** on GitHub · 2026-11-24 15:08 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7135530008) Two findings for this issue, from an RTX 5070 Ti under Wine: who releases the lock, and what the process is doing when the frames stop. They turn out to be separate things. **Setup:** RTX 5070 Ti, driver 615.78.08, Nobara 44, Wine 11.21 Staging, vkd3d-proton and DXVK `dxgi.dll` from GE-Proton11-14. Diag build of `ffe310e` + #454 #177 #259 #233 #646 #578 + #334 #493 #724 #725 + the #783 fallback + #909. `VICTORY_NO_WATCHDOG=1`, `VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains`. ### 1. The lock is vkd3d-proton's, and it is released twice by one function `WINEDEBUG=+relay` with `RelayInclude` set to the `ntdll.Rtl*SRWLock*` entry points gives the return address of every call. Kept only for the lock named in the error (it ends in `…F84B0` here in every run), one run into the world: | Call on that lock | Return address | Count | |---|---|---| | `RtlAcquireSRWLockExclusive` | `d3d12core.dll+0x4a3bc8` | 1,545 | | `RtlReleaseSRWLockExclusive` | `d3d12core.dll+0x4a3cf4` | 1,547 | | `RtlReleaseSRWLockExclusive` | `d3d12core.dll+0x4a3c55` | 1,292 | | `err:sync:RtlReleaseSRWLockExclusive … is not owned exclusive!` | | 1,295 | Every error follows the same three calls on one thread: acquire at `+0x4a3bc8`, release at `+0x4a3c55`, release at `+0x4a3cf4`. The title is not involved (no call on that lock comes from the title's image), and neither is VIctory. The strings next to that code name the function: `vkd3d_try_allocate_device_memory` (`libs/vkd3d/memory.c`), and the lock is `memory_info->budget_lock`. The path is still in upstream `master` as I read it today: inside the candidate loop, when the fixed ReBAR budget would be exceeded the lock is released and the loop `continue`s (a failed `vkAllocateMemory` releases it too); if that was the last candidate, the loop ends with `rebar_budget` still true, and the block after the loop skips its own `pthread_mutex_lock` (it assumes the lock is still held when `rebar_budget && respect_budget`) and calls `pthread_mutex_unlock` again. So each allocation refused for the ReBAR budget releases the lock twice. Wine reports it; on Windows the second release goes unreported. That makes the message a symptom of those refused allocations rather than of a title lock. Its start "right after a batch of shader warnings" fits a point where the host starts allocating a lot. I have not reported it to vkd3d-proton. ### 2. When the frames stop, one title thread is spinning and nothing is inside VIctory The stop is intermittent here: about half of the 6 to 8 min runs, 3 to 5 min after launch, with no Xid in the kernel log and no device removal. With `VICTORY_STACKS` every 40 s, one run that stopped at 231 s has four dumps taken after the stop: - No thread is in `victory_gpu` or any other VIctory code except idle waits (DirectStorage workers, pipeline workers, the decoder). - Of the 60 unnamed threads (55 with title frames), 59 are stopped inside `ntdll` system calls (waits), the same in both dumps. - **One title worker thread is running, at the same place in two dumps 40 s apart:** `title+0x50eb81f`, called from `+0x31962` < `+0x317fd` < `+0x25d801b` < the job loop at `+0x221c29c`. Before the stop that thread was idle in the job loop like the others. From its code that place is a lookup in an open-addressing table that compares a group of tags and, on no match, steps to the next group with no test for an empty slot, so it never ends for a key that is not in the table. I have not found which key or table it is, or why the key is missing; a registration that did not happen (a load that failed or came late) would do it. Nothing here shows the lock of point 1 is related: the double release happens over a thousand times in runs that do not stop as well. So on this machine the "world stops, process stays alive" case is the title waiting on a worker that will not return, not a host lock. **Not tested:** Windows, AMD, whether the same thread and place show in other people's stops (a `VICTORY_STACKS` dump after the stop would tell), more than one stopped run with dumps. AI-assisted (Claude Code): it set up the relay trace, symbolized and compared the dumps and wrote this comment. No game data attached.
Author
Owner

@⁠crashbashash on GitHub · 2026-11-24 13:37 UTC · original · edited 2026-11-24 15:13 UTC

A data point the other way round from your second run: the lock messages without the stop.

Setup: CachyOS (kernel 7.3.4), RX 6800 XT (RDNA2, RADV, Mesa 26.2.6), GE-Proton11-14 (vkd3d-proton cae8353ed) run with proton runinprefix, #844 at b7cc788, diagnostics build via cargo-xwin, 1.0.2.1, watchdog not disabled.

  • The first RtlReleaseSRWLockExclusive Lock … is not owned exclusive! came ~2 min 18 s into the world, close to your first run's ~3 min: 200 in total, from two threads, all on one lock address.
  • Frames slowed to 5–8 s for about a minute around it, then went back to about 2 s. Frame-rate lines and audio carried on, and the world ran for 8 more minutes after the first message.

With your second run (the stop without the messages), that suggests the messages and the stop are independent.

My run did end about 8 minutes later, but not with your stop: several worker threads hit a title assert (int3 at +0x5149aec, a null storage pointer in a pool accessor) about 16 s after a 31 s frame. Not the watchdog sites from #454 either.

No game data used. AI-assisted (Claude Code).

Edited: the durations above were first timed from the start of the story load; they are now from entering the world (the load took 29–41 s). The conclusions don't change.

**@⁠crashbashash** on GitHub · 2026-11-24 13:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7133101551) · edited 2026-11-24 15:13 UTC A data point the other way round from your second run: the lock messages **without** the stop. **Setup:** CachyOS (kernel 7.3.4), RX 6800 XT (RDNA2, RADV, Mesa 26.2.6), GE-Proton11-14 (vkd3d-proton `cae8353ed`) run with `proton runinprefix`, #844 at `b7cc788`, diagnostics build via cargo-xwin, 1.0.2.1, watchdog **not** disabled. - The first `RtlReleaseSRWLockExclusive Lock … is not owned exclusive!` came **~2 min 18 s** into the world, close to your first run's ~3 min: 200 in total, from two threads, all on one lock address. - Frames slowed to 5–8 s for about a minute around it, then went back to about 2 s. Frame-rate lines and audio carried on, and the world ran for **8 more minutes** after the first message. With your second run (the stop without the messages), that suggests the messages and the stop are independent. My run did end about 8 minutes later, but not with your stop: several worker threads hit a title assert (`int3` at `+0x5149aec`, a null storage pointer in a pool accessor) about 16 s after a 31 s frame. Not the watchdog sites from #454 either. No game data used. AI-assisted (Claude Code). _Edited: the durations above were first timed from the start of the story load; they are now from entering the world (the load took 29–41 s). The conclusions don't change._
Author
Owner

@⁠Mumogg on GitHub · 2026-11-24 17:30 UTC · original · edited 2026-11-24 19:08 UTC

Follow-up on the stop (part 2 of my earlier comment): two more freezes caught with a debugger attached, and the picture is now consistent. Same machine and stack as before (RTX 5070 Ti, Wine 11.22 Staging, GE-Proton11-14 vkd3d-proton). Offsets are for 1.0.2.1; no title code attached.

What the spinning worker is looking for. The lookup at title+0x50eb750 builds its key from the pool element it is handed: pool type, slot index, and a small field taken from that slot's word in the pool's per-slot table at the time of the call. The insert side (+0x35b70c0 / +0x35b7200) builds the key the same way, at the time of the insert. In both captures the table holds an entry for the same type and slot whose field is exactly one lower than what the lookup computes:

capture key the job asks for entry in the table slot word now
1 (250 s) 0x0c81928 0x0881928 not read
2 (420 s) 0x18813cb 0x14813cb field = 6, low bits a link to another slot

So the key is not missing because it was never inserted: the slot's word changed between the insert and the job's lookup. The low bits of the slot word in capture 2 point at another slot rather than holding the all-ones value its allocated neighbours have, which reads like a generation counter on a slot that has been freed since. In capture 2, 64 of the 691 live entries in the table no longer match their slot's current word, and every one I decoded is off by exactly one. So objects registered in the table are routinely released before the table is next cleared, and the freeze is the case where a job still holds one of them. The lookup has no exit for an absent key (a sibling at +0x56c6340 does stop at an empty slot), so it probes forever.

What it is not. The clear-all at +0x55bfa00 is behaving: the job counter at +0x8d7a9b0 reads 0x80000001 in both captures (waiter bit set, exactly one job outstanding, the stuck one), so the clear is correctly waiting on a job that never ends, and the table pointer and mask the job cached match the globals. Not a torn grow, not an early wake of the wait, nothing inside VIctory's or Wine's synchronisation.

My reading (inference, not shown): the title relies on the registration and the jobs that use it happening close together, and on the console they do. Here a world frame takes 0.5 to 2 s, while whatever releases these objects keeps its own pace, so the window in which a registered object can be released before its job runs is far wider. That would also fit the stop appearing only in the world and more often on slower configurations. What I have not found is who releases the objects and whether that is supposed to be held off while jobs are pending; if someone knows that side of the title, that is the missing piece.

If that reading holds, the options on VIctory's side are to get the frame time down (the real cure) or to give that one lookup an exit for an absent key, which would need a way to patch title code that I do not think exists yet.

Method, for anyone who wants to repeat it: a loop that restarts the title until the frame lines stop for 45 s, then gdb -p on the Wine process with a small Python script that reads the stuck thread's registers, the table globals at +0x876fc48/+0x876fc50 and the pool table at +0xabbe7c0. Freezes here: 3 of 5 runs today, at 250 to 420 s.

(AI-assisted, Claude Code: it wrote the probe and this text; I ran it on my machine.)

Edit: the Wine version was 11.22 Staging, not 11.21 (the system had updated before these runs).

**@⁠Mumogg** on GitHub · 2026-11-24 17:30 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7139292234) · edited 2026-11-24 19:08 UTC Follow-up on the stop (part 2 of my earlier comment): two more freezes caught with a debugger attached, and the picture is now consistent. Same machine and stack as before (RTX 5070 Ti, Wine 11.22 Staging, GE-Proton11-14 vkd3d-proton). Offsets are for 1.0.2.1; no title code attached. **What the spinning worker is looking for.** The lookup at `title+0x50eb750` builds its key from the pool element it is handed: pool type, slot index, and a small field taken from that slot's word in the pool's per-slot table at the time of the call. The insert side (`+0x35b70c0` / `+0x35b7200`) builds the key the same way, at the time of the insert. In both captures the table holds an entry for the same type and slot whose field is exactly one lower than what the lookup computes: | capture | key the job asks for | entry in the table | slot word now | |---|---|---|---| | 1 (250 s) | `0x0c81928` | `0x0881928` | not read | | 2 (420 s) | `0x18813cb` | `0x14813cb` | field = 6, low bits a link to another slot | So the key is not missing because it was never inserted: the slot's word changed between the insert and the job's lookup. The low bits of the slot word in capture 2 point at another slot rather than holding the all-ones value its allocated neighbours have, which reads like a generation counter on a slot that has been freed since. In capture 2, 64 of the 691 live entries in the table no longer match their slot's current word, and every one I decoded is off by exactly one. So objects registered in the table are routinely released before the table is next cleared, and the freeze is the case where a job still holds one of them. The lookup has no exit for an absent key (a sibling at `+0x56c6340` does stop at an empty slot), so it probes forever. **What it is not.** The clear-all at `+0x55bfa00` is behaving: the job counter at `+0x8d7a9b0` reads `0x80000001` in both captures (waiter bit set, exactly one job outstanding, the stuck one), so the clear is correctly waiting on a job that never ends, and the table pointer and mask the job cached match the globals. Not a torn grow, not an early wake of the wait, nothing inside VIctory's or Wine's synchronisation. **My reading (inference, not shown):** the title relies on the registration and the jobs that use it happening close together, and on the console they do. Here a world frame takes 0.5 to 2 s, while whatever releases these objects keeps its own pace, so the window in which a registered object can be released before its job runs is far wider. That would also fit the stop appearing only in the world and more often on slower configurations. What I have not found is who releases the objects and whether that is supposed to be held off while jobs are pending; if someone knows that side of the title, that is the missing piece. If that reading holds, the options on VIctory's side are to get the frame time down (the real cure) or to give that one lookup an exit for an absent key, which would need a way to patch title code that I do not think exists yet. Method, for anyone who wants to repeat it: a loop that restarts the title until the frame lines stop for 45 s, then `gdb -p` on the Wine process with a small Python script that reads the stuck thread's registers, the table globals at `+0x876fc48`/`+0x876fc50` and the pool table at `+0xabbe7c0`. Freezes here: 3 of 5 runs today, at 250 to 420 s. (AI-assisted, Claude Code: it wrote the probe and this text; I ran it on my machine.) *Edit: the Wine version was 11.22 Staging, not 11.21 (the system had updated before these runs).*
Author
Owner

@⁠crashbashash on GitHub · 2026-11-24 19:59 UTC · original

@⁠Mumogg @⁠r4tedx a measurement on whether VIctory's copy-back can be what changes the slot words behind this stall. Local diagnostics patch on 94e0ea5 (r4tedx's update 9, which has the most copy-back traffic), not for upstream. RX 6800 XT, RADV, GE-Proton11-14, three 10-minute runs in the world.

In Shadow::copy_back, for every 64 KiB piece that is written back, I count:

  • title writes reverted: bytes the shader left alone that the title changed between the piece's read and its write-back (the race r4tedx described on #293). Counted by reading the piece again right before write_mapped, so it's a lower bound.
  • title writes lost to a shader byte: bytes the shader wrote that the title also changed since the submission, to a different value. The write-back puts the shader's byte over the title's newer one.
  • overlap of each written-back piece with the lookup table (+0x876fc50, 144-byte groups, count at +0x876fc48) and with every pool's slot words (pool array at +0xabbe7c0, slot words at pool +0x28), re-read every 5 s.

Two unit tests (run under Wine) check that each count sees what it should and ignores the other case.

run 1 run 2 run 3
pieces written back 44,034 — 17,555
shader bytes written back — 430 M 218 M
title writes reverted 0 0 0
title writes lost to a shader byte (not counted) 5,298 B in 186 pieces 2,115 B in 99 pieces
pieces touching the lookup table or any slot words (not counted) (not counted) 0 (85–87 pools)

So on this machine the copy-back never wrote into the memory this lookup reads, by either race, and the revert race didn't fire at all. That points away from VIctory corrupting these slot words, and towards your reading of a timing window inside the title that slow frames widen. No run stalled this time (it's intermittent, so that says nothing either way). The lost-to-a-shader bytes are real but land elsewhere; I don't know yet what they hit.

No game data attached. AI-assisted (Claude Code).

**@⁠crashbashash** on GitHub · 2026-11-24 19:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7142890383) @⁠Mumogg @⁠r4tedx a measurement on whether VIctory's copy-back can be what changes the slot words behind this stall. Local diagnostics patch on `94e0ea5` (r4tedx's update 9, which has the most copy-back traffic), not for upstream. RX 6800 XT, RADV, GE-Proton11-14, three 10-minute runs in the world. In `Shadow::copy_back`, for every 64 KiB piece that is written back, I count: - **title writes reverted:** bytes the shader left alone that the title changed between the piece's read and its write-back (the race r4tedx described on #293). Counted by reading the piece again right before `write_mapped`, so it's a lower bound. - **title writes lost to a shader byte:** bytes the shader wrote that the title also changed since the submission, to a different value. The write-back puts the shader's byte over the title's newer one. - **overlap** of each written-back piece with the lookup table (`+0x876fc50`, 144-byte groups, count at `+0x876fc48`) and with every pool's slot words (pool array at `+0xabbe7c0`, slot words at pool `+0x28`), re-read every 5 s. Two unit tests (run under Wine) check that each count sees what it should and ignores the other case. | | run 1 | run 2 | run 3 | |---|---|---|---| | pieces written back | 44,034 | — | 17,555 | | shader bytes written back | — | 430 M | 218 M | | title writes reverted | 0 | 0 | 0 | | title writes lost to a shader byte | (not counted) | 5,298 B in 186 pieces | 2,115 B in 99 pieces | | pieces touching the lookup table or any slot words | (not counted) | (not counted) | 0 (85–87 pools) | So on this machine the copy-back never wrote into the memory this lookup reads, by either race, and the revert race didn't fire at all. That points away from VIctory corrupting these slot words, and towards your reading of a timing window inside the title that slow frames widen. No run stalled this time (it's intermittent, so that says nothing either way). The lost-to-a-shader bytes are real but land elsewhere; I don't know yet what they hit. No game data attached. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:51 UTC · original · edited 2026-11-25 06:52 UTC

Automated triage for the maintainers.

Where it stands:

  • The RtlReleaseSRWLockExclusive ... is not owned exclusive messages are not from VIctory or the title. The relay trace above puts every call on that lock in vkd3d-proton's d3d12core.dll (its device memory allocation path), and the messages and the stop occur independently. That belongs upstream with vkd3d-proton.
  • The stop with the process still alive: in the captured runs one title worker thread spins in a lookup while the others wait; the working reading is a timing window that very slow world frames widen. The world frame time is discussed in #400.
  • Since these runs, main changed the copy-back (commits cd94d35 and 940d32f in crates/victory-gpu): only pages that shaders mark as written are compared and written back, so a shader's bytes no longer go over newer title bytes. The two write-back counts from this thread, measured again on main at 940d32f or later, would show whether that holds.

This issue stays open as the Wine-side record of the stall. A VICTORY_STACKS dump from someone else's stop would also help.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7152310482) · edited 2026-11-25 06:52 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T04:30:51Z at=2026-11-25T06:52:19Z --> Automated triage for the maintainers. Where it stands: - **The `RtlReleaseSRWLockExclusive ... is not owned exclusive` messages** are not from VIctory or the title. The relay trace above puts every call on that lock in vkd3d-proton's `d3d12core.dll` (its device memory allocation path), and the messages and the stop occur independently. That belongs upstream with vkd3d-proton. - **The stop with the process still alive**: in the captured runs one title worker thread spins in a lookup while the others wait; the working reading is a timing window that very slow world frames widen. The world frame time is discussed in #400. - Since these runs, `main` changed the copy-back (commits cd94d35 and 940d32f in `crates/victory-gpu`): only pages that shaders mark as written are compared and written back, so a shader's bytes no longer go over newer title bytes. The two write-back counts from this thread, measured again on `main` at 940d32f or later, would show whether that holds. This issue stays open as the Wine-side record of the stall. A `VICTORY_STACKS` dump from someone else's stop would also help. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠r4tedx on GitHub · 2026-11-25 04:30 UTC · original

@⁠crashbashash thank you for measuring this, and for the two counters. A late answer, with one pointer that bears on your "title writes lost to a shader byte" row.

main changed the copy-back after your runs, in cd94d35 (with 940d32f on top). By its commit message: translated shaders now mark the 64 KiB title pages they write through unordered buffer views, after a submission only the marked pages are compared and written back, and "a page the title writes while shaders may write it keeps its bytes from before (saved by the guard on the first write), so both writers' bytes survive". That is aimed at the case you counted (5,298 B in 186 pieces, 2,115 B in 99): a shader's byte going over a newer byte of the title's.

I have read the commit, not run it. Your two counts on main at 940d32f or later would be the measurement that shows whether it holds. 94e0ea5 (update 9 of integration/testers) will not get this change: that tree stays at 4744af9, its last update on the old base, as noted on #293.

Your result that no written-back piece touched the lookup table or the pools' slot words stands as you stated it, and I have nothing to add to the triage's reading of a timing window.

Nothing was run for this comment.

AI-assisted (Claude Code).

**@⁠r4tedx** on GitHub · 2026-11-25 04:30 UTC · [original](https://github.com/Marvisak/VIctory/issues/774#issuecomment-7152911045) @⁠crashbashash thank you for measuring this, and for the two counters. A late answer, with one pointer that bears on your "title writes lost to a shader byte" row. `main` changed the copy-back after your runs, in `cd94d35` (with `940d32f` on top). By its commit message: translated shaders now mark the 64 KiB title pages they write through unordered buffer views, after a submission only the marked pages are compared and written back, and "a page the title writes while shaders may write it keeps its bytes from before (saved by the guard on the first write), so both writers' bytes survive". That is aimed at the case you counted (5,298 B in 186 pieces, 2,115 B in 99): a shader's byte going over a newer byte of the title's. I have read the commit, not run it. Your two counts on `main` at `940d32f` or later would be the measurement that shows whether it holds. `94e0ea5` (update 9 of `integration/testers`) will not get this change: that tree stays at `4744af9`, its last update on the old base, as noted on #293. Your result that no written-back piece touched the lookup table or the pools' slot words stands as you stated it, and I have nothing to add to the triage's reading of a timing window. Nothing was run for this comment. AI-assisted (Claude Code).
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/Marvisak--VIctory#774
No description provided.