Feature request: experimental Linux/Wine support and compatibility documentation #340

Open
opened 2026-11-26 03:59:52 +00:00 by github-bot · 24 comments
Owner

@⁠ajsem1337 on GitHub · 2026-11-24 02:24 UTC · original

I'd like to propose documenting and tracking an experimental Linux/Wine path for the Windows build of VIctory. This is a feature/support-tracking request, not a claim that Linux is currently supported or a new regression report against current main.

The Windows-only requirements and the current world-rendering limitations in the README are understood. A separate, explicitly experimental launch recipe and compatibility matrix would help contributors avoid rediscovering Wine-specific setup requirements.

Tested setup

  • CachyOS, kernel 7.3.5; Ryzen 9 5950X, 32 GiB RAM.
  • Radeon RX 7900 GRE; Mesa/RADV 26.3.1.
  • System Wine 10.0-20260425.
  • vkd3d-proton 0bb64c56c8f0dcc and DXVK 3.1.1-134-g2cb40186c, from the installed GE-Proton11-11 distribution.
  • Windows MSVC build, cross-compiled with Rust 1.98.1 / cargo-xwin 0.24.1.
  • Tested VIctory revision: 97c78d1, initially unmodified, then with one small local submission-lock change described below.
  • Native Wayland, an isolated Wine prefix, and bubblewrap with networking unshared. Title files were mounted read-only; caches and saves were separate. Audio used the existing Pulse-compatible socket.

These results are historical: the reviewed main is d2a4bae, 59 commits ahead of the tested baseline. I have not rebuilt or retested that revision.

What worked

  • The completed synthetic D3D12 checks cover compute, native Wayland swapchain/Present, resize and the RGBA8/BGRA8/RGB10A2/RGBA16F format families. Presentation returned S_OK for 225 frames, with five exact GPU readbacks.
  • A native Microsoft d3dcompiler_47.dll in the prefix compiled and ran VIctory's indirect-argument clamp shader. Wine's builtin compiler rejected it. This adds tested workaround evidence to #170; no compiler DLL is attached or redistributed.
  • The actual title launched through victory.exe run ... --execute. The EXE bound 88 HLE, 427 host and 72 title imports, with 0 missing; all four title DLLs also bound without missing imports.
  • First-time setup, menu/licence screens, settings and saves worked. Menu rendering reached about 30 fps.
  • On the next run, existing settings were used and the title went straight into loading the world. Ambient audio became audible, but the scene stayed black. The title's local crash context recorded the game-running state and the first mission's intro. This is not playable gameplay.

Remaining observations on the tested revision

Frame pacing was unstable: roughly 15–30 fps in many logged intervals, with much worse spikes observed manually; audio stuttered. One measured interval spent 55–82 ms preparing/updating textures on the CPU versus about 1–1.5 ms on the GPU.

The unmodified baseline exited with:

a host state prelude did not record (0x8007000E)
d3d12_command_allocator_Reset: There are still 1 pending command lists awaiting execution

Moving the existing submission mutex ahead of deferred/prelude preparation changed the pending-allocator error count from 34 to 0 in the next run; that run reached the world and failed differently. Current main already covers preparation with the submission lock, so this is not a request to merge the local change or a claim of a new fix.

The next failure exhausted an approximately 1 MiB thread stack. A debugger capture before termination shows many repeated d3d12core.dll+0x2648f5 / +0x2649f5 frames. The later crash-reporter overflow and the title's null-write report were secondary observations; the exact recursive function has not been identified from the stripped DLL. This may be relevant to #144 / #151, but the AMD/RADV run does not establish the same NVIDIA-driver cause. No kernel GPU reset/fault or device-removal message was recorded in these runs.

Relation to current work / proposed scope

I found the already-merged texture improvements #60 and #79, Wine physical-page work #53, and the pipeline-worker code now in main. Those changes mean the old timing and failure observations above should not be treated as current-main results. #90 separately tracks native Linux build/test status; #128 and #170 track specific Wine runtime gaps, and #49 collects tester results.

The proposal is to add an experimental Windows-build-on-Linux recipe and track its tested Wine/VKD3D/DXVK versions, prefix/compiler requirements, Wayland/audio setup and remaining limitations separately from official Windows support.

Only diagnostic text is included here. No game binaries, shaders, memory dumps or game assets are attached. Report prepared with AI assistance (Codex).

**@⁠ajsem1337** on GitHub · 2026-11-24 02:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/340) I'd like to propose documenting and tracking an **experimental Linux/Wine path** for the Windows build of VIctory. This is a feature/support-tracking request, not a claim that Linux is currently supported or a new regression report against current main. The Windows-only requirements and the current world-rendering limitations in the README are understood. A separate, explicitly experimental launch recipe and compatibility matrix would help contributors avoid rediscovering Wine-specific setup requirements. ## Tested setup - CachyOS, kernel 7.3.5; Ryzen 9 5950X, 32 GiB RAM. - Radeon RX 7900 GRE; Mesa/RADV 26.3.1. - System Wine 10.0-20260425. - vkd3d-proton `0bb64c56c8f0dcc` and DXVK `3.1.1-134-g2cb40186c`, from the installed GE-Proton11-11 distribution. - Windows MSVC build, cross-compiled with Rust 1.98.1 / cargo-xwin 0.24.1. - **Tested VIctory revision: `97c78d1`**, initially unmodified, then with one small local submission-lock change described below. - Native Wayland, an isolated Wine prefix, and bubblewrap with networking unshared. Title files were mounted read-only; caches and saves were separate. Audio used the existing Pulse-compatible socket. **These results are historical:** the reviewed main is `d2a4bae`, 59 commits ahead of the tested baseline. I have not rebuilt or retested that revision. ## What worked - The completed synthetic D3D12 checks cover compute, native Wayland swapchain/Present, resize and the RGBA8/BGRA8/RGB10A2/RGBA16F format families. Presentation returned `S_OK` for 225 frames, with five exact GPU readbacks. - A native Microsoft `d3dcompiler_47.dll` in the prefix compiled and ran VIctory's indirect-argument clamp shader. Wine's builtin compiler rejected it. This adds tested workaround evidence to #170; no compiler DLL is attached or redistributed. - The actual title launched through `victory.exe run ... --execute`. The EXE bound 88 HLE, 427 host and 72 title imports, with **0 missing**; all four title DLLs also bound without missing imports. - First-time setup, menu/licence screens, settings and saves worked. Menu rendering reached about 30 fps. - On the next run, existing settings were used and the title went straight into loading the world. Ambient audio became audible, but the scene stayed black. The title's local crash context recorded the game-running state and the first mission's intro. This is **not playable gameplay**. ## Remaining observations on the tested revision Frame pacing was unstable: roughly 15–30 fps in many logged intervals, with much worse spikes observed manually; audio stuttered. One measured interval spent 55–82 ms preparing/updating textures on the CPU versus about 1–1.5 ms on the GPU. The unmodified baseline exited with: ```text a host state prelude did not record (0x8007000E) d3d12_command_allocator_Reset: There are still 1 pending command lists awaiting execution ``` Moving the existing submission mutex ahead of deferred/prelude preparation changed the pending-allocator error count from 34 to 0 in the next run; that run reached the world and failed differently. **Current main already covers preparation with the submission lock**, so this is not a request to merge the local change or a claim of a new fix. The next failure exhausted an approximately 1 MiB thread stack. A debugger capture before termination shows many repeated `d3d12core.dll+0x2648f5 / +0x2649f5` frames. The later crash-reporter overflow and the title's null-write report were secondary observations; the exact recursive function has not been identified from the stripped DLL. This may be relevant to #144 / #151, but the AMD/RADV run does not establish the same NVIDIA-driver cause. No kernel GPU reset/fault or device-removal message was recorded in these runs. ## Relation to current work / proposed scope I found the already-merged texture improvements #60 and #79, Wine physical-page work #53, and the pipeline-worker code now in main. Those changes mean the old timing and failure observations above should not be treated as current-main results. #90 separately tracks native Linux build/test status; #128 and #170 track specific Wine runtime gaps, and #49 collects tester results. The proposal is to add an experimental Windows-build-on-Linux recipe and track its tested Wine/VKD3D/DXVK versions, prefix/compiler requirements, Wayland/audio setup and remaining limitations separately from official Windows support. Only diagnostic text is included here. No game binaries, shaders, memory dumps or game assets are attached. Report prepared with AI assistance (Codex).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:52 +00:00
Author
Owner

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

Supporting the proposal with a second data set, measured after the revision in the issue (main d2a4bae, plus the #129 merge). It confirms the shape and adds the parts that changed:

Environment

  • Arch Linux, Wine 11.22, vkd3d-proton 3.1 (system package), AMD RX 9060 XT, RADV 26.3.1.
  • Windows release build with Rust 1.98.1 / cargo-xwin 0.24.1, x86_64-pc-windows-msvc, native lld-link/clang-cl.
  • No game files; synthetic shader/GPU/HLE tests only.

Windows test binaries under Wine (no #39/#112 needed)

  • victory_gpu, 52 tests:
    • 52/52 pass on Wine's built-in D3D12 (fresh prefix, no vkd3d-proton).
    • 50/52 on vkd3d-proton 3.1: the two are pipeline::library::a_rejected_blob_gives_an_empty_library (vkd3d wants a non-empty blob for CreatePipelineLibrary) and #128.
  • victory-hle: 85/86; the one failure is only_loopback_is_reachable (Wine lacks WSAConnectByList). #195 fixed it; it is closed and the remaining Wine fallbacks are tracked in #217.
  • victory-loader and victory-shader suites also run under Wine; the loader tests that parse the test binary as PE must use the Windows build (on Linux the binary is ELF).

The indirect clamp (#170) has two fixes now

  • Wine's builtin d3dcompiler_47 rejects the HLSL (E5005), so every indirect execution is dropped on the test path.
  • A native Microsoft d3dcompiler_47.dll in the DLL search path makes indirect::tests::* pass (matches the issue's finding).
  • #178 falls back to DXC, but needs dxcompiler.dll, which Wine does not ship; provided one, the clamp passes.
  • #190 emits the clamp with the project's own DXIL writer, so no shader compiler is needed at all and it works with Wine's stock d3dcompiler_47. For a Linux/Wine compatibility recipe, #190 is the piece to point at.

#128 is specific to vkd3d-proton

  • On Wine's built-in D3D12, resource::tests::buffer_data_reaches_the_host_texture passes and the whole GPU suite is green.
  • On vkd3d-proton it fails because VirtualQuery reports the mapped upload heap as MEM_FREE, so the deferred copy is skipped; bypassing the guard makes it pass.
  • So the doc should say vkd3d-proton has this known upload gap until #128 lands, rather than listing it as a Wine-wide limitation.

Other pieces worth naming in the recipe

  • #191: launcher/smoke test; it picks an MSVC release when no gnullvm build exists, and umu-run was verified with it (a stock Steam Proton under UMU failed at unable to use parent for game drive; UMU-Proton is the tested runtime).
  • #312: SDL3 gamepad backend (dynamically loaded SDL3.dll, XInput fallback, trigger rumble). A GameSir G7 Pro was read live under Wine; SDL3.dll goes next to victory.exe.
  • Build state: current main still fails a native Linux build (E0425 host_resource), so the recipe must say "Windows build, run under Wine/Proton", and point at #112/#235 for the native route.

The matrix differs from the issue's revision in exactly the places the merged work touched, which is the argument for keeping the version/commit column in the doc rather than a single "Linux works/doesn't" line.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 02:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7120169338) Supporting the proposal with a second data set, measured **after** the revision in the issue (main `d2a4bae`, plus the #129 merge). It confirms the shape and adds the parts that changed: ## Environment - Arch Linux, Wine **11.22**, vkd3d-proton **3.1** (system package), AMD RX 9060 XT, RADV 26.3.1. - Windows release build with Rust 1.98.1 / **cargo-xwin 0.24.1**, `x86_64-pc-windows-msvc`, native `lld-link`/`clang-cl`. - No game files; synthetic shader/GPU/HLE tests only. ## Windows test binaries under Wine (no #39/#112 needed) - `victory_gpu`, 52 tests: - **52/52 pass on Wine's built-in D3D12** (fresh prefix, no vkd3d-proton). - **50/52 on vkd3d-proton 3.1**: the two are `pipeline::library::a_rejected_blob_gives_an_empty_library` (vkd3d wants a non-empty blob for `CreatePipelineLibrary`) and **#128**. - `victory-hle`: **85/86**; the one failure is `only_loopback_is_reachable` (Wine lacks `WSAConnectByList`). #195 fixed it; it is closed and the remaining Wine fallbacks are tracked in #217. - `victory-loader` and `victory-shader` suites also run under Wine; the loader tests that parse the test binary as PE must use the Windows build (on Linux the binary is ELF). ## The indirect clamp (#170) has two fixes now - Wine's builtin `d3dcompiler_47` rejects the HLSL (`E5005`), so *every* indirect execution is dropped on the test path. - A native Microsoft `d3dcompiler_47.dll` in the DLL search path makes `indirect::tests::*` pass (matches the issue's finding). - **#178** falls back to DXC, but needs `dxcompiler.dll`, which Wine does not ship; provided one, the clamp passes. - **#190** emits the clamp with the project's own DXIL writer, so **no shader compiler is needed at all** and it works with Wine's stock `d3dcompiler_47`. For a Linux/Wine compatibility recipe, #190 is the piece to point at. ## #128 is specific to vkd3d-proton - On Wine's built-in D3D12, `resource::tests::buffer_data_reaches_the_host_texture` passes and the whole GPU suite is green. - On vkd3d-proton it fails because `VirtualQuery` reports the mapped upload heap as `MEM_FREE`, so the deferred copy is skipped; bypassing the guard makes it pass. - So the doc should say vkd3d-proton has this known upload gap until #128 lands, rather than listing it as a Wine-wide limitation. ## Other pieces worth naming in the recipe - **#191**: launcher/smoke test; it picks an MSVC release when no gnullvm build exists, and `umu-run` was verified with it (a stock Steam Proton under UMU failed at `unable to use parent for game drive`; UMU-Proton is the tested runtime). - **#312**: SDL3 gamepad backend (dynamically loaded `SDL3.dll`, XInput fallback, trigger rumble). A GameSir G7 Pro was read live under Wine; `SDL3.dll` goes next to `victory.exe`. - Build state: current `main` still fails a *native Linux* build (`E0425 host_resource`), so the recipe must say "Windows build, run under Wine/Proton", and point at #112/#235 for the native route. The matrix differs from the issue's revision in exactly the places the merged work touched, which is the argument for keeping the version/commit column in the doc rather than a single "Linux works/doesn't" line. No game data used.
Author
Owner

@⁠desplmfao on GitHub · 2026-11-24 03:02 UTC · original

#259

this pr also helps for linux users on nvidia cards

**@⁠desplmfao** on GitHub · 2026-11-24 03:02 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7120713238) https://git.gtahub.st/github/Marvisak--VIctory/pulls/259 this pr also helps for linux users on nvidia cards
Author
Owner

@⁠andyeox-systemd on GitHub · 2026-11-24 03:21 UTC · original

NVIDIA data point to complement the AMD results above (no game files used, synthetic tests only):

Environment

  • Arch Linux, kernel 7.2.14-arch1-1, Hyprland (Wayland)
  • AMD Ryzen 9 7950X, 32 GB RAM
  • NVIDIA RTX 4070 Ti, proprietary driver 615.78.08, Vulkan 1.4.351
  • Wine 11.21, vkd3d-proton 3.1, DXVK 3.1.1 (DLLs installed in a fresh prefix, WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n")
  • Windows MSVC build via cargo-xwin 0.24.1, Rust 1.98.1, x86_64-pc-windows-msvc
  • VIctory commit: d2a4bae (main, same revision as the AMD run above)

Results (cargo xwin test --workspace --no-fail-fast, CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER=wine)

  • victory-gpu: 40 passed, 3 failed, 1 ignored. Failures: a_rejected_blob_gives_an_empty_library, argument_clamp_builds (clamp().is_some() assertion), buffer_data_reaches_the_host_texture (assertion left == right failed: row 0)
  • victory-hle: 85/86. Failure: only_loopback_is_reachable
  • victory-loader: loads_binds_and_calls_probe fails (1 passed, 1 failed in load_probe)
  • victory-shader: 68/69. Failure: stub_pipeline_is_created
  • xtask: repository_passes_policy fails

Notes

  • Every failure is on the known list from the README and the AMD reports, so I saw no NVIDIA-specific differences on this revision.
  • Running the shader tests wrote crates/victory-shader/vkd3d-proton.cache into the working tree, which cargo xtask policy flags (file type not on the allowlist / binary content). Deleting it made the check pass. Maybe worth a .gitignore entry or pointing the cache elsewhere for test runs.
  • Wine's built-in D3D12 was not tested, since the README says it can't run the translated shaders.

Happy to test further revisions or PRs (#190, #195) on NVIDIA, or to try the Proton launcher from #191, if useful.

**@⁠andyeox-systemd** on GitHub · 2026-11-24 03:21 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7121014715) NVIDIA data point to complement the AMD results above (no game files used, synthetic tests only): **Environment** - Arch Linux, kernel 7.2.14-arch1-1, Hyprland (Wayland) - AMD Ryzen 9 7950X, 32 GB RAM - NVIDIA RTX 4070 Ti, proprietary driver 615.78.08, Vulkan 1.4.351 - Wine 11.21, vkd3d-proton 3.1, DXVK 3.1.1 (DLLs installed in a fresh prefix, `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n"`) - Windows MSVC build via cargo-xwin 0.24.1, Rust 1.98.1, `x86_64-pc-windows-msvc` - VIctory commit: `d2a4bae` (main, same revision as the AMD run above) **Results** (`cargo xwin test --workspace --no-fail-fast`, `CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER=wine`) - `victory-gpu`: 40 passed, 3 failed, 1 ignored. Failures: `a_rejected_blob_gives_an_empty_library`, `argument_clamp_builds` (`clamp().is_some()` assertion), `buffer_data_reaches_the_host_texture` (assertion `left == right` failed: row 0) - `victory-hle`: 85/86. Failure: `only_loopback_is_reachable` - `victory-loader`: `loads_binds_and_calls_probe` fails (1 passed, 1 failed in `load_probe`) - `victory-shader`: 68/69. Failure: `stub_pipeline_is_created` - `xtask`: `repository_passes_policy` fails **Notes** - Every failure is on the known list from the README and the AMD reports, so I saw no NVIDIA-specific differences on this revision. - Running the shader tests wrote `crates/victory-shader/vkd3d-proton.cache` into the working tree, which `cargo xtask policy` flags (file type not on the allowlist / binary content). Deleting it made the check pass. Maybe worth a `.gitignore` entry or pointing the cache elsewhere for test runs. - Wine's built-in D3D12 was not tested, since the README says it can't run the translated shaders. Happy to test further revisions or PRs (#190, #195) on NVIDIA, or to try the Proton launcher from #191, if useful.
Author
Owner

@⁠ajsem1337 on GitHub · 2026-11-24 04:44 UTC · original

Following up on the experimental Wine path with results from the Windows MSVC build of d2a4bae. I tested on an RX 7900 GRE with RADV 26.3.1, Wine 10.0, vkd3d-proton 0bb64c5 and DXVK 3.1.1. The prefix used native D3D12/DXGI, native Wayland and one Pulse socket inside an offline bubblewrap sandbox.

  • On clean main, 41/43 GPU tests passed with native d3dcompiler_47. #347 fixed empty pipeline-library creation (NULL, 0 succeeds), and #322 fixed the deferred-upload case. With both patches, a full run passed 45/45. With Wine’s builtin compiler, adding #190 took the same suite from 44/45 to 45/45. The copy test added by #322 was intermittent in parallel and passed 20/20 in serial.
  • A standalone Wayland swapchain completed 225/225 presents. In title runs we could navigate the menu, retain settings across launches and hear street ambience during world loading. The screen stayed black, audio cut out and the process exited. We have no confirmed gameplay on this setup.
  • On the patched build, #151 increased the executable’s stack reserve while the Rust pipeline workers retained 2 MiB. A synthetic compute pipeline overflowed a 2 MiB thread during PSO creation. In a separate title run with explicit 16 MiB worker stacks, two threads still exhausted their stacks and a third, named pipeline worker faulted in d3d12core during compute PSO creation. The exact cause of the world-load failure remains open.

For the compatibility matrix, #532 adds an independent RTX 4080 / Proton result. #526 tracks a separate native Linux runtime. Recording the VIctory revision, applied PRs and exact D3D12 runtime alongside each result would make these reports easier to compare.

**@⁠ajsem1337** on GitHub · 2026-11-24 04:44 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7122302465) Following up on the experimental Wine path with results from the Windows MSVC build of d2a4bae. I tested on an RX 7900 GRE with RADV 26.3.1, Wine 10.0, vkd3d-proton 0bb64c5 and DXVK 3.1.1. The prefix used native D3D12/DXGI, native Wayland and one Pulse socket inside an offline bubblewrap sandbox. - On clean main, 41/43 GPU tests passed with native d3dcompiler_47. #347 fixed empty pipeline-library creation (NULL, 0 succeeds), and #322 fixed the deferred-upload case. With both patches, a full run passed 45/45. With Wine’s builtin compiler, adding #190 took the same suite from 44/45 to 45/45. The copy test added by #322 was intermittent in parallel and passed 20/20 in serial. - A standalone Wayland swapchain completed 225/225 presents. In title runs we could navigate the menu, retain settings across launches and hear street ambience during world loading. The screen stayed black, audio cut out and the process exited. We have no confirmed gameplay on this setup. - On the patched build, #151 increased the executable’s stack reserve while the Rust pipeline workers retained 2 MiB. A synthetic compute pipeline overflowed a 2 MiB thread during PSO creation. In a separate title run with explicit 16 MiB worker stacks, two threads still exhausted their stacks and a third, named pipeline worker faulted in d3d12core during compute PSO creation. The exact cause of the world-load failure remains open. For the compatibility matrix, #532 adds an independent RTX 4080 / Proton result. #526 tracks a separate native Linux runtime. Recording the VIctory revision, applied PRs and exact D3D12 runtime alongside each result would make these reports easier to compare.
Author
Owner

@⁠andyeox-systemd on GitHub · 2026-11-24 05:20 UTC · original

Thanks for the detailed AMD results, @⁠ajsem1337. Here is the NVIDIA side, with the details you asked for. The logs and comments are on #144.

Setup: RTX 4070 Ti, Arch Linux, nvidia-open-dkms 615.78.08, Wine 11.21 (and Proton Experimental's own Wine for one run), DXVK 3.1.1.

Builds tested: main at d2a4bae, with #177 (ce945d6) and #151 merged locally. I also tried a local edit giving the victory-pipelines-* workers a 16 MiB stack.

D3D12 runtimes tested: vkd3d-proton 3.0.1, 3.1, and Proton Experimental's 3.1.0.

Result: the title boots and the menus run. It then crashes at the loading screen after the menu, which is the same stage you describe. The crash is in vkCreateComputePipelines (0xc0000005 or 0xc000001d, in the Unix call), right after compute shader 4e296b1885c37b29 is translated. The crash frame varies between 903 and 1330, but the call and the shader stay the same. I don't know yet if your black screen and exit is the same failure, since you didn't mention this call.

Stack size: with #151 applied, and with 16 MiB stacks on the victory-pipelines-* workers, my crash is unchanged. So the pipeline worker stack doesn't explain it on my setup.

Other notes: Required WaveSize range [64, 64], but supported range is [32, 32] errors are logged before the crash, since NVIDIA's warp size is 32. The kernel log shows no Xid or segfault entries.

I can't tell yet whether the driver (the report that #177 helps was on 620.73.04) or the shader is the cause. Happy to test a newer driver or any other PR on NVIDIA.

**@⁠andyeox-systemd** on GitHub · 2026-11-24 05:20 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7122849157) Thanks for the detailed AMD results, @⁠ajsem1337. Here is the NVIDIA side, with the details you asked for. The logs and comments are on #144. **Setup:** RTX 4070 Ti, Arch Linux, `nvidia-open-dkms` 615.78.08, Wine 11.21 (and Proton Experimental's own Wine for one run), DXVK 3.1.1. **Builds tested:** `main` at `d2a4bae`, with #177 (`ce945d6`) and #151 merged locally. I also tried a local edit giving the `victory-pipelines-*` workers a 16 MiB stack. **D3D12 runtimes tested:** vkd3d-proton 3.0.1, 3.1, and Proton Experimental's 3.1.0. **Result:** the title boots and the menus run. It then crashes at the loading screen after the menu, which is the same stage you describe. The crash is in `vkCreateComputePipelines` (`0xc0000005` or `0xc000001d`, in the Unix call), right after compute shader `4e296b1885c37b29` is translated. The crash frame varies between 903 and 1330, but the call and the shader stay the same. I don't know yet if your black screen and exit is the same failure, since you didn't mention this call. **Stack size:** with #151 applied, and with 16 MiB stacks on the `victory-pipelines-*` workers, my crash is unchanged. So the pipeline worker stack doesn't explain it on my setup. **Other notes:** `Required WaveSize range [64, 64], but supported range is [32, 32]` errors are logged before the crash, since NVIDIA's warp size is 32. The kernel log shows no Xid or segfault entries. I can't tell yet whether the driver (the report that #177 helps was on 620.73.04) or the shader is the cause. Happy to test a newer driver or any other PR on NVIDIA.
Author
Owner

@⁠ajsem1337 on GitHub · 2026-11-24 06:53 UTC · original

Update on the Wine path: title runs on a stack of open PRs. Same machine as before (RX 7900 GRE, RADV 26.3.1, kernel 7.3.5), Wine 10.0, but D3D12 now comes from GE-Proton11-14's vkd3d-proton (v3.1-83-gcae8353ed). Same offline bubblewrap sandbox, with the process memory-capped.

All builds start from d2a4bae + #347 + #322. One change was added per run:

Added Time in title End
— 116 s GPU page fault at VA 0 (SQC data), ring reset, DEVICE_REMOVED
#650 143 s same
#635 128 s same; its path never triggered
VKD3D_CONFIG=no_descriptor_heap 104 s same fault class, at a non-zero unmapped VA
#336 + never free host textures (local experiment from #557, not a fix) 577 s no GPU fault; the title stopped on its own breakpoint (0x80000003)
previous row + #464 + #514 312 s no GPU fault; the title wrote to address 0 from one of its own threads (looks like its watchdog)
  • On RADV this is the freed-streaming-texture fault from #557. It is not specific to Wine or vkd3d-proton. With vkd3d-proton's new VK_EXT_descriptor_heap path, the bad descriptor reads address 0. With descriptor_buffer, it reads a stale VA. A RADV_DEBUG=hang dump stops in a direct DrawMeshTasks: mesh 52f7aaea8eb5bce9, pixel 474a38e074be39f3.
  • With never-free, the intro ran to the end. Music, dialogue and story audio played, and subtitles plus title cards with text were drawn. The world stayed black apart from pink artifacts. 423 shaders did not translate. VRAM grew to 16.9 of 17.2 GB, as expected when nothing is freed.
  • The world ran at 0.3 fps, 3335 ms per frame. 2396 ms of that was CPU-side copies (25.7 MB) and 627 ms was texture preparation. GPU time was 34 ms. Adding #464 + #514 did not bring that down: copies still took 0.5 to 2.6 s per frame (24 to 78 MB) with 600 to 2400 draws per frame. So in this scene the copy cost is not the unmapped-block path those PRs fix. I have not found the cause yet. Both runs ended inside the title during the intro, at 9 and at 4.6 minutes, which fits a title watchdog firing at under 1 fps.
  • Not playable. All results are for the commit stack above, not for current main alone.
**@⁠ajsem1337** on GitHub · 2026-11-24 06:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7124402747) Update on the Wine path: title runs on a stack of open PRs. Same machine as before (RX 7900 GRE, RADV 26.3.1, kernel 7.3.5), Wine 10.0, but D3D12 now comes from GE-Proton11-14's vkd3d-proton (`v3.1-83-gcae8353ed`). Same offline bubblewrap sandbox, with the process memory-capped. All builds start from `d2a4bae` + #347 + #322. One change was added per run: | Added | Time in title | End | |---|---|---| | — | 116 s | GPU page fault at VA 0 (SQC data), ring reset, `DEVICE_REMOVED` | | #650 | 143 s | same | | #635 | 128 s | same; its path never triggered | | `VKD3D_CONFIG=no_descriptor_heap` | 104 s | same fault class, at a non-zero unmapped VA | | #336 + never free host textures (local experiment from #557, not a fix) | **577 s** | **no GPU fault**; the title stopped on its own breakpoint (`0x80000003`) | | previous row + #464 + #514 | 312 s | no GPU fault; the title wrote to address 0 from one of its own threads (looks like its watchdog) | - On RADV this is the freed-streaming-texture fault from #557. It is not specific to Wine or vkd3d-proton. With vkd3d-proton's new `VK_EXT_descriptor_heap` path, the bad descriptor reads address 0. With `descriptor_buffer`, it reads a stale VA. A `RADV_DEBUG=hang` dump stops in a direct `DrawMeshTasks`: mesh `52f7aaea8eb5bce9`, pixel `474a38e074be39f3`. - With never-free, the intro ran to the end. Music, dialogue and story audio played, and subtitles plus title cards with text were drawn. The world stayed black apart from pink artifacts. 423 shaders did not translate. VRAM grew to 16.9 of 17.2 GB, as expected when nothing is freed. - The world ran at 0.3 fps, 3335 ms per frame. 2396 ms of that was CPU-side copies (25.7 MB) and 627 ms was texture preparation. GPU time was 34 ms. Adding #464 + #514 did not bring that down: copies still took 0.5 to 2.6 s per frame (24 to 78 MB) with 600 to 2400 draws per frame. So in this scene the copy cost is not the unmapped-block path those PRs fix. I have not found the cause yet. Both runs ended inside the title during the intro, at 9 and at 4.6 minutes, which fits a title watchdog firing at under 1 fps. - Not playable. All results are for the commit stack above, not for current main alone.
Author
Owner

@⁠ajsem1337 on GitHub · 2026-11-24 07:19 UTC · original

Follow-up on the same machine, about an hour later. The stack is the last row of the table above (never-free) plus #490. #490 conflicted with #514 in watch.rs; I resolved it by hand and all 5 watch:: tests pass under Wine. Diagnostics build.

  • Got further this time. Skipping the intro cutscene loads the next part, then the "Nine months ago" and "Prologue" cards on white, then the prologue mission itself. The pause menu showed the mission options (Retry checkpoint, Restart mission), and Settings/Controls worked at about 15 fps in the menu. Mission audio, ambience and NPCs played, but the world stayed black apart from a red flicker in the middle of the screen. 417 shaders did not translate (2157 did).
  • In the mission the world ran at 0.4–0.7 fps. There was no response to movement that I could hear, which fits a simulation advancing a few frames per second of input.
  • Run ended after 560 s with a gfx ring timeout (no page fault this time), with VRAM full at 16.9/17.2 GB from never-free.
  • Where a world frame goes, from copystat (≈2 s/frame):
per frame
write-watch questions ~4,400, 1.1–1.5 s; 25 GB checked, 99.6% unchanged. The largest range is the 174 MB MEM_MAPPED heap at 0x1d1a0000, refreshed 51×/frame
texture hashing 476 MB hashed, 0 MB changed, 0.6–1.7 s
GPU 170–255 ms
actual copies ~40 ms

So under Wine a world frame is almost all write-watch round trips and re-hashing unchanged textures. Next I'll try #388/#401 for the hashing and #185+#600 (with the Wine fix from aycow/VIctory#1) for the questions.

**@⁠ajsem1337** on GitHub · 2026-11-24 07:19 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7124861706) Follow-up on the same machine, about an hour later. The stack is the last row of the table above (never-free) plus #490. #490 conflicted with #514 in `watch.rs`; I resolved it by hand and all 5 `watch::` tests pass under Wine. Diagnostics build. - Got further this time. Skipping the intro cutscene loads the next part, then the "Nine months ago" and "Prologue" cards on white, then the prologue mission itself. The pause menu showed the mission options (Retry checkpoint, Restart mission), and Settings/Controls worked at about 15 fps in the menu. Mission audio, ambience and NPCs played, but the world stayed black apart from a red flicker in the middle of the screen. 417 shaders did not translate (2157 did). - In the mission the world ran at 0.4–0.7 fps. There was no response to movement that I could hear, which fits a simulation advancing a few frames per second of input. - Run ended after 560 s with a `gfx` ring timeout (no page fault this time), with VRAM full at 16.9/17.2 GB from never-free. - Where a world frame goes, from `copystat` (≈2 s/frame): | per frame | | |---|---| | write-watch questions | ~4,400, 1.1–1.5 s; 25 GB checked, 99.6% unchanged. The largest range is the 174 MB `MEM_MAPPED` heap at 0x1d1a0000, refreshed 51×/frame | | texture hashing | 476 MB hashed, 0 MB changed, 0.6–1.7 s | | GPU | 170–255 ms | | actual copies | ~40 ms | So under Wine a world frame is almost all write-watch round trips and re-hashing unchanged textures. Next I'll try #388/#401 for the hashing and #185+#600 (with the Wine fix from aycow/VIctory#1) for the questions.
Author
Owner

@⁠ajsem1337 on GitHub · 2026-11-24 08:51 UTC · original

Update from the same RX 7900 GRE / RADV 26.3.1 box. The biggest change is in Wine itself, not VIctory.

wineserver walks every mapped view on each map and unmap

perf inside the sandbox put 37% of the title's CPU time in wineserver, almost all of it in two loops in server/mapping.c:

  • is_valid_view_addr() (from map_view)
  • find_mapped_view() (from unmap_view)

Both walk process->views, a plain list. The title's streaming and tiled memory keeps mapping and unmapping physical-page views, thousands of them, so each request walks all of them. This is the same in Wine 10.0, 11.0 and current master. It is the cost that showed up in VIctory's counters as "copies / write-watch" (1.1–1.7 s per world frame).

A small server patch (below) keeps the list and adds an rb_tree keyed by view base. Views never overlap, so each lookup is a "highest base ≤ address" descent. I built wineserver alone from the exact source of the installed wine-cachyos 10.0-20260425 (protocol 865) and started it inside the sandbox before wine. Same VIctory build, same scene:

per world frame stock wineserver patched
frame time 3615 ms 1100 ms
copies / write-watch 1748 ms 73 ms
texture preparation 213 ms 37 ms
draws 2097 2808

The first loading screen now holds a steady 30 fps and loads much faster. I have not yet run Wine's own tests or an A/B against an unpatched build of the same tree, so treat it as a measurement, not a reviewed fix. It should help anything under Wine that maps many views; I'll take it to Wine after that.

How far it gets now

On d2a4bae + the stack from my earlier comments + #388, #452, #490 and VICTORY_SHADER_LOOP_LIMIT=256, it reaches the first prologue mission. The HUD shows "Approach a cellmate to interact with them". On a rebase onto 58fed37 with never-free it got as far as "Move around / Move camera". Pause, Settings, Controls and Retry checkpoint work, and the footsteps follow movement. It runs at 2–3 fps. The final image stays black (about 950 draws per frame are dropped for untranslated shaders), with occasional red flashes.

  • The bar-scene GPU hang was [mesh 04b9be3756e8f41c, pixel 1af4a50c7fb40c97] from #71, the pixel program's loops running to 2^20. RADV_DEBUG=hang stopped in that draw. Loop limit 32 removed the hang but the title then crashed on the CPU reading garbage pointers. 256 works.
  • For #557: HostHeap::mirror nulls a slot the title never rewrote once its view's resource is released, and lists recorded earlier then read null (VA 0 on vkd3d's descriptor-heap path). Keeping that slot and its resource until the title rewrites it removed the faults on the d2a4bae stack (6 min, VRAM steady ~13 GB). On a rebase onto 58fed37 the VA 0 fault came back, and never-free still avoids it there, so there is at least one more release path.
  • With #638's VICTORY_SHOW_TARGET=busiest the presented G-buffer showed tables and benches in the prison. The textures only appear in that diagnostic view. In the normal output every run so far has been black. The geometry is drawn; the lighting and composition passes are what's missing.
wineserver patch (against wine-cachyos 10.0-20260425; the two loops are unchanged on master, the patch itself is only tested on 10.0)
diff --git a/server/file.h b/server/file.h
index 7fb1301..3970660 100644
--- a/server/file.h
+++ b/server/file.h
@@ -193,6 +193,7 @@ extern struct file *get_view_file( const struct memory_view *view, unsigned int
 extern const struct pe_image_info *get_view_image_info( const struct memory_view *view, client_ptr_t *base );
 extern int get_view_nt_name( const struct memory_view *view, struct unicode_str *name );
 extern void free_mapped_views( struct process *process );
+extern void init_process_views( struct process *process );
 extern int get_page_size(void);
 extern struct mapping *create_fd_mapping( struct object *root, const struct unicode_str *name, struct fd *fd,
                                           unsigned int attr, const struct security_descriptor *sd );
diff --git a/server/mapping.c b/server/mapping.c
index 9d5f792..d1811f1 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -132,6 +132,8 @@ static struct list shared_map_list = LIST_INIT( shared_map_list );
 struct memory_view
 {
     struct list     entry;           /* entry in per-process view list */
+    struct rb_entry tree_entry;      /* entry in per-process view tree, by base */
+    int             in_tree;         /* tree_entry is in the process view tree */
     struct fd      *fd;              /* fd for mapped file */
     struct ranges  *committed;       /* list of committed ranges in this mapping */
     struct shared_map *shared;       /* temp file for shared PE mapping */
@@ -429,14 +431,46 @@ static int create_temp_file( file_pos_t size )
     return fd;
 }
 
+static int compare_view_base( const void *key, const struct rb_entry *entry )
+{
+    client_ptr_t base = *(const client_ptr_t *)key;
+    const struct memory_view *view = RB_ENTRY_VALUE( entry, const struct memory_view, tree_entry );
+
+    if (base < view->base) return -1;
+    if (base > view->base) return 1;
+    return 0;
+}
+
+void init_process_views( struct process *process )
+{
+    rb_init( &process->view_tree, compare_view_base );
+}
+
+/* find the view with the highest base address not above addr */
+static struct memory_view *find_view_below( struct process *process, client_ptr_t addr )
+{
+    struct rb_entry *entry = process->view_tree.root;
+    struct memory_view *view, *best = NULL;
+
+    while (entry)
+    {
+        view = RB_ENTRY_VALUE( entry, struct memory_view, tree_entry );
+        if (view->base <= addr)
+        {
+            best = view;
+            entry = entry->right;
+        }
+        else entry = entry->left;
+    }
+    return best;
+}
+
 /* find a memory view from its base address */
 struct memory_view *find_mapped_view( struct process *process, client_ptr_t base )
 {
-    struct memory_view *view;
-
-    LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry )
-        if (view->base == base) return view;
+    struct rb_entry *entry = rb_get( &process->view_tree, &base );
 
+    if (entry) return RB_ENTRY_VALUE( entry, struct memory_view, tree_entry );
     set_error( STATUS_NOT_MAPPED_VIEW );
     return NULL;
 }
@@ -446,8 +480,7 @@ static struct memory_view *find_mapped_addr( struct process *process, client_ptr
 {
     struct memory_view *view;
 
-    LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry )
-        if (addr >= view->base && addr < view->base + view->size) return view;
+    if ((view = find_view_below( process, addr )) && addr < view->base + view->size) return view;
 
     set_error( STATUS_NOT_MAPPED_VIEW );
     return NULL;
@@ -462,13 +495,10 @@ static int is_valid_view_addr( struct process *process, client_ptr_t addr, mem_s
     if (addr & page_mask) return 0;
     if (addr + size < addr) return 0;  /* overflow */
 
-    /* check for overlapping view */
-    LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry )
-    {
-        if (view->base + view->size <= addr) continue;
-        if (view->base >= addr + size) continue;
+    /* check for overlapping view: views never overlap, so only the one
+     * starting last before the end of the range can */
+    if ((view = find_view_below( process, addr + size - 1 )) && view->base + view->size > addr)
         return 0;
-    }
     return 1;
 }
 
@@ -507,15 +537,18 @@ static int add_process_view( struct thread *thread, struct memory_view *view )
                 process->imagelen = name.len;
             process->image_info = view->image;
             list_add_head( &process->views, &view->entry );
+            view->in_tree = !rb_put( &process->view_tree, &view->base, &view->tree_entry );
             return 1;
         }
     }
     list_add_tail( &process->views, &view->entry );
+    view->in_tree = !rb_put( &process->view_tree, &view->base, &view->tree_entry );
     return 0;
 }
 
-static void free_memory_view( struct memory_view *view )
+static void free_memory_view( struct process *process, struct memory_view *view )
 {
+    if (view->in_tree) rb_remove( &process->view_tree, &view->tree_entry );
     if (view->fd) release_object( view->fd );
     if (view->committed) release_object( view->committed );
     if (view->shared) release_object( view->shared );
@@ -529,7 +562,7 @@ void free_mapped_views( struct process *process )
     struct list *ptr;
 
     while ((ptr = list_head( &process->views )))
-        free_memory_view( LIST_ENTRY( ptr, struct memory_view, entry ));
+        free_memory_view( process, LIST_ENTRY( ptr, struct memory_view, entry ));
 }
 
 /* find the shared PE mapping for a given mapping */
@@ -1718,7 +1751,7 @@ DECL_HANDLER(unmap_view)
 
     if (!view) return;
     generate_dll_event( current, DbgUnloadDllStateChange, view );
-    free_memory_view( view );
+    free_memory_view( current->process, view );
 }
 
 /* get information about a mapped image view */
diff --git a/server/process.c b/server/process.c
index 7d62928..dd10e90 100644
--- a/server/process.c
+++ b/server/process.c
@@ -728,6 +728,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
     list_init( &process->asyncs );
     list_init( &process->classes );
     list_init( &process->views );
+    init_process_views( process );
 
     process->end_time = 0;
 
diff --git a/server/process.h b/server/process.h
index 0b4ba73..76ccef6 100644
--- a/server/process.h
+++ b/server/process.h
@@ -22,6 +22,7 @@
 #define __WINE_SERVER_PROCESS_H
 
 #include "object.h"
+#include "wine/rbtree.h"
 
 struct atom_table;
 struct handle_table;
@@ -75,6 +76,7 @@ struct process
     obj_handle_t         desktop;         /* handle to desktop to use for new threads */
     struct token        *token;           /* security token associated with this process */
     struct list          views;           /* list of memory views */
+    struct rb_tree       view_tree;       /* memory views by base address */
     client_ptr_t         peb;             /* PEB address in client address space */
     client_ptr_t         ldt_copy;        /* pointer to LDT copy in client addr space */
     struct dir_cache    *dir_cache;       /* map of client-side directory cache */
**@⁠ajsem1337** on GitHub · 2026-11-24 08:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7126653768) Update from the same RX 7900 GRE / RADV 26.3.1 box. The biggest change is in **Wine itself**, not VIctory. ## wineserver walks every mapped view on each map and unmap `perf` inside the sandbox put **37% of the title's CPU time in wineserver**, almost all of it in two loops in `server/mapping.c`: - `is_valid_view_addr()` (from `map_view`) - `find_mapped_view()` (from `unmap_view`) Both walk `process->views`, a plain list. The title's streaming and tiled memory keeps mapping and unmapping physical-page views, thousands of them, so each request walks all of them. This is the same in Wine 10.0, 11.0 and current master. It is the cost that showed up in VIctory's counters as "copies / write-watch" (1.1–1.7 s per world frame). A small server patch (below) keeps the list and adds an `rb_tree` keyed by view base. Views never overlap, so each lookup is a "highest base ≤ address" descent. I built `wineserver` alone from the exact source of the installed wine-cachyos 10.0-20260425 (protocol 865) and started it inside the sandbox before `wine`. Same VIctory build, same scene: | per world frame | stock wineserver | patched | |---|---|---| | frame time | 3615 ms | **1100 ms** | | copies / write-watch | 1748 ms | **73 ms** | | texture preparation | 213 ms | **37 ms** | | draws | 2097 | **2808** | The first loading screen now holds a steady 30 fps and loads much faster. I have not yet run Wine's own tests or an A/B against an unpatched build of the same tree, so treat it as a measurement, not a reviewed fix. It should help anything under Wine that maps many views; I'll take it to Wine after that. ## How far it gets now On `d2a4bae` + the stack from my earlier comments + #388, #452, #490 and `VICTORY_SHADER_LOOP_LIMIT=256`, it reaches the **first prologue mission**. The HUD shows "Approach a cellmate to interact with them". On a rebase onto `58fed37` with never-free it got as far as "Move around / Move camera". Pause, Settings, Controls and Retry checkpoint work, and the footsteps follow movement. It runs at 2–3 fps. The final image stays black (about 950 draws per frame are dropped for untranslated shaders), with occasional red flashes. - The bar-scene GPU hang was [mesh `04b9be3756e8f41c`, pixel `1af4a50c7fb40c97`] from #71, the pixel program's loops running to 2^20. `RADV_DEBUG=hang` stopped in that draw. Loop limit 32 removed the hang but the title then crashed on the CPU reading garbage pointers. 256 works. - For #557: `HostHeap::mirror` nulls a slot the title never rewrote once its view's resource is released, and lists recorded earlier then read null (VA 0 on vkd3d's descriptor-heap path). Keeping that slot and its resource until the title rewrites it removed the faults on the `d2a4bae` stack (6 min, VRAM steady ~13 GB). On a rebase onto `58fed37` the VA 0 fault came back, and never-free still avoids it there, so there is at least one more release path. - With #638's `VICTORY_SHOW_TARGET=busiest` the presented G-buffer showed tables and benches in the prison. The textures only appear in that diagnostic view. In the normal output every run so far has been black. The geometry is drawn; the lighting and composition passes are what's missing. <details><summary>wineserver patch (against wine-cachyos 10.0-20260425; the two loops are unchanged on master, the patch itself is only tested on 10.0)</summary> ```diff diff --git a/server/file.h b/server/file.h index 7fb1301..3970660 100644 --- a/server/file.h +++ b/server/file.h @@ -193,6 +193,7 @@ extern struct file *get_view_file( const struct memory_view *view, unsigned int extern const struct pe_image_info *get_view_image_info( const struct memory_view *view, client_ptr_t *base ); extern int get_view_nt_name( const struct memory_view *view, struct unicode_str *name ); extern void free_mapped_views( struct process *process ); +extern void init_process_views( struct process *process ); extern int get_page_size(void); extern struct mapping *create_fd_mapping( struct object *root, const struct unicode_str *name, struct fd *fd, unsigned int attr, const struct security_descriptor *sd ); diff --git a/server/mapping.c b/server/mapping.c index 9d5f792..d1811f1 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -132,6 +132,8 @@ static struct list shared_map_list = LIST_INIT( shared_map_list ); struct memory_view { struct list entry; /* entry in per-process view list */ + struct rb_entry tree_entry; /* entry in per-process view tree, by base */ + int in_tree; /* tree_entry is in the process view tree */ struct fd *fd; /* fd for mapped file */ struct ranges *committed; /* list of committed ranges in this mapping */ struct shared_map *shared; /* temp file for shared PE mapping */ @@ -429,14 +431,46 @@ static int create_temp_file( file_pos_t size ) return fd; } +static int compare_view_base( const void *key, const struct rb_entry *entry ) +{ + client_ptr_t base = *(const client_ptr_t *)key; + const struct memory_view *view = RB_ENTRY_VALUE( entry, const struct memory_view, tree_entry ); + + if (base < view->base) return -1; + if (base > view->base) return 1; + return 0; +} + +void init_process_views( struct process *process ) +{ + rb_init( &process->view_tree, compare_view_base ); +} + +/* find the view with the highest base address not above addr */ +static struct memory_view *find_view_below( struct process *process, client_ptr_t addr ) +{ + struct rb_entry *entry = process->view_tree.root; + struct memory_view *view, *best = NULL; + + while (entry) + { + view = RB_ENTRY_VALUE( entry, struct memory_view, tree_entry ); + if (view->base <= addr) + { + best = view; + entry = entry->right; + } + else entry = entry->left; + } + return best; +} + /* find a memory view from its base address */ struct memory_view *find_mapped_view( struct process *process, client_ptr_t base ) { - struct memory_view *view; - - LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry ) - if (view->base == base) return view; + struct rb_entry *entry = rb_get( &process->view_tree, &base ); + if (entry) return RB_ENTRY_VALUE( entry, struct memory_view, tree_entry ); set_error( STATUS_NOT_MAPPED_VIEW ); return NULL; } @@ -446,8 +480,7 @@ static struct memory_view *find_mapped_addr( struct process *process, client_ptr { struct memory_view *view; - LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry ) - if (addr >= view->base && addr < view->base + view->size) return view; + if ((view = find_view_below( process, addr )) && addr < view->base + view->size) return view; set_error( STATUS_NOT_MAPPED_VIEW ); return NULL; @@ -462,13 +495,10 @@ static int is_valid_view_addr( struct process *process, client_ptr_t addr, mem_s if (addr & page_mask) return 0; if (addr + size < addr) return 0; /* overflow */ - /* check for overlapping view */ - LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry ) - { - if (view->base + view->size <= addr) continue; - if (view->base >= addr + size) continue; + /* check for overlapping view: views never overlap, so only the one + * starting last before the end of the range can */ + if ((view = find_view_below( process, addr + size - 1 )) && view->base + view->size > addr) return 0; - } return 1; } @@ -507,15 +537,18 @@ static int add_process_view( struct thread *thread, struct memory_view *view ) process->imagelen = name.len; process->image_info = view->image; list_add_head( &process->views, &view->entry ); + view->in_tree = !rb_put( &process->view_tree, &view->base, &view->tree_entry ); return 1; } } list_add_tail( &process->views, &view->entry ); + view->in_tree = !rb_put( &process->view_tree, &view->base, &view->tree_entry ); return 0; } -static void free_memory_view( struct memory_view *view ) +static void free_memory_view( struct process *process, struct memory_view *view ) { + if (view->in_tree) rb_remove( &process->view_tree, &view->tree_entry ); if (view->fd) release_object( view->fd ); if (view->committed) release_object( view->committed ); if (view->shared) release_object( view->shared ); @@ -529,7 +562,7 @@ void free_mapped_views( struct process *process ) struct list *ptr; while ((ptr = list_head( &process->views ))) - free_memory_view( LIST_ENTRY( ptr, struct memory_view, entry )); + free_memory_view( process, LIST_ENTRY( ptr, struct memory_view, entry )); } /* find the shared PE mapping for a given mapping */ @@ -1718,7 +1751,7 @@ DECL_HANDLER(unmap_view) if (!view) return; generate_dll_event( current, DbgUnloadDllStateChange, view ); - free_memory_view( view ); + free_memory_view( current->process, view ); } /* get information about a mapped image view */ diff --git a/server/process.c b/server/process.c index 7d62928..dd10e90 100644 --- a/server/process.c +++ b/server/process.c @@ -728,6 +728,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla list_init( &process->asyncs ); list_init( &process->classes ); list_init( &process->views ); + init_process_views( process ); process->end_time = 0; diff --git a/server/process.h b/server/process.h index 0b4ba73..76ccef6 100644 --- a/server/process.h +++ b/server/process.h @@ -22,6 +22,7 @@ #define __WINE_SERVER_PROCESS_H #include "object.h" +#include "wine/rbtree.h" struct atom_table; struct handle_table; @@ -75,6 +76,7 @@ struct process obj_handle_t desktop; /* handle to desktop to use for new threads */ struct token *token; /* security token associated with this process */ struct list views; /* list of memory views */ + struct rb_tree view_tree; /* memory views by base address */ client_ptr_t peb; /* PEB address in client address space */ client_ptr_t ldt_copy; /* pointer to LDT copy in client addr space */ struct dir_cache *dir_cache; /* map of client-side directory cache */ ``` </details>
Author
Owner

@⁠desplmfao on GitHub · 2026-11-24 09:14 UTC · original · edited 2026-11-24 10:42 UTC

Confirming the wineserver view-tree patch from this comment on different hardware and a newer Wine: RTX 5080, CachyOS, proton-cachyos 11.0-20260703.

I ported the patch to wine-cachyos tag cachyos-11.0-20260702-proton-native (protocol 932). The four files and the logic are the same; only the line offsets differ, and is_valid_view_addr() there uses host_page_mask. I built server/wineserver alone and ran it from a copy of the Proton folder. Proton ignores WINESERVER, and ntdll finds the server next to the real path of ntdll.so, so files/bin/wine, files/bin/wineserver, and ntdll.so and wine-preloader under files/lib/wine/x86_64-unix/ have to be real files in that copy.

Same VIctory binary and warm pipeline cache, only the server swapped. The build is Marvisak#185 (including the shared write-watch spans from aycow/VIctory#2) merged with current main as in aycow/VIctory#4, plus #493, #259, #177, #151 and #178 (with VICTORY_DXC). This first table is without the view-lookup cache from aycow/VIctory#3 and without a shader loop limit; both are in the update below. Medians over the first 8 world summary lines:

per world frame stock wineserver patched
frame time 4,000 ms 983 ms
submission preparation 3,803 ms 730 ms
of which copies 3,673 ms 614 ms
direct SRV preparation 3,169 ms 557 ms
write-watch 46 ms 19 ms
textures 14 ms 14 ms
on the GPU 133 ms 169 ms
draws per frame 2,371 1,864
dropped without a host pipeline 1,715 1,114

At about 1 fps the intro's credits and the distant city lights are visible over a black world, matching your description: UI and emissive light points come through, the lit geometry doesn't. About 4 minutes into the world the patched run hit an NVIDIA Xid 109 (CTX SWITCH TIMEOUT), and the title's +0x23cf683 followed about 25 s later. I don't think the server change causes that, but I can't rule it out from one run. With #178 indirect draws run for the first time, and at 4× the speed the run also reaches further. The stock-server run of the same build didn't get that far.

image image

AI-assisted (Claude Code).

Update: two more runs of the same stack with the patched server and VICTORY_SHADER_LOOP_LIMIT=256, in one binary where aycow/VIctory#3 (cached view lookups) can be switched off. Medians over all world lines of each run:

per world frame stock server patched patched + loop limit patched + loop limit + aycow/VIctory#3
frame time 4,000 ms 983 ms 817 ms (54 lines) 750 ms (14 lines)
fastest / slowest line – – 411 / 1,667 ms 389 / 1,967 ms
view lookups – – 359,624, 46 ms 76,508, 26 ms

Most of the gain is the server patch (about 4×). The loop limit and aycow/VIctory#3 come on top, but the two loop-limit runs were in different scenes (the run without aycow/VIctory#3 spent most of its time in light scenes), so I can't split those last 70 ms between them from one run each. What aycow/VIctory#3 measurably saves with the patched server is about 20 ms of lookups per frame; with the stock server it was 2.3 s → 0.9 s. In these runs the final picture showed lit geometry for the first time here: power lines, poles, traffic-light gantries and road signs under fog and depth of field, with no ground or buildings. The Xid 109 hang came in the patched run and in the run with aycow/VIctory#3, so it isn't aycow/VIctory#3. More on the hang below.

The Xid 109 hang, same machine and stack (with VICTORY_SHADER_LOOP_LIMIT=256). I tried your bar-scene pair with VICTORY_SKIP_PIPELINES, which drops every pipeline containing the shader:

change time in the world hang
none (8 runs) 4 hung within 10 s – 2 min; 4 ran 3–6 min clean 4 of 8
skip mesh 04b9be3756e8f41c + pixel 1af4a50c7fb40c97 7.5 min no
skip mesh only 6 min, reached the first prologue mission no
skip pixel only 16 s yes
per-lane loop budget instead of per-loop counts, no skip 31 s yes
Marvisak/VIctory#542 (raw buffer offsets kept below 2 GiB), no skip (2 runs) 3.5 and 3.75 min until I closed them, first prologue mission reached no

In my logs 04b9be3756e8f41c only appears with 1af4a50c7fb40c97, so the pixel-only skip dropped a superset of the mesh-only skip, and it still hung. The mesh shader is straight-line code offline. The pixel shader has a three-level clustered-light loop nest, and a per-loop limit multiplies across it (256 allows about 2M iterations per pixel, which may be why 32 helped you). But bounding the whole nest per lane didn't stop the hang either. So on NVIDIA I don't think this hang comes from that pair or from long loops. VKD3D_CONFIG=breadcrumbs gave no dump (the title's check ends the process before vkd3d-proton reports the device lost). Without a skip, about half the runs hung, so the skip runs that stayed clean (the 7.5-minute and 6-minute rows) prove little either. With #542's code on top (#493 still in), 2 of 2 runs reached the first prologue mission and stayed there for 3.5 and 3.75 minutes without a fault. That's encouraging, not yet proof.

With the mesh shader skipped, the run reached "Approach a cellmate to interact with them" at about 2 fps (500–670 ms/frame, 3,000–4,000 draws/frame), with working input and a black picture apart from the HUD.

**@⁠desplmfao** on GitHub · 2026-11-24 09:14 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7127133208) · edited 2026-11-24 10:42 UTC Confirming the `wineserver` view-tree patch from [this comment](https://git.gtahub.st/github/Marvisak--VIctory/issues/340) on different hardware and a newer Wine: RTX 5080, CachyOS, proton-cachyos 11.0-20260703. I ported the patch to `wine-cachyos` tag `cachyos-11.0-20260702-proton-native` (protocol 932). The four files and the logic are the same; only the line offsets differ, and `is_valid_view_addr()` there uses `host_page_mask`. I built `server/wineserver` alone and ran it from a copy of the Proton folder. Proton ignores `WINESERVER`, and ntdll finds the server next to the real path of `ntdll.so`, so `files/bin/wine`, `files/bin/wineserver`, and `ntdll.so` and `wine-preloader` under `files/lib/wine/x86_64-unix/` have to be real files in that copy. Same VIctory binary and warm pipeline cache, only the server swapped. The build is Marvisak#185 (including the shared write-watch spans from aycow/VIctory#2) merged with current `main` as in aycow/VIctory#4, plus #493, #259, #177, #151 and #178 (with `VICTORY_DXC`). This first table is without the view-lookup cache from aycow/VIctory#3 and without a shader loop limit; both are in the update below. Medians over the first 8 world summary lines: | per world frame | stock wineserver | patched | |---|---:|---:| | frame time | 4,000 ms | **983 ms** | | submission preparation | 3,803 ms | 730 ms | | of which copies | 3,673 ms | 614 ms | | direct SRV preparation | 3,169 ms | 557 ms | | write-watch | 46 ms | 19 ms | | textures | 14 ms | 14 ms | | on the GPU | 133 ms | 169 ms | | draws per frame | 2,371 | 1,864 | | dropped without a host pipeline | 1,715 | 1,114 | At about 1 fps the intro's credits and the distant city lights are visible over a black world, matching your description: UI and emissive light points come through, the lit geometry doesn't. About 4 minutes into the world the patched run hit an NVIDIA `Xid 109` (CTX SWITCH TIMEOUT), and the title's `+0x23cf683` followed about 25 s later. I don't think the server change causes that, but I can't rule it out from one run. With #178 indirect draws run for the first time, and at 4× the speed the run also reaches further. The stock-server run of the same build didn't get that far. <img width="2477" height="1367" alt="image" src="https://github.com/user-attachments/assets/05afd00b-7f34-4a63-b671-8e7282b19c5f" /> <img width="2492" height="1342" alt="image" src="https://github.com/user-attachments/assets/8a8ab3c4-29f7-4092-9a50-1780bdcbfb95" /> AI-assisted (Claude Code). **Update:** two more runs of the same stack with the patched server and `VICTORY_SHADER_LOOP_LIMIT=256`, in one binary where [aycow/VIctory#3](https://github.com/aycow/VIctory/pull/3) (cached view lookups) can be switched off. Medians over all world lines of each run: | per world frame | stock server | patched | patched + loop limit | patched + loop limit + aycow/VIctory#3 | |---|---:|---:|---:|---:| | frame time | 4,000 ms | 983 ms | 817 ms (54 lines) | 750 ms (14 lines) | | fastest / slowest line | – | – | 411 / 1,667 ms | 389 / 1,967 ms | | view lookups | – | – | 359,624, 46 ms | 76,508, 26 ms | Most of the gain is the server patch (about 4×). The loop limit and aycow/VIctory#3 come on top, but the two loop-limit runs were in different scenes (the run without aycow/VIctory#3 spent most of its time in light scenes), so I can't split those last 70 ms between them from one run each. What aycow/VIctory#3 measurably saves with the patched server is about 20 ms of lookups per frame; with the stock server it was 2.3 s → 0.9 s. In these runs the final picture showed lit geometry for the first time here: power lines, poles, traffic-light gantries and road signs under fog and depth of field, with no ground or buildings. The `Xid 109` hang came in the patched run and in the run with aycow/VIctory#3, so it isn't aycow/VIctory#3. More on the hang below. **The `Xid 109` hang**, same machine and stack (with `VICTORY_SHADER_LOOP_LIMIT=256`). I tried your bar-scene pair with `VICTORY_SKIP_PIPELINES`, which drops every pipeline containing the shader: | change | time in the world | hang | |---|---:|---| | none (8 runs) | 4 hung within 10 s – 2 min; 4 ran 3–6 min clean | 4 of 8 | | skip mesh `04b9be3756e8f41c` + pixel `1af4a50c7fb40c97` | 7.5 min | no | | skip mesh only | 6 min, reached the first prologue mission | no | | skip pixel only | 16 s | yes | | per-lane loop budget instead of per-loop counts, no skip | 31 s | yes | | Marvisak/VIctory#542 (raw buffer offsets kept below 2 GiB), no skip (2 runs) | 3.5 and 3.75 min until I closed them, first prologue mission reached | no | In my logs `04b9be3756e8f41c` only appears with `1af4a50c7fb40c97`, so the pixel-only skip dropped a superset of the mesh-only skip, and it still hung. The mesh shader is straight-line code offline. The pixel shader has a three-level clustered-light loop nest, and a per-loop limit multiplies across it (256 allows about 2M iterations per pixel, which may be why 32 helped you). But bounding the whole nest per lane didn't stop the hang either. So on NVIDIA I don't think this hang comes from that pair or from long loops. `VKD3D_CONFIG=breadcrumbs` gave no dump (the title's check ends the process before vkd3d-proton reports the device lost). Without a skip, about half the runs hung, so the skip runs that stayed clean (the 7.5-minute and 6-minute rows) prove little either. With #542's code on top (#493 still in), 2 of 2 runs reached the first prologue mission and stayed there for 3.5 and 3.75 minutes without a fault. That's encouraging, not yet proof. With the mesh shader skipped, the run reached "Approach a cellmate to interact with them" at about 2 fps (500–670 ms/frame, 3,000–4,000 draws/frame), with working input and a black picture apart from the HUD.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 11:25 UTC · original

A note for the Linux/Wine recipe in this thread, from trying to reproduce the working stack on current main@ffe310e (git clone, no game data, git apply --check on each PR as posted):

PR on ffe310e today
#259 applies clean
#177 applies clean (and its suite is green, see the PR)
#151 applies clean
#178 applies clean
#185 conflicts: crates/victory-gpu/src/descriptor.rs:85 and descriptor/host.rs:20
#493 conflicts: descriptor/host.rs:17 and draw.rs:77

So the six-PR configuration that produced the first street frame cannot be rebuilt from current main right now: five of the six were based on d2a4bae (only #177 is on ffe310e), and the two descriptor PRs have since drifted. Anyone following this thread will hit that, on Linux or Windows alike.

Two things that would make the recipe usable:

  1. A rebase of #185 and #493 onto current main (they are the two that no longer apply; the other four are fine).
  2. Saying which of the six are required for the frame — if, say, #151 (thread stack) and #259 (level count) are not, the recipe shrinks to four that apply cleanly today.

For the record, on this box (Windows 11 10.0.26300, RTX 5090, driver 621.24, Rust 1.98.1) plain main@ffe310e is 342 passed / 0 failed / 6 ignored, and with #177 it is 343/0/6, so the stack's shader fix at least is not what breaks the build.

**@⁠dcastell1** on GitHub · 2026-11-24 11:25 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7130074873) A note for the Linux/Wine recipe in this thread, from trying to reproduce the working stack on current `main@ffe310e` (git clone, no game data, `git apply --check` on each PR as posted): | PR | on `ffe310e` today | |---|---| | **#259** | applies clean | | **#177** | applies clean (and its suite is green, see the PR) | | **#151** | applies clean | | **#178** | applies clean | | **#185** | **conflicts**: `crates/victory-gpu/src/descriptor.rs:85` and `descriptor/host.rs:20` | | **#493** | **conflicts**: `descriptor/host.rs:17` and `draw.rs:77` | So the six-PR configuration that produced the first street frame cannot be rebuilt from current main right now: five of the six were based on `d2a4bae` (only #177 is on `ffe310e`), and the two descriptor PRs have since drifted. Anyone following this thread will hit that, on Linux or Windows alike. Two things that would make the recipe usable: 1. A rebase of **#185** and **#493** onto current main (they are the two that no longer apply; the other four are fine). 2. Saying which of the six are *required* for the frame — if, say, #151 (thread stack) and #259 (level count) are not, the recipe shrinks to four that apply cleanly today. For the record, on this box (Windows 11 10.0.26300, RTX 5090, driver 621.24, Rust 1.98.1) plain `main@ffe310e` is 342 passed / 0 failed / 6 ignored, and with #177 it is 343/0/6, so the stack's shader fix at least is not what breaks the build.
Author
Owner

@⁠desplmfao on GitHub · 2026-11-24 11:39 UTC · original

@⁠dcastell1 For #185, aycow/VIctory#4 merges it with current main (ffe310e) and resolves the conflicts you hit: descriptor.rs, draw.rs, host.rs and watch.rs, plus a few tests whose calls main changed under them. The branch is desplmfao/VIctory:fix/185-merge-main (head 4740e19). It merges into main@ffe310e with no conflicts, and #493 merges on top of it with no conflicts too. The resolutions are listed in the PR description and comments. On that branch, victory-gpu has 92 tests passing and victory-shader 110. The ones that fail here are environment issues under Wine, and they fail the same way without the merge.

That is also what my runs above used: #4 + #493 + #259, #177, #151, #178 (later also #489, #542, #638 and aycow/VIctory#3). I haven't tested which of the six are strictly required for the first frame.

AI-assisted (Claude Code).

**@⁠desplmfao** on GitHub · 2026-11-24 11:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7130388230) @⁠dcastell1 For #185, aycow/VIctory#4 merges it with current `main` (`ffe310e`) and resolves the conflicts you hit: `descriptor.rs`, `draw.rs`, `host.rs` and `watch.rs`, plus a few tests whose calls `main` changed under them. The branch is `desplmfao/VIctory:fix/185-merge-main` (head `4740e19`). It merges into `main@ffe310e` with no conflicts, and #493 merges on top of it with no conflicts too. The resolutions are listed in the PR description and comments. On that branch, `victory-gpu` has 92 tests passing and `victory-shader` 110. The ones that fail here are environment issues under Wine, and they fail the same way without the merge. That is also what my runs above used: #4 + #493 + #259, #177, #151, #178 (later also #489, #542, #638 and aycow/VIctory#3). I haven't tested which of the six are strictly required for the first frame. AI-assisted (Claude Code).
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 13:13 UTC · original

Windows 11 + RTX 5090 datapoint, in case it helps the "which stack, which wall" picture. Counts and screen labels only.

  • Machine: Windows 11 10.0.26300, NVIDIA RTX 5090 (32 GB), driver 621.24, 64 GB RAM, no controller attached.
  • Build: 4740e19 (the #185 merge into ffe310e, aycow/VIctory#4) plus MIN_DYNAMIC = 1 << 18 from #747, cargo build --profile diag -p victory --features diagnostics, Rust 1.98.1, MSVC 14.44.35207. cargo test --workspace on 4740e19: 384 passed, 0 failed, 9 ignored.
  • Run: victory.exe run <pkg>\game_scarlett_master.exe --execute with VICTORY_CAPTURE, VICTORY_DUMP_TARGETS=1, VICTORY_GPU_TIMING=1, VICTORY_SHADER_LOOP_LIMIT=32, VICTORY_D3D12_DRED=1.

Result: the title presents at 30.0 fps / 33.3 ms/frame from the start, 5.8-6.5 GB working set, 13-66 draws/frame depending on the screen, and walks the first-run screens on its own: accessibility → player selector → legal/copyright → legal consent (both read back from the captured frames with Windows OCR, so they are identified, not guessed). frame-512 of one run had 188,818 distinct colours, so the content is real.

Where it stops: the legal consent page. The window can hold the foreground, and Down held for 8 s scrolls the notice and moves the selection (so the keyboard device is consumed), but neither VICTORY_KEYS Enter (4 s cadence, 15-300 s, plus 20 Downs) nor native SendInput (1.5 s and 3 s holds) activates Confirmar. Forcing the stand-in pad to exist unconditionally (gameinput.rs:461) changes nothing, so on this title the pad path is not what the UI reads for accept; that half is in #197.

Note on captures: VICTORY_CAPTURE needs the diag profile (the release build has no diagnostics feature and writes no frames), and with the monitor off a GDI window capture comes back black — the in-process frames are the ones that carry content.

**@⁠dcastell1** on GitHub · 2026-11-24 13:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7132518222) **Windows 11 + RTX 5090 datapoint**, in case it helps the "which stack, which wall" picture. Counts and screen labels only. - **Machine:** Windows 11 10.0.26300, NVIDIA RTX 5090 (32 GB), driver 621.24, 64 GB RAM, no controller attached. - **Build:** `4740e19` (the #185 merge into `ffe310e`, aycow/VIctory#4) **plus `MIN_DYNAMIC = 1 << 18` from #747**, `cargo build --profile diag -p victory --features diagnostics`, Rust 1.98.1, MSVC 14.44.35207. `cargo test --workspace` on `4740e19`: **384 passed, 0 failed, 9 ignored**. - **Run:** `victory.exe run <pkg>\game_scarlett_master.exe --execute` with `VICTORY_CAPTURE`, `VICTORY_DUMP_TARGETS=1`, `VICTORY_GPU_TIMING=1`, `VICTORY_SHADER_LOOP_LIMIT=32`, `VICTORY_D3D12_DRED=1`. **Result:** the title presents at **30.0 fps / 33.3 ms/frame** from the start, 5.8-6.5 GB working set, **13-66 draws/frame** depending on the screen, and walks the first-run screens on its own: accessibility → **player selector** → **legal/copyright** → **legal consent** (both read back from the captured frames with Windows OCR, so they are identified, not guessed). `frame-512` of one run had **188,818 distinct colours**, so the content is real. **Where it stops:** the legal consent page. The window can hold the foreground, and `Down` held for 8 s **scrolls the notice and moves the selection** (so the keyboard device is consumed), but neither `VICTORY_KEYS` Enter (4 s cadence, 15-300 s, plus 20 Downs) nor native `SendInput` (1.5 s and 3 s holds) activates `Confirmar`. Forcing the stand-in pad to exist unconditionally (`gameinput.rs:461`) changes nothing, so on this title the pad path is not what the UI reads for accept; that half is in #197. **Note on captures:** `VICTORY_CAPTURE` needs the `diag` profile (the release build has no `diagnostics` feature and writes no frames), and with the monitor off a GDI window capture comes back black — the in-process frames are the ones that carry content.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 13:31 UTC · original

For the fix/185-merge-main branch (4740e19, desplmfao): cargo clippy --workspace --all-targets --locked -- -D warnings fails on it, so CI would not let it in as it stands.

error: very complex type used. Consider factoring parts into `type` definitions
  --> crates\victory-gpu\src\host.rs:1385:24
error: very complex type used. Consider factoring parts into `type` definitions
  --> crates\victory-gpu\src\host.rs:1493:22
error: could not compile `victory-gpu` (lib) due to 2 previous errors

host.rs:1385 is fn refresh_across(per: &[(Arc<crate::shadow::Shadow>, Vec<(usize, usize)>)]), and :1493 builds the same Vec<(Arc<Shadow>, Vec<(usize, usize)>)>. A type RefreshRows = Vec<(usize, usize)>; (or a small struct) used on both sides clears it; #[allow(clippy::type_complexity)] would too, but the alias reads better. Both lines are new relative to ffe310e, so this is not pre-existing.

Everything else on the branch is green here: cargo test --workspace gives 384 passed, 0 failed, 9 ignored on Windows 11 10.0.26300, RTX 5090, Rust 1.98.1, MSVC 14.44.35207.

AI-assisted (opencode): ran clippy and the suite on the merge branch on this box.

**@⁠dcastell1** on GitHub · 2026-11-24 13:31 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7132961565) For the `fix/185-merge-main` branch (`4740e19`, desplmfao): **`cargo clippy --workspace --all-targets --locked -- -D warnings` fails on it**, so CI would not let it in as it stands. ``` error: very complex type used. Consider factoring parts into `type` definitions --> crates\victory-gpu\src\host.rs:1385:24 error: very complex type used. Consider factoring parts into `type` definitions --> crates\victory-gpu\src\host.rs:1493:22 error: could not compile `victory-gpu` (lib) due to 2 previous errors ``` `host.rs:1385` is `fn refresh_across(per: &[(Arc<crate::shadow::Shadow>, Vec<(usize, usize)>)])`, and `:1493` builds the same `Vec<(Arc<Shadow>, Vec<(usize, usize)>)>`. A `type RefreshRows = Vec<(usize, usize)>;` (or a small struct) used on both sides clears it; `#[allow(clippy::type_complexity)]` would too, but the alias reads better. Both lines are new relative to `ffe310e`, so this is not pre-existing. Everything else on the branch is green here: `cargo test --workspace` gives **384 passed, 0 failed, 9 ignored** on Windows 11 10.0.26300, RTX 5090, Rust 1.98.1, MSVC 14.44.35207. AI-assisted (opencode): ran clippy and the suite on the merge branch on this box.
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-24 15:45 UTC · original

RTX 5090 + Wine 11.22: prologue reached; patched wineserver ~5.5× faster per world frame; NVIDIA hang (Xid 109) did not occur with submissions serialized

Setup

  • Arch Linux, kernel 7.3.5-zen, Ryzen 9 9950X3D, 64 GB RAM. RTX 5090 (NVIDIA 620.73.04), plus an RX 7600 (RADV, Mesa 26.3.1) with no monitor attached.
  • System Wine 11.22. vkd3d-proton v3.1-83-gcae8353ed and DXVK dxgi.dll, both from GE-Proton11-14, in a dedicated prefix. WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n".
  • Headless gamescope 3.17. Frames come from the diagnostics build (VICTORY_CAPTURE), and input from VICTORY_KEYS.
  • VIctory: main@ffe310e plus #190, #217, #347, #322, #454, #493, #579, #177, #259 and #542, merged locally (0f70ec9). Two small local fixes on top:
    • the #542 test called resource::track with the old signature;
    • stub_pipeline_is_created skips its hash-refusal half under Wine.
  • Windows MSVC diagnostics build, cross-compiled on Linux with xwin, clang-cl and lld-link. Rust 1.98.1.

Test suite under Wine

The Windows test binaries, cross-built and run under Wine with the same vkd3d-proton:

GPU Passed Failed Ignored
RX 7600 343 0 6
RTX 5090 343 0 6

Each GPU was isolated with VK_DRIVER_FILES.

Setup notes

  • Wine's builtin dxgi crashes in wined3d on the first present with vkd3d-proton; DXVK's dxgi.dll is required.
  • With VK_DRIVER_FILES restricted to one GPU, DXVK reported "No adapters found" until DXVK_FILTER_DEVICE_NAME was set.
  • With Proton 11.0's vkd3d-proton, the first world pipeline (mesh d4111a6e6ea49d91, pixel c0a7fe77b1862e10) crashes in vkCreateGraphicsPipelines. The log shows "dxil-spirv: Failed to find a common merge point" just before the crash. GE-Proton11-14's build fixes it, matching #752.
  • Without #259, the 5090 crashed two seconds after boot inside vkCreateComputePipelines, as in #144. With #177, #259 and #542, no pipeline creation crashed.

Results on the RTX 5090

Settings for the runs below: VICTORY_NO_WATCHDOG=1, VICTORY_SHADER_LOOP_LIMIT=256, VICTORY_SKIP_PIPELINES=04b9be3756e8f41c.

Run GPU timing wineserver Ended at How it ended
nv-2 off stock about 2.5 min, frame ~1595 Xid 109 CTX SWITCH TIMEOUT (nv-2 ran without the loop limit and the skip)
nv-3 off stock about 4 min, frame 1631 Xid 109 CTX SWITCH TIMEOUT
nv-4 on stock 9 min, frame ~1875 the title's own breakpoint 0x80000003 at +0x63966f; no Xid
nv-5 on patched 10 min (timeout), frame ~2993 no Xid; reached PROLOGUE with the "Move around / Move the camera" hint

What this shows:

  • NVIDIA hang (hypothesis): both Xid 109 hangs happened with overlapping submissions. Neither run with VICTORY_GPU_TIMING=1 (each list submitted alone and waited for) hung. In nv-2 and nv-3 the shaders first bound just before the hang had nothing in common, which points at overlapping work rather than one shader. That is two runs each way, so it is not proven yet.
  • Rendering: UI, credits and title cards render; the 3D world stays black. About 435 to 1,686 draws per frame are dropped because their pipelines don't translate, plus about 880 to 1,590 indirect draws per frame.

wineserver view-tree patch, in the game

This is a cleaned-up version of the patch in this thread, rebased on Wine 11.22. The views stay in a list, and a red-black tree keyed by base address handles find_mapped_view, find_mapped_addr and is_valid_view_addr. Only wineserver was swapped between nv-4 and nv-5; everything else was identical. Medians of VIctory's frame summary lines, grouped by time since the game started:

Seconds in ms/frame (stock) ms/frame (patched) copies ms (stock) copies ms (patched) textures ms (stock) textures ms (patched)
0–180 1026 308 723 65 46 11
180–300 2767 220 2300 64 209 15
300–420 1067 275 627 85 55 15
420–600 2916 333 1884 95 213 10
  • Whole run: median 1617 ms/frame stock against 292 ms/frame patched. The patched run also issued more draws per frame.
  • wineserver CPU: about 80% of a core stock, against 9 s in 8 minutes patched.
  • Caveat: the summary line's copies ms counts some refresh flushes twice: Step::Copy adds a flush's time that Batch::flush already added (host.rs:1171, 1179, 1226). Both runs share this, so the ratio holds, but the absolute copies figures are too high.

Microbenchmark: a MapViewOfFile/UnmapViewOfFile pair, with N other views kept mapped (20,000 pairs per row):

N views kept mapped Stock µs per pair Patched µs per pair Stock wineserver CPU Patched wineserver CPU
0 8.6 7.6 70 ms 50 ms
5,000 17.7 8.3 270 ms 80 ms
20,000 67.2 7.8 1,520 ms 120 ms
50,000 155.0 8.0 4,850 ms 220 ms

Wine's ntdll:virtual, ntdll:info, kernel32:virtual, kernel32:loader and kernelbase:process tests pass with the patch. ntdll:exception and kernel32:process fail identically with the unpatched server.

wineserver patch (Wine 11.22, git am-able; tests above run with it)
From 51bbcd262a3fda22e636986dc66fd96d161db458 Mon Sep 17 00:00:00 2001
From: neonbyte1 <[email protected]>
Date: Tue, 24 Nov 2026 15:32:06 +0100
Subject: [PATCH] server: Keep memory views in a tree by base address.

find_mapped_view(), find_mapped_addr() and is_valid_view_addr() walked
the whole per-process view list, so every map_view, map_image_view,
map_builtin_view and unmap_view request was linear in the number of
views. Applications that keep tens of thousands of views mapped spend
most of their time in the server.

Keep the list, which still orders the main exe first and drives
cleanup, and add an rb tree keyed by base address. Views never
overlap, so each lookup is a search for the highest base not above an
address.

With 50000 resident views, a MapViewOfFile/UnmapViewOfFile pair goes
from 155 us to 8 us, and the server's CPU time for 20000 pairs from
4.85 s to 0.22 s.
---
 server/file.h    |  1 +
 server/mapping.c | 70 +++++++++++++++++++++++++++++++++++-------------
 server/process.c |  2 +-
 server/process.h |  4 ++-
 4 files changed, 56 insertions(+), 21 deletions(-)

diff --git a/server/file.h b/server/file.h
index 99215b8..32fd977 100644
--- a/server/file.h
+++ b/server/file.h
@@ -179,6 +179,7 @@ extern struct memory_view *get_exe_view( struct process *process );
 extern struct file *get_view_file( const struct memory_view *view, unsigned int access, unsigned int sharing );
 extern const struct pe_image_info *get_view_image_info( const struct memory_view *view, client_ptr_t *base );
 extern int get_view_nt_name( const struct memory_view *view, struct unicode_str *name );
+extern void init_process_views( struct process *process );
 extern void free_mapped_views( struct process *process );
 extern size_t get_page_size(void);
 extern struct mapping *create_fd_mapping( struct object *root, struct unicode_str name, struct fd *fd,
diff --git a/server/mapping.c b/server/mapping.c
index d1b0fc3..9bc2fbf 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -98,6 +98,7 @@ static struct list shared_map_list = LIST_INIT( shared_map_list );
 struct memory_view
 {
     struct list     entry;           /* entry in per-process view list */
+    struct rb_entry tree_entry;      /* entry in per-process view tree, by base */
     struct fd      *fd;              /* fd for mapped file */
     struct ranges  *committed;       /* list of committed ranges in this mapping */
     struct shared_map *shared;       /* temp file for shared PE mapping */
@@ -384,14 +385,48 @@ static int create_temp_file( file_pos_t size )
     return fd;
 }
 
+static int compare_view_base( const void *key, const struct rb_entry *entry )
+{
+    client_ptr_t base = *(const client_ptr_t *)key;
+    const struct memory_view *view = RB_ENTRY_VALUE( entry, const struct memory_view, tree_entry );
+
+    if (base < view->base) return -1;
+    if (base > view->base) return 1;
+    return 0;
+}
+
+/* initialize the view list and tree of a new process */
+void init_process_views( struct process *process )
+{
+    list_init( &process->views );
+    rb_init( &process->view_tree, compare_view_base );
+}
+
+/* find the view with the highest base address not above addr */
+static struct memory_view *find_view_below( struct process *process, client_ptr_t addr )
+{
+    struct rb_entry *entry = process->view_tree.root;
+    struct memory_view *view, *found = NULL;
+
+    while (entry)
+    {
+        view = RB_ENTRY_VALUE( entry, struct memory_view, tree_entry );
+        if (view->base <= addr)
+        {
+            found = view;
+            entry = entry->right;
+        }
+        else entry = entry->left;
+    }
+    return found;
+}
+
 /* find a memory view from its base address */
 struct memory_view *find_mapped_view( struct process *process, client_ptr_t base )
 {
-    struct memory_view *view;
-
-    LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry )
-        if (view->base == base) return view;
+    struct rb_entry *entry = rb_get( &process->view_tree, &base );
 
+    if (entry) return RB_ENTRY_VALUE( entry, struct memory_view, tree_entry );
     set_error( STATUS_NOT_MAPPED_VIEW );
     return NULL;
 }
@@ -399,11 +434,9 @@ struct memory_view *find_mapped_view( struct process *process, client_ptr_t base
 /* find a memory view from any address inside it */
 static struct memory_view *find_mapped_addr( struct process *process, client_ptr_t addr )
 {
-    struct memory_view *view;
-
-    LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry )
-        if (addr >= view->base && addr < view->base + view->size) return view;
+    struct memory_view *view = find_view_below( process, addr );
 
+    if (view && addr < view->base + view->size) return view;
     set_error( STATUS_NOT_MAPPED_VIEW );
     return NULL;
 }
@@ -417,14 +450,10 @@ static int is_valid_view_addr( struct process *process, client_ptr_t addr, mem_s
     if (addr & (process->page_size - 1)) return 0;
     if (addr + size < addr) return 0;  /* overflow */
 
-    /* check for overlapping view */
-    LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry )
-    {
-        if (view->base + view->size <= addr) continue;
-        if (view->base >= addr + size) continue;
-        return 0;
-    }
-    return 1;
+    /* views don't overlap, so only the last one starting inside the range
+     * or before it can overlap it */
+    view = find_view_below( process, addr + size - 1 );
+    return !view || view->base + view->size <= addr;
 }
 
 /* get the main exe memory view */
@@ -462,19 +491,22 @@ static int add_process_view( struct thread *thread, struct memory_view *view )
                 process->imagelen = name.len;
             process->image_info = view->image;
             list_add_head( &process->views, &view->entry );
+            rb_put( &process->view_tree, &view->base, &view->tree_entry );
             return 1;
         }
     }
     list_add_tail( &process->views, &view->entry );
+    rb_put( &process->view_tree, &view->base, &view->tree_entry );
     return 0;
 }
 
-static void free_memory_view( struct memory_view *view )
+static void free_memory_view( struct process *process, struct memory_view *view )
 {
     if (view->fd) release_object( view->fd );
     if (view->committed) release_object( view->committed );
     if (view->shared) release_object( view->shared );
     list_remove( &view->entry );
+    rb_remove( &process->view_tree, &view->tree_entry );
     free( view );
 }
 
@@ -484,7 +516,7 @@ void free_mapped_views( struct process *process )
     struct list *ptr;
 
     while ((ptr = list_head( &process->views )))
-        free_memory_view( LIST_ENTRY( ptr, struct memory_view, entry ));
+        free_memory_view( process, LIST_ENTRY( ptr, struct memory_view, entry ));
 }
 
 /* find the shared PE mapping for a given mapping */
@@ -1797,7 +1829,7 @@ DECL_HANDLER(unmap_view)
 
     if (!view) return;
     generate_dll_event( current, DbgUnloadDllStateChange, view );
-    free_memory_view( view );
+    free_memory_view( current->process, view );
 }
 
 /* get information about a mapped image view */
diff --git a/server/process.c b/server/process.c
index 510faf1..7fb1e4e 100644
--- a/server/process.c
+++ b/server/process.c
@@ -647,7 +647,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
     list_init( &process->locks );
     list_init( &process->asyncs );
     list_init( &process->classes );
-    list_init( &process->views );
+    init_process_views( process );
 
     process->end_time = 0;
 
diff --git a/server/process.h b/server/process.h
index dff766d..9e40fe4 100644
--- a/server/process.h
+++ b/server/process.h
@@ -22,6 +22,7 @@
 #define __WINE_SERVER_PROCESS_H
 
 #include "object.h"
+#include "wine/rbtree.h"
 
 struct atom_table;
 struct handle_table;
@@ -79,7 +80,8 @@ struct process
     obj_handle_t         winstation;      /* main handle to process window station */
     obj_handle_t         desktop;         /* handle to desktop to use for new threads */
     struct token        *token;           /* security token associated with this process */
-    struct list          views;           /* list of memory views */
+    struct list          views;           /* list of memory views, main exe first */
+    struct rb_tree       view_tree;       /* memory views by base address */
     client_ptr_t         peb;             /* PEB address in client address space */
     struct dir_cache    *dir_cache;       /* map of client-side directory cache */
     unsigned int         trace_data;      /* opaque data used by the process tracing mechanism */
-- 
2.56.1

No game data attached.

**@⁠neonbyte1** on GitHub · 2026-11-24 15:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7136559706) **RTX 5090 + Wine 11.22: prologue reached; patched wineserver ~5.5× faster per world frame; NVIDIA hang (Xid 109) did not occur with submissions serialized** ## Setup - Arch Linux, kernel 7.3.5-zen, Ryzen 9 9950X3D, 64 GB RAM. RTX 5090 (NVIDIA 620.73.04), plus an RX 7600 (RADV, Mesa 26.3.1) with no monitor attached. - System Wine 11.22. vkd3d-proton `v3.1-83-gcae8353ed` and DXVK `dxgi.dll`, both from GE-Proton11-14, in a dedicated prefix. `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n"`. - Headless gamescope 3.17. Frames come from the diagnostics build (`VICTORY_CAPTURE`), and input from `VICTORY_KEYS`. - VIctory: `main@ffe310e` plus #190, #217, #347, #322, #454, #493, #579, #177, #259 and #542, merged locally (`0f70ec9`). Two small local fixes on top: - the #542 test called `resource::track` with the old signature; - `stub_pipeline_is_created` skips its hash-refusal half under Wine. - Windows MSVC diagnostics build, cross-compiled on Linux with xwin, clang-cl and lld-link. Rust 1.98.1. ## Test suite under Wine The Windows test binaries, cross-built and run under Wine with the same vkd3d-proton: | GPU | Passed | Failed | Ignored | |---|---|---|---| | RX 7600 | 343 | 0 | 6 | | RTX 5090 | 343 | 0 | 6 | Each GPU was isolated with `VK_DRIVER_FILES`. ## Setup notes - Wine's builtin `dxgi` crashes in `wined3d` on the first present with vkd3d-proton; DXVK's `dxgi.dll` is required. - With `VK_DRIVER_FILES` restricted to one GPU, DXVK reported "No adapters found" until `DXVK_FILTER_DEVICE_NAME` was set. - With Proton 11.0's vkd3d-proton, the first world pipeline (mesh `d4111a6e6ea49d91`, pixel `c0a7fe77b1862e10`) crashes in `vkCreateGraphicsPipelines`. The log shows "dxil-spirv: Failed to find a common merge point" just before the crash. GE-Proton11-14's build fixes it, matching #752. - Without #259, the 5090 crashed two seconds after boot inside `vkCreateComputePipelines`, as in #144. With #177, #259 and #542, no pipeline creation crashed. ## Results on the RTX 5090 Settings for the runs below: `VICTORY_NO_WATCHDOG=1`, `VICTORY_SHADER_LOOP_LIMIT=256`, `VICTORY_SKIP_PIPELINES=04b9be3756e8f41c`. | Run | GPU timing | wineserver | Ended at | How it ended | |---|---|---|---|---| | nv-2 | off | stock | about 2.5 min, frame ~1595 | `Xid 109 CTX SWITCH TIMEOUT` (nv-2 ran without the loop limit and the skip) | | nv-3 | off | stock | about 4 min, frame 1631 | `Xid 109 CTX SWITCH TIMEOUT` | | nv-4 | on | stock | 9 min, frame ~1875 | the title's own breakpoint `0x80000003` at `+0x63966f`; no Xid | | nv-5 | on | patched | 10 min (timeout), frame ~2993 | no Xid; reached **PROLOGUE** with the "Move around / Move the camera" hint | What this shows: - **NVIDIA hang (hypothesis):** both Xid 109 hangs happened with overlapping submissions. Neither run with `VICTORY_GPU_TIMING=1` (each list submitted alone and waited for) hung. In nv-2 and nv-3 the shaders first bound just before the hang had nothing in common, which points at overlapping work rather than one shader. That is two runs each way, so it is not proven yet. - **Rendering:** UI, credits and title cards render; the 3D world stays black. About 435 to 1,686 draws per frame are dropped because their pipelines don't translate, plus about 880 to 1,590 indirect draws per frame. ## wineserver view-tree patch, in the game This is a cleaned-up version of the patch in this thread, rebased on Wine 11.22. The views stay in a list, and a red-black tree keyed by base address handles `find_mapped_view`, `find_mapped_addr` and `is_valid_view_addr`. Only `wineserver` was swapped between nv-4 and nv-5; everything else was identical. Medians of VIctory's frame summary lines, grouped by time since the game started: | Seconds in | ms/frame (stock) | ms/frame (patched) | copies ms (stock) | copies ms (patched) | textures ms (stock) | textures ms (patched) | |---|---|---|---|---|---|---| | 0–180 | 1026 | 308 | 723 | 65 | 46 | 11 | | 180–300 | 2767 | 220 | 2300 | 64 | 209 | 15 | | 300–420 | 1067 | 275 | 627 | 85 | 55 | 15 | | 420–600 | 2916 | 333 | 1884 | 95 | 213 | 10 | - **Whole run:** median 1617 ms/frame stock against 292 ms/frame patched. The patched run also issued more draws per frame. - **wineserver CPU:** about 80% of a core stock, against 9 s in 8 minutes patched. - **Caveat:** the summary line's `copies` ms counts some refresh flushes twice: `Step::Copy` adds a flush's time that `Batch::flush` already added (`host.rs:1171`, `1179`, `1226`). Both runs share this, so the ratio holds, but the absolute `copies` figures are too high. Microbenchmark: a MapViewOfFile/UnmapViewOfFile pair, with N other views kept mapped (20,000 pairs per row): | N views kept mapped | Stock µs per pair | Patched µs per pair | Stock wineserver CPU | Patched wineserver CPU | |---|---|---|---|---| | 0 | 8.6 | 7.6 | 70 ms | 50 ms | | 5,000 | 17.7 | 8.3 | 270 ms | 80 ms | | 20,000 | 67.2 | 7.8 | 1,520 ms | 120 ms | | 50,000 | 155.0 | 8.0 | 4,850 ms | 220 ms | Wine's `ntdll:virtual`, `ntdll:info`, `kernel32:virtual`, `kernel32:loader` and `kernelbase:process` tests pass with the patch. `ntdll:exception` and `kernel32:process` fail identically with the unpatched server. <details><summary>wineserver patch (Wine 11.22, <code>git am</code>-able; tests above run with it)</summary> ```diff From 51bbcd262a3fda22e636986dc66fd96d161db458 Mon Sep 17 00:00:00 2001 From: neonbyte1 <186292855+[email protected]> Date: Tue, 24 Nov 2026 15:32:06 +0100 Subject: [PATCH] server: Keep memory views in a tree by base address. find_mapped_view(), find_mapped_addr() and is_valid_view_addr() walked the whole per-process view list, so every map_view, map_image_view, map_builtin_view and unmap_view request was linear in the number of views. Applications that keep tens of thousands of views mapped spend most of their time in the server. Keep the list, which still orders the main exe first and drives cleanup, and add an rb tree keyed by base address. Views never overlap, so each lookup is a search for the highest base not above an address. With 50000 resident views, a MapViewOfFile/UnmapViewOfFile pair goes from 155 us to 8 us, and the server's CPU time for 20000 pairs from 4.85 s to 0.22 s. --- server/file.h | 1 + server/mapping.c | 70 +++++++++++++++++++++++++++++++++++------------- server/process.c | 2 +- server/process.h | 4 ++- 4 files changed, 56 insertions(+), 21 deletions(-) diff --git a/server/file.h b/server/file.h index 99215b8..32fd977 100644 --- a/server/file.h +++ b/server/file.h @@ -179,6 +179,7 @@ extern struct memory_view *get_exe_view( struct process *process ); extern struct file *get_view_file( const struct memory_view *view, unsigned int access, unsigned int sharing ); extern const struct pe_image_info *get_view_image_info( const struct memory_view *view, client_ptr_t *base ); extern int get_view_nt_name( const struct memory_view *view, struct unicode_str *name ); +extern void init_process_views( struct process *process ); extern void free_mapped_views( struct process *process ); extern size_t get_page_size(void); extern struct mapping *create_fd_mapping( struct object *root, struct unicode_str name, struct fd *fd, diff --git a/server/mapping.c b/server/mapping.c index d1b0fc3..9bc2fbf 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -98,6 +98,7 @@ static struct list shared_map_list = LIST_INIT( shared_map_list ); struct memory_view { struct list entry; /* entry in per-process view list */ + struct rb_entry tree_entry; /* entry in per-process view tree, by base */ struct fd *fd; /* fd for mapped file */ struct ranges *committed; /* list of committed ranges in this mapping */ struct shared_map *shared; /* temp file for shared PE mapping */ @@ -384,14 +385,48 @@ static int create_temp_file( file_pos_t size ) return fd; } +static int compare_view_base( const void *key, const struct rb_entry *entry ) +{ + client_ptr_t base = *(const client_ptr_t *)key; + const struct memory_view *view = RB_ENTRY_VALUE( entry, const struct memory_view, tree_entry ); + + if (base < view->base) return -1; + if (base > view->base) return 1; + return 0; +} + +/* initialize the view list and tree of a new process */ +void init_process_views( struct process *process ) +{ + list_init( &process->views ); + rb_init( &process->view_tree, compare_view_base ); +} + +/* find the view with the highest base address not above addr */ +static struct memory_view *find_view_below( struct process *process, client_ptr_t addr ) +{ + struct rb_entry *entry = process->view_tree.root; + struct memory_view *view, *found = NULL; + + while (entry) + { + view = RB_ENTRY_VALUE( entry, struct memory_view, tree_entry ); + if (view->base <= addr) + { + found = view; + entry = entry->right; + } + else entry = entry->left; + } + return found; +} + /* find a memory view from its base address */ struct memory_view *find_mapped_view( struct process *process, client_ptr_t base ) { - struct memory_view *view; - - LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry ) - if (view->base == base) return view; + struct rb_entry *entry = rb_get( &process->view_tree, &base ); + if (entry) return RB_ENTRY_VALUE( entry, struct memory_view, tree_entry ); set_error( STATUS_NOT_MAPPED_VIEW ); return NULL; } @@ -399,11 +434,9 @@ struct memory_view *find_mapped_view( struct process *process, client_ptr_t base /* find a memory view from any address inside it */ static struct memory_view *find_mapped_addr( struct process *process, client_ptr_t addr ) { - struct memory_view *view; - - LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry ) - if (addr >= view->base && addr < view->base + view->size) return view; + struct memory_view *view = find_view_below( process, addr ); + if (view && addr < view->base + view->size) return view; set_error( STATUS_NOT_MAPPED_VIEW ); return NULL; } @@ -417,14 +450,10 @@ static int is_valid_view_addr( struct process *process, client_ptr_t addr, mem_s if (addr & (process->page_size - 1)) return 0; if (addr + size < addr) return 0; /* overflow */ - /* check for overlapping view */ - LIST_FOR_EACH_ENTRY( view, &process->views, struct memory_view, entry ) - { - if (view->base + view->size <= addr) continue; - if (view->base >= addr + size) continue; - return 0; - } - return 1; + /* views don't overlap, so only the last one starting inside the range + * or before it can overlap it */ + view = find_view_below( process, addr + size - 1 ); + return !view || view->base + view->size <= addr; } /* get the main exe memory view */ @@ -462,19 +491,22 @@ static int add_process_view( struct thread *thread, struct memory_view *view ) process->imagelen = name.len; process->image_info = view->image; list_add_head( &process->views, &view->entry ); + rb_put( &process->view_tree, &view->base, &view->tree_entry ); return 1; } } list_add_tail( &process->views, &view->entry ); + rb_put( &process->view_tree, &view->base, &view->tree_entry ); return 0; } -static void free_memory_view( struct memory_view *view ) +static void free_memory_view( struct process *process, struct memory_view *view ) { if (view->fd) release_object( view->fd ); if (view->committed) release_object( view->committed ); if (view->shared) release_object( view->shared ); list_remove( &view->entry ); + rb_remove( &process->view_tree, &view->tree_entry ); free( view ); } @@ -484,7 +516,7 @@ void free_mapped_views( struct process *process ) struct list *ptr; while ((ptr = list_head( &process->views ))) - free_memory_view( LIST_ENTRY( ptr, struct memory_view, entry )); + free_memory_view( process, LIST_ENTRY( ptr, struct memory_view, entry )); } /* find the shared PE mapping for a given mapping */ @@ -1797,7 +1829,7 @@ DECL_HANDLER(unmap_view) if (!view) return; generate_dll_event( current, DbgUnloadDllStateChange, view ); - free_memory_view( view ); + free_memory_view( current->process, view ); } /* get information about a mapped image view */ diff --git a/server/process.c b/server/process.c index 510faf1..7fb1e4e 100644 --- a/server/process.c +++ b/server/process.c @@ -647,7 +647,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla list_init( &process->locks ); list_init( &process->asyncs ); list_init( &process->classes ); - list_init( &process->views ); + init_process_views( process ); process->end_time = 0; diff --git a/server/process.h b/server/process.h index dff766d..9e40fe4 100644 --- a/server/process.h +++ b/server/process.h @@ -22,6 +22,7 @@ #define __WINE_SERVER_PROCESS_H #include "object.h" +#include "wine/rbtree.h" struct atom_table; struct handle_table; @@ -79,7 +80,8 @@ struct process obj_handle_t winstation; /* main handle to process window station */ obj_handle_t desktop; /* handle to desktop to use for new threads */ struct token *token; /* security token associated with this process */ - struct list views; /* list of memory views */ + struct list views; /* list of memory views, main exe first */ + struct rb_tree view_tree; /* memory views by base address */ client_ptr_t peb; /* PEB address in client address space */ struct dir_cache *dir_cache; /* map of client-side directory cache */ unsigned int trace_data; /* opaque data used by the process tracing mechanism */ -- 2.56.1 ``` </details> No game data attached.
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-24 16:23 UTC · original

@⁠ajsem1337 the wineserver view-tree fix is your idea and your first patch, so please take it to Wine as you planned. You're welcome to use the version in my comment above (Wine 11.22, without the in_tree flag, overlap check relying on views never overlapping) and any of the numbers:

  • the in-game comparison;
  • the map/unmap microbenchmark;
  • the results of the ntdll/kernel32 virtual and loader tests.

I won't be submitting it to Wine myself.

**@⁠neonbyte1** on GitHub · 2026-11-24 16:23 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7137602030) @⁠ajsem1337 the wineserver view-tree fix is your idea and your first patch, so please take it to Wine as you planned. You're welcome to use the version in my comment above (Wine 11.22, without the `in_tree` flag, overlap check relying on views never overlapping) and any of the numbers: - the in-game comparison; - the map/unmap microbenchmark; - the results of the `ntdll`/`kernel32` virtual and loader tests. I won't be submitting it to Wine myself.
Author
Owner

@⁠ajsem1337 on GitHub · 2026-11-24 17:06 UTC · original

@⁠neonbyte1 thanks, done. Here is where it went:

  • Wine: https://bugs.winehq.org/show_bug.cgi?id=60868. It only has the description, repro steps and numbers, no code. WineHQ doesn't accept LLM-generated code (Developer FAQ / Clean Room Guidelines), and our patch counts as that, so a Wine merge request wasn't possible. Valve's wine fork only takes changes that went through upstream first, so the bug report is the route there too.
  • CachyOS: https://github.com/CachyOS/wine-cachyos/pull/50, your version on cachyos_11.0_release/dev, credited to you.

Map/unmap pair cost with N other views mapped, same tree with only wineserver swapped:

N Wine master stock Wine master patched CachyOS stock CachyOS patched
0 24.9 µs 25.1 µs 24.7 µs 26.3 µs
50,000 185.7 µs 26.0 µs 259.0 µs 25.1 µs

On the CachyOS branch, ntdll:virtual/info/exception, kernel32:virtual/loader/process and kernelbase:process give the same results with both servers: same counts and the same pre-existing failures.

AI-assisted (Claude Code).

**@⁠ajsem1337** on GitHub · 2026-11-24 17:06 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7138705994) @⁠neonbyte1 thanks, done. Here is where it went: - **Wine:** https://bugs.winehq.org/show_bug.cgi?id=60868. It only has the description, repro steps and numbers, no code. WineHQ doesn't accept LLM-generated code (Developer FAQ / Clean Room Guidelines), and our patch counts as that, so a Wine merge request wasn't possible. Valve's wine fork only takes changes that went through upstream first, so the bug report is the route there too. - **CachyOS:** https://github.com/CachyOS/wine-cachyos/pull/50, your version on `cachyos_11.0_release/dev`, credited to you. Map/unmap pair cost with N other views mapped, same tree with only `wineserver` swapped: | N | Wine master stock | Wine master patched | CachyOS stock | CachyOS patched | |---:|---:|---:|---:|---:| | 0 | 24.9 µs | 25.1 µs | 24.7 µs | 26.3 µs | | 50,000 | 185.7 µs | 26.0 µs | 259.0 µs | 25.1 µs | On the CachyOS branch, `ntdll:virtual/info/exception`, `kernel32:virtual/loader/process` and `kernelbase:process` give the same results with both servers: same counts and the same pre-existing failures. AI-assisted (Claude Code).
Author
Owner

@⁠pablogonz12 on GitHub · 2026-11-24 20:12 UTC · original

One more item for the Linux/Proton notes: a Vulkan implicit layer left installed for frame capture is enough to make the title crash under Wine, and it is easy to blame the build instead.

Here RenderDoc's layer (Arch renderdoc 1.46, installed as an implicit layer under /etc/vulkan/implicit_layer.d/) crashed every game run 1-44 s in (first-chance 0x80000003, then an access violation). An isolated Wine prefix alone did not help. With VK_LOADER_LAYERS_DISABLE=*renderdoc* set, a 120 s smoke run and a 25-minute run were clean (no device removed, no crash).

So the check worth adding to the docs: before reporting a Wine crash, look at /etc/vulkan/implicit_layer.d/ and /usr/share/vulkan/implicit_layer.d/ and run once with VK_LOADER_LAYERS_DISABLE=*renderdoc* (or with the capture package removed). Processes inside Wine pick up the host's implicit layers.

Setup: RX 9070 XT (RDNA4, RADV), Mesa 26.3.1, Ryzen 9 9900X, 30 GB, Arch Linux, GE-Proton11-14, vkd3d-proton master. Not tested: other capture layers (Nsight, apitrace), other distros, NVIDIA. (AI-assisted; numbers from my own runs.)

**@⁠pablogonz12** on GitHub · 2026-11-24 20:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7143202918) One more item for the Linux/Proton notes: a Vulkan implicit layer left installed for frame capture is enough to make the title crash under Wine, and it is easy to blame the build instead. Here RenderDoc's layer (Arch `renderdoc 1.46`, installed as an implicit layer under `/etc/vulkan/implicit_layer.d/`) crashed every game run 1-44 s in (first-chance 0x80000003, then an access violation). An isolated Wine prefix alone did not help. With `VK_LOADER_LAYERS_DISABLE=*renderdoc*` set, a 120 s smoke run and a 25-minute run were clean (no device removed, no crash). So the check worth adding to the docs: before reporting a Wine crash, look at `/etc/vulkan/implicit_layer.d/` and `/usr/share/vulkan/implicit_layer.d/` and run once with `VK_LOADER_LAYERS_DISABLE=*renderdoc*` (or with the capture package removed). Processes inside Wine pick up the host's implicit layers. Setup: RX 9070 XT (RDNA4, RADV), Mesa 26.3.1, Ryzen 9 9900X, 30 GB, Arch Linux, GE-Proton11-14, vkd3d-proton master. Not tested: other capture layers (Nsight, apitrace), other distros, NVIDIA. (AI-assisted; numbers from my own runs.)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:46 UTC · original · edited 2026-11-25 21:44 UTC

Automated triage for the maintainers.

This is a request to document and track running the Windows build under Wine/Proton. The project's stated scope is Windows hosts: the README lists Windows 10/11 x64 as the requirement, and neither the README nor the docs in main mention Linux, Wine or Proton. Because this runs the unchanged Windows build rather than porting it, it is not a port to another platform. Whether to carry an experimental Wine recipe and compatibility matrix is left to the maintainers.

This thread already collects the Wine/Proton results:

  • AMD/RADV and NVIDIA runs
  • test-suite results under Wine
  • the wineserver view-lookup cost (Wine bug 60868, #2082)
  • the implicit Vulkan layer pitfall
  • unmodified main 940d32f reaching the first-boot screens at 30 fps on an RX 9070 XT, and the first mission's cutscene drawing with open PR #1279 (the indirect argument clamp, #170)
  • a world-frame profile on an RX 7900 GRE

New: an RTX 4070 Ti (620.73.04, Wine 11.22) now runs past the NVIDIA pipeline-creation crash of #144 with two pieces: vkd3d-proton built from master (the old dxil-spirv structurizer bug, outside VIctory) and open PR #2723 (heap handle caches keyed by element type). On main 13f91ca + #2723 with the shader cache warmed by translate --cache, the run went about 8 minutes without a crash, at a median of about 1 s per frame, with lit surfaces still black as in other reports. A run on a third-party fork reached gameplay; that fork cannot be checked from this tracker. The reporter also notes that translate --cache --pipelines grew to about 27 GB of RAM on a 32 GB machine and was killed, and that its pipeline library is only written at the end, so a rerun starts over; that would be best filed as its own issue if it reproduces on Windows.

#394 asks the same question and points here. Related: #90 (native Linux build of main), #144 (NVIDIA under Wine, crash in vkCreateComputePipelines), #170 and #698 (the title's own 0x80000003 after about 7 minutes).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:46 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7149949208) · edited 2026-11-25 21:44 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T20:12:42Z at=2026-11-25T21:45:00Z --> Automated triage for the maintainers. This is a request to document and track running the Windows build under Wine/Proton. The project's stated scope is Windows hosts: the README lists Windows 10/11 x64 as the requirement, and neither the README nor the docs in `main` mention Linux, Wine or Proton. Because this runs the unchanged Windows build rather than porting it, it is not a port to another platform. Whether to carry an experimental Wine recipe and compatibility matrix is left to the maintainers. This thread already collects the Wine/Proton results: - AMD/RADV and NVIDIA runs - test-suite results under Wine - the wineserver view-lookup cost (Wine bug 60868, #2082) - the implicit Vulkan layer pitfall - unmodified `main` `940d32f` reaching the first-boot screens at 30 fps on an RX 9070 XT, and the first mission's cutscene drawing with open PR #1279 (the indirect argument clamp, #170) - a world-frame profile on an RX 7900 GRE New: an RTX 4070 Ti (620.73.04, Wine 11.22) now runs past the NVIDIA pipeline-creation crash of #144 with two pieces: vkd3d-proton built from master (the old dxil-spirv structurizer bug, outside VIctory) and open PR #2723 (heap handle caches keyed by element type). On `main` `13f91ca` + #2723 with the shader cache warmed by `translate --cache`, the run went about 8 minutes without a crash, at a median of about 1 s per frame, with lit surfaces still black as in other reports. A run on a third-party fork reached gameplay; that fork cannot be checked from this tracker. The reporter also notes that `translate --cache --pipelines` grew to about 27 GB of RAM on a 32 GB machine and was killed, and that its pipeline library is only written at the end, so a rerun starts over; that would be best filed as its own issue if it reproduces on Windows. #394 asks the same question and points here. Related: #90 (native Linux build of `main`), #144 (NVIDIA under Wine, crash in `vkCreateComputePipelines`), #170 and #698 (the title's own `0x80000003` after about 7 minutes). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 08:01 UTC · original

Current main on RDNA4 under Wine, with no PRs applied: menus at 30 fps

Setup

  • Arch Linux (kernel 7.3.5), RX 9070 XT (RDNA4), RADV / Mesa 26.3.1, Ryzen 9 7900X, 30 GB.
  • System Wine 11.22 in a dedicated prefix, stock wineserver.
  • vkd3d-proton (d3d12, d3d12core) and DXVK's dxgi, both from GE-Proton11-14. WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n", VK_LOADER_LAYERS_DISABLE=~implicit~, and VKD3D_FILTER_DEVICE_NAME / DXVK_FILTER_DEVICE_NAME set to the dGPU (this box also has an iGPU).
  • VIctory: unmodified main 940d32f, release build, cross-built with cargo-xwin 0.24.1 and Rust 1.98.1. My own Series 1.0.2.1 copy.

Title, menus only (no input, 240 s)

  • Without --execute: the exe and its four DLLs bind with 0 missing imports.
  • With --execute: it boots to the first-boot screens (narration, player picker) at a steady 30.0 fps. That's 33.3 ms per frame, 1.4–1.5 ms of it on the GPU, with 21 draws per frame and none dropped.
  • No crashes.log entry, and no amdgpu messages in the kernel log.
  • Warnings:
    • the castable-format refusal explained in #2101
    • "no host pipeline library" (#347 / #1722)
    • the two unimplemented device slots that #417 also gets on Windows
    • one empty buffer view

Test suites under the same setup (cargo xwin test, runner wine)

  • core, pe, formats, pipeline, game, loader: 146 passed, 1 failed. The failure is load_probe, which runs the Linux cargo from inside Wine (#989).
  • gpu, shader, hle: 519 passed, 17 failed, 5 ignored. The failures are the ones already explained elsewhere, now on AMD:
    • 5 indirect tests (#170, #1279)
    • 6 draw/bindless root-signature tests and the memory resource-array test (#2196)
    • the empty pipeline library (#347, #1722)
    • four host differences: no WSAConnectByList, the temp folder isn't on NTFS, WARP is a hardware adapter under Proton, and a zero digest is accepted

Not tested: getting past the first-boot screens, the world, the patched wineserver, any open PR.

AI-assisted (Claude Code); numbers from my own runs.

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 08:01 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7156526697) **Current `main` on RDNA4 under Wine, with no PRs applied: menus at 30 fps** **Setup** - Arch Linux (kernel 7.3.5), RX 9070 XT (RDNA4), RADV / Mesa 26.3.1, Ryzen 9 7900X, 30 GB. - System Wine 11.22 in a dedicated prefix, stock wineserver. - vkd3d-proton (`d3d12`, `d3d12core`) and DXVK's `dxgi`, both from GE-Proton11-14. `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n"`, `VK_LOADER_LAYERS_DISABLE=~implicit~`, and `VKD3D_FILTER_DEVICE_NAME` / `DXVK_FILTER_DEVICE_NAME` set to the dGPU (this box also has an iGPU). - VIctory: **unmodified `main` `940d32f`**, release build, cross-built with cargo-xwin 0.24.1 and Rust 1.98.1. My own Series 1.0.2.1 copy. **Title, menus only** (no input, 240 s) - Without `--execute`: the exe and its four DLLs bind with 0 missing imports. - With `--execute`: it boots to the first-boot screens (narration, player picker) at a steady 30.0 fps. That's 33.3 ms per frame, 1.4–1.5 ms of it on the GPU, with 21 draws per frame and none dropped. - No `crashes.log` entry, and no amdgpu messages in the kernel log. - Warnings: - the castable-format refusal explained in #2101 - "no host pipeline library" (#347 / #1722) - the two unimplemented device slots that #417 also gets on Windows - one empty buffer view **Test suites under the same setup** (`cargo xwin test`, runner `wine`) - core, pe, formats, pipeline, game, loader: 146 passed, 1 failed. The failure is `load_probe`, which runs the Linux `cargo` from inside Wine (#989). - gpu, shader, hle: 519 passed, 17 failed, 5 ignored. The failures are the ones already explained elsewhere, now on AMD: - 5 `indirect` tests (#170, #1279) - 6 `draw`/`bindless` root-signature tests and the `memory` resource-array test (#2196) - the empty pipeline library (#347, #1722) - four host differences: no `WSAConnectByList`, the temp folder isn't on NTFS, WARP is a hardware adapter under Proton, and a zero digest is accepted **Not tested:** getting past the first-boot screens, the world, the patched wineserver, any open PR. AI-assisted (Claude Code); numbers from my own runs.
Author
Owner

@⁠ajsem1337 on GitHub · 2026-11-25 11:00 UTC · original

Linux/Proton world-frame profile and write-tracking results

I used a diagnostic build of 940d32f with #1849, which addresses a world-load stall observed on Wine. The runs used an RX 7900 GRE with RADV and Resizable BAR, Proton-CachyOS with the wineserver view-tree patch, and a warm shader cache.

The prefix contained Microsoft's desktop d3dcompiler_47.dll with the native,builtin override. The data-flow logs contain neither E5005 nor no argument clamp. Run C3 logged 20 shader translation failures (16 compute, 4 pixel) and 70 per-frame counter lines for indirect calls dropped with no host pipeline. The world remained black.

Across the steady-state windows of the three guard baseline runs, median frame times ranged from 0.83 to 1.15 s. In A2, the medians were 833 ms per frame, 510 ms preparing (42 ms in the copy-move counter), 168 ms on the GPU, and 101 ms copying back. The log recorded about 7,700 protection calls, 7,900 page openings, and 75 ms of watch queries per frame. The guard handler accounted for 146 ms of thread time, including 27 ms of lock wait.

In a standalone Proton test, 64 KiB copies into a D3D12 UPLOAD buffer placed in CPU-visible VRAM reached 2.79 GB/s with ReadProcessMemory and 11.31 GB/s with memcpy. At 512 B, ReadProcessMemory took about 2.32 µs per call. Wine probes the destination before copying. VIctory's deferred scratch fill uses this API. The Wine side is reported with a standalone reproducer as Wine bug 60876. Scratch fill · ReadProcessMemory call

Write-tracking experiments

  • Per-take write watch reached about 88,000 collections per frame in the warm hybrid run. Batching guard reopens produced little coalescing in the tested workload.
  • The once-per-submission prototype raised median per-frame CPU time in the title runs from 740 to 878 ms (preparing plus copy-back). The corrected prototype was measured in fixtures. Across the fixture runs, the median of the per-run refresh-worker medians fell from 93 to 78 ms. The corresponding snapshot wall time fell from 1.14 to 0.99 s, including title writes. The marked-page timings were close.
  • In the visibility test, the corrected prototype deferred BeforeRefresh writes by one submission and shared the guard path's BeforeTaken loss. The guarded copy-back reproducer kept every marker in title memory while the host copy missed 32 of 32 markers per seed on both tested builds. Details and the reproducer: #2009.

The wineserver view-tree work is tracked in #2082 and Wine bug 60868. VIctory #2082 · Wine bug 60868

Measurements and analysis were done with AI assistance (Claude Code and Codex) on my machine. The figures come from recorded runs.

**@⁠ajsem1337** on GitHub · 2026-11-25 11:00 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7160464067) **Linux/Proton world-frame profile and write-tracking results** I used a diagnostic build of `940d32f` with #1849, which addresses a world-load stall observed on Wine. The runs used an RX 7900 GRE with RADV and Resizable BAR, Proton-CachyOS with the wineserver view-tree patch, and a warm shader cache. The prefix contained Microsoft's desktop `d3dcompiler_47.dll` with the `native,builtin` override. The data-flow logs contain neither `E5005` nor `no argument clamp`. Run C3 logged 20 shader translation failures (16 compute, 4 pixel) and 70 per-frame counter lines for indirect calls dropped with `no host pipeline`. The world remained black. Across the steady-state windows of the three guard baseline runs, median frame times ranged from 0.83 to 1.15 s. In A2, the medians were 833 ms per frame, 510 ms preparing (42 ms in the copy-move counter), 168 ms on the GPU, and 101 ms copying back. The log recorded about 7,700 protection calls, 7,900 page openings, and 75 ms of watch queries per frame. The guard handler accounted for 146 ms of thread time, including 27 ms of lock wait. In a standalone Proton test, 64 KiB copies into a D3D12 UPLOAD buffer placed in CPU-visible VRAM reached 2.79 GB/s with `ReadProcessMemory` and 11.31 GB/s with `memcpy`. At 512 B, `ReadProcessMemory` took about 2.32 µs per call. Wine probes the destination before copying. VIctory's deferred scratch fill uses this API. The Wine side is reported with a standalone reproducer as [Wine bug 60876](https://bugs.winehq.org/show_bug.cgi?id=60876). [Scratch fill](https://github.com/Marvisak/VIctory/blob/940d32f/crates/victory-gpu/src/draw.rs#L203) · [ReadProcessMemory call](https://github.com/Marvisak/VIctory/blob/940d32f/crates/victory-gpu/src/host.rs#L2043) **Write-tracking experiments** - Per-take write watch reached about 88,000 collections per frame in the warm hybrid run. Batching guard reopens produced little coalescing in the tested workload. - The once-per-submission prototype raised median per-frame CPU time in the title runs from 740 to 878 ms (preparing plus copy-back). The corrected prototype was measured in fixtures. Across the fixture runs, the median of the per-run refresh-worker medians fell from 93 to 78 ms. The corresponding snapshot wall time fell from 1.14 to 0.99 s, including title writes. The marked-page timings were close. - In the visibility test, the corrected prototype deferred `BeforeRefresh` writes by one submission and shared the guard path's `BeforeTaken` loss. The guarded copy-back reproducer kept every marker in title memory while the host copy missed 32 of 32 markers per seed on both tested builds. Details and the reproducer: https://git.gtahub.st/github/Marvisak--VIctory/pulls/2009. The wineserver view-tree work is tracked in #2082 and Wine bug 60868. [VIctory #2082](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2082) · [Wine bug 60868](https://bugs.winehq.org/show_bug.cgi?id=60868) Measurements and analysis were done with AI assistance (Claude Code and Codex) on my machine. The figures come from recorded runs.
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 16:54 UTC · original

Update: the world draws under stock Wine with #1279

A follow-up to my data point above, on the same setup: RX 9070 XT, RADV, Wine 11.22, GE-Proton11-14's vkd3d-proton and DXVK dxgi, and Wine's own d3dcompiler_47. With #1279 rebased onto main (the branch is linked there), the first mission's cutscene draws instead of staying black. That's 2,954 draws a frame on average against 541 on main, and 9 indirect executions dropped a frame against 3,400. Details and the comparison: #1279

Still open on this setup:

  • the scene is unlit, with broken character geometry (as the README describes on Windows);
  • frames take about 3 s, mostly copying title memory;
  • the title stops on its own 0x80000003 after about 7½ minutes (#698).

AI-assisted (Claude Code); numbers from my own runs.

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 16:54 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7168709792) **Update: the world draws under stock Wine with #1279** A follow-up to my data point above, on the same setup: RX 9070 XT, RADV, Wine 11.22, GE-Proton11-14's vkd3d-proton and DXVK `dxgi`, and Wine's own `d3dcompiler_47`. With #1279 rebased onto `main` (the branch is linked there), the first mission's cutscene draws instead of staying black. That's 2,954 draws a frame on average against 541 on `main`, and 9 indirect executions dropped a frame against 3,400. Details and the comparison: https://git.gtahub.st/github/Marvisak--VIctory/pulls/1279 Still open on this setup: - the scene is unlit, with broken character geometry (as the README describes on Windows); - frames take about 3 s, mostly copying title memory; - the title stops on its own `0x80000003` after about 7½ minutes (#698). AI-assisted (Claude Code); numbers from my own runs.
Author
Owner

@⁠andyeox-systemd on GitHub · 2026-11-25 19:40 UTC · original

NVIDIA under Wine: reaching gameplay (RTX 4070 Ti)

Following up on my #144 crash reports, with a working recipe and the remaining limits.

Setup: RTX 4070 Ti (12 GB), Arch Linux, nvidia-open-dkms 620.73.04, kernel 7.3.6, Wine 11.22, DXVK 3.1.1.

What made the difference

  1. vkd3d-proton built from master (71cae091, "Remove the legacy structurizer entirely"). With 3.1 and earlier, dxil-spirv's old structurizer turns three of the title's compute shaders into invalid SPIR-V (spirv-val: "Function end cannot be called in blocks", "block exits the loop headed by…"), and NVIDIA's compiler crashes on them in vkCreateComputePipelines. Microsoft's dxv accepts the DXIL, so this is a converter bug, fixed on master and not in a release yet.
  2. Heap handles keyed by element type. With upstream main, a UAV read as float and also used by an atomic shares one handle, which gives an invalid AtomicOr/AtomicUMax and the same crash. That's fixed for main in #2723. DexNom's fork already keys its handle cache by both property words, so it doesn't need that patch.
  3. Warming the cache first. On the first run with an empty cache, frames reached about 28 s, and the title's own 30 s watchdog ended the run (Breakpad tried to upload a minidump, and VIctory blocked it). Running victory.exe warm <game folder> first (25,745 shaders and 2,700 compute pipelines in about 8 minutes) avoided that.

Result (DexNom's fork at 2e01ab4, Series X, warm cache): about 16 minutes with no crash, and I stopped it myself. It played the intro, opening credits and cutscenes with audio and subtitles, then reached the first gameplay section, with a tutorial prompt and the player in control. Every dumped shader validated with spirv-val (1,103 of 1,103 on the earlier cold run).

Limits

  • Speed: usually 0.5 to 2 fps, with spikes of 13 to 26 s per frame. Those spikes come close to the 30 s watchdog. The GPU sits at about 36 W of 285 W. Most of each frame goes to "preparing: copies" of 100 to 350 MB, so it's CPU-bound, which matches KkelebekK's write-watch measurements under Wine.
  • VRAM: about 10.4 GB of 12 GB on Series X, close to the budget. I haven't retested --console series-s with this setup yet.
  • Rendering: the sky, outlines and light points draw, but lit surfaces are mostly black, and some screens show a flat blue or navy fill, as reported for other GPUs.

AI-assisted. No game data or screenshots attached.

**@⁠andyeox-systemd** on GitHub · 2026-11-25 19:40 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7172609901) ## NVIDIA under Wine: reaching gameplay (RTX 4070 Ti) Following up on my #144 crash reports, with a working recipe and the remaining limits. **Setup:** RTX 4070 Ti (12 GB), Arch Linux, `nvidia-open-dkms` 620.73.04, kernel 7.3.6, Wine 11.22, DXVK 3.1.1. **What made the difference** 1. **vkd3d-proton built from master** (`71cae091`, "Remove the legacy structurizer entirely"). With 3.1 and earlier, dxil-spirv's old structurizer turns three of the title's compute shaders into invalid SPIR-V (`spirv-val`: "Function end cannot be called in blocks", "block exits the loop headed by…"), and NVIDIA's compiler crashes on them in `vkCreateComputePipelines`. Microsoft's `dxv` accepts the DXIL, so this is a converter bug, fixed on master and not in a release yet. 2. **Heap handles keyed by element type.** With upstream `main`, a UAV read as float and also used by an atomic shares one handle, which gives an invalid `AtomicOr`/`AtomicUMax` and the same crash. That's fixed for `main` in #2723. DexNom's fork already keys its handle cache by both property words, so it doesn't need that patch. 3. **Warming the cache first.** On the first run with an empty cache, frames reached about 28 s, and the title's own 30 s watchdog ended the run (Breakpad tried to upload a minidump, and VIctory blocked it). Running `victory.exe warm <game folder>` first (25,745 shaders and 2,700 compute pipelines in about 8 minutes) avoided that. **Result** (DexNom's fork at `2e01ab4`, Series X, warm cache): about 16 minutes with no crash, and I stopped it myself. It played the intro, opening credits and cutscenes with audio and subtitles, then reached the first gameplay section, with a tutorial prompt and the player in control. Every dumped shader validated with `spirv-val` (1,103 of 1,103 on the earlier cold run). **Limits** - **Speed:** usually 0.5 to 2 fps, with spikes of 13 to 26 s per frame. Those spikes come close to the 30 s watchdog. The GPU sits at about 36 W of 285 W. Most of each frame goes to "preparing: copies" of 100 to 350 MB, so it's CPU-bound, which matches KkelebekK's write-watch measurements under Wine. - **VRAM:** about 10.4 GB of 12 GB on Series X, close to the budget. I haven't retested `--console series-s` with this setup yet. - **Rendering:** the sky, outlines and light points draw, but lit surfaces are mostly black, and some screens show a flat blue or navy fill, as reported for other GPUs. AI-assisted. No game data or screenshots attached.
Author
Owner

@⁠andyeox-systemd on GitHub · 2026-11-25 20:12 UTC · original

Follow-up: same setup (RTX 4070 Ti, 620.73.04, Wine 11.22, vkd3d-proton master 71cae091, Series X), but upstream main (13f91ca) + #2723 instead of DexNom's fork. I warmed it with victory.exe translate --cache <game folder> (shaders only).

DexNom fork, warm main + #2723, shaders warmed
Run length ~16 min ~8 min
Median frame 2.1 s 1.0 s
Worst frame 26.0 s 8.8 s

No crash. Audio was continuous, and there were fewer stalls. The rendering gap is the same: light sources, emissive surfaces and some shadows draw, while lit surfaces stay black. The runs covered different scenes and lengths, so this is a first comparison, not a benchmark.

Note: translate --cache --pipelines (all 27,160 pipelines) grew to about 27 GB of RAM, and the OOM killer stopped it at 62% on a 32 GB machine. The library isn't saved before the end, so a rerun started from 0. Shaders-only warm-up was enough.

**@⁠andyeox-systemd** on GitHub · 2026-11-25 20:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7173341044) Follow-up: same setup (RTX 4070 Ti, 620.73.04, Wine 11.22, vkd3d-proton master `71cae091`, Series X), but upstream `main` (`13f91ca`) + #2723 instead of DexNom's fork. I warmed it with `victory.exe translate --cache <game folder>` (shaders only). | | DexNom fork, warm | `main` + #2723, shaders warmed | |---|---|---| | Run length | ~16 min | ~8 min | | Median frame | 2.1 s | 1.0 s | | Worst frame | 26.0 s | 8.8 s | No crash. Audio was continuous, and there were fewer stalls. The rendering gap is the same: light sources, emissive surfaces and some shadows draw, while lit surfaces stay black. The runs covered different scenes and lengths, so this is a first comparison, not a benchmark. Note: `translate --cache --pipelines` (all 27,160 pipelines) grew to about 27 GB of RAM, and the OOM killer stopped it at 62% on a 32 GB machine. The library isn't saved before the end, so a rerun started from 0. Shaders-only warm-up was enough.
Author
Owner

@⁠cobrajet302gt on GitHub · 2026-11-26 16:10 UTC · original

Linux/Wine tester here — this path has been running on one box for 45 consecutive boots (RTX 5080, Linux/Wine), so here is a field report on what #3291's guide will want to cover, all measured on the same Wine-modality stack it describes.

Headline result: 30 fps through the whole front-end (account picker, wizard pages, legal notices, first-run setup, SETTINGS), 45 boots, zero first-chance faults and zero device removals on victory.exe under Wine with vkd3d-proton supplying D3D12 and DXVK supplying DXGI. World entry is the wall we're pressing on now; the front-end itself is stable at full rate.

Five things that cost us real time and are not (yet) in the guide:

  1. Headless displays report 0 Hz and one DXGI build dies on it. On Xvfb (1920x1080 @ 0.00 Hz), Proton 11.0's bundled (Valve-fork) dxgi.dll faults 0xc0000094 (integer divide by zero) in the second CreateSwapChainForHwnd; stock DXVK 3.1.1's dxgi.dll handles the 0 Hz mode fine. dxgi.forceRefreshRate=60 did not help on the bundled build. So the guide's "Wine's own DXGI crashes in wined3d on the first present" is one of two known DXGI failure shapes on headless Linux — worth listing both, since the crash offsets differ. Related: keep WINEDLLOVERRIDES='d3d12,d3d12core,dxgi=n,b' complete — omitting d3d12core gives the wine-builtin stub abort (unimplemented function d3d12core.dll.D3D12GetInterface), and never delete libvkd3d-1.dll/libvkd3d-proton-x64.dll from the prefix — wined3d imports them.

  2. The account picker needs a console-kind pad; keyboard input is inert there. Under headless Wine the title sits on the account picker facing scripted keyboard input (VICTORY_KEYS) indefinitely — the HLE merges scripted keys into already-connected gamepads, and the picker is a console-pad-gated screen (XUserAddAsync offline-signin path). With a console-class pad enumerating in slot 0 the picker crosses on the first A. A tester following the guide with a keyboard-only session will read this as a hang: it is a wrong-input-class park, zero errors in the log. Worth a prominent note; a controller is effectively required hardware for the documented path.

  3. VICTORY_CACHE_DIR entries are keyed by the data-dir path. Rotating VICTORY_DATA_DIR to "clean state" silently cold-boots the pipeline cache (the shaders from the cache line flips to hits=0 misses=N even with the cache dir unchanged), costing ~6-10 minutes of compiling before the first present — which headless looks exactly like a hang. Treat the data-dir + cache-dir as one warm pairing; read the hits/misses line when a boot is slow. The same applies to rebuilds: one of the title's DLL names derives from the build hash, so a new exe can invalidate entries keyed to the old one.

  4. Pin the GPU in both layers, and prove it from the title's own budget line. The device is created on the default DXGI adapter, so iGPU boxes silently attribute runs to integrated graphics; set VKD3D_FILTER_DEVICE_NAME and DXVK_FILTER_DEVICE_NAME, and a Found device: enumeration list in the log is enumeration, not selection. The durable check is the early video memory as the system counts it budget line — its numbers name the actual card.

  5. Diagnostics-build gating. On some trees diagnostics is not a default feature and a plain release build compiles the input/capture switches out silently — the run looks fully alive (VICTORY_RELAY and the fps lines survive) while VICTORY_KEYS/VICTORY_PAD/capture are inert. Three facts to check before any input-driven session: sha256 of the exe changed as expected, target is x86_64-pc-windows-gnu, and strings -a victory.exe | grep -c VICTORY_KEYS is nonzero.

One confirmation for #340's tracking: our experience matches the guide's warning that older vkd3d-proton (Proton 11.0's bundled set) fails at first-world-pipeline creation; we moved to a self-built master vkd3d-proton early and it has been stable since, which corroborates the GE-Proton11-14 DLL recommendation from a different prefix entirely.

Disclosure: our runs use a locally-assembled tree (current main lineage + PRs #1763 and #2178 applied locally + one local scripted-pad commit, --profile diag build), Proton 11.0's files/bin/wine, stock DXVK 3.1.1 dxgi.dll, self-built vkd3d-proton master d3d12/d3d12core, warm data/cache pairing. Happy to re-run anything against the guide's exact GE-Proton11-14 recipe as a controlled A/B once it merges — the guide's path and ours differ mainly in which DLL set is dropped in, and both reach 30 fps menus with zero removals, which is the main compatibility claim either way.

**@⁠cobrajet302gt** on GitHub · 2026-11-26 16:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/340#issuecomment-7197287706) Linux/Wine tester here — this path has been running on one box for 45 consecutive boots (RTX 5080, Linux/Wine), so here is a field report on what #3291's guide will want to cover, all measured on the same Wine-modality stack it describes. **Headline result:** 30 fps through the whole front-end (account picker, wizard pages, legal notices, first-run setup, SETTINGS), 45 boots, **zero first-chance faults and zero device removals** on `victory.exe` under Wine with vkd3d-proton supplying D3D12 and DXVK supplying DXGI. World entry is the wall we're pressing on now; the front-end itself is stable at full rate. Five things that cost us real time and are not (yet) in the guide: 1. **Headless displays report 0 Hz and one DXGI build dies on it.** On Xvfb (1920x1080 @ 0.00 Hz), Proton 11.0's bundled (Valve-fork) `dxgi.dll` faults `0xc0000094` (integer divide by zero) in the *second* `CreateSwapChainForHwnd`; stock DXVK 3.1.1's `dxgi.dll` handles the 0 Hz mode fine. `dxgi.forceRefreshRate=60` did not help on the bundled build. So the guide's "Wine's own DXGI crashes in wined3d on the first present" is one of *two* known DXGI failure shapes on headless Linux — worth listing both, since the crash offsets differ. Related: keep `WINEDLLOVERRIDES='d3d12,d3d12core,dxgi=n,b'` complete — omitting `d3d12core` gives the wine-builtin stub abort (`unimplemented function d3d12core.dll.D3D12GetInterface`), and never delete `libvkd3d-1.dll`/`libvkd3d-proton-x64.dll` from the prefix — wined3d imports them. 2. **The account picker needs a console-kind pad; keyboard input is inert there.** Under headless Wine the title sits on the account picker facing scripted *keyboard* input (`VICTORY_KEYS`) indefinitely — the HLE merges scripted keys into already-connected gamepads, and the picker is a console-pad-gated screen (`XUserAddAsync` offline-signin path). With a console-class pad enumerating in slot 0 the picker crosses on the first `A`. A tester following the guide with a keyboard-only session will read this as a hang: it is a wrong-input-class park, zero errors in the log. Worth a prominent note; a controller is effectively required hardware for the documented path. 3. **`VICTORY_CACHE_DIR` entries are keyed by the data-dir path.** Rotating `VICTORY_DATA_DIR` to "clean state" silently cold-boots the pipeline cache (the `shaders from the cache` line flips to `hits=0 misses=N` even with the cache dir unchanged), costing ~6-10 minutes of compiling before the first present — which headless looks exactly like a hang. Treat the data-dir + cache-dir as one warm pairing; read the hits/misses line when a boot is slow. The same applies to rebuilds: one of the title's DLL names derives from the build hash, so a new exe can invalidate entries keyed to the old one. 4. **Pin the GPU in both layers, and prove it from the title's own budget line.** The device is created on the default DXGI adapter, so iGPU boxes silently attribute runs to integrated graphics; set `VKD3D_FILTER_DEVICE_NAME` *and* `DXVK_FILTER_DEVICE_NAME`, and a `Found device:` enumeration list in the log is enumeration, not selection. The durable check is the early `video memory as the system counts it` budget line — its numbers name the actual card. 5. **Diagnostics-build gating.** On some trees `diagnostics` is not a default feature and a plain release build compiles the input/capture switches out *silently* — the run looks fully alive (`VICTORY_RELAY` and the fps lines survive) while `VICTORY_KEYS`/`VICTORY_PAD`/capture are inert. Three facts to check before any input-driven session: sha256 of the exe changed as expected, target is `x86_64-pc-windows-gnu`, and `strings -a victory.exe | grep -c VICTORY_KEYS` is nonzero. One confirmation for #340's tracking: our experience matches the guide's warning that older vkd3d-proton (Proton 11.0's bundled set) fails at first-world-pipeline creation; we moved to a self-built master vkd3d-proton early and it has been stable since, which corroborates the GE-Proton11-14 DLL recommendation from a different prefix entirely. Disclosure: our runs use a locally-assembled tree (current `main` lineage + PRs #1763 and #2178 applied locally + one local scripted-pad commit, `--profile diag` build), Proton 11.0's `files/bin/wine`, stock DXVK 3.1.1 `dxgi.dll`, self-built vkd3d-proton master `d3d12`/`d3d12core`, warm data/cache pairing. Happy to re-run anything against the guide's exact GE-Proton11-14 recipe as a controlled A/B once it merges — the guide's path and ours differ mainly in which DLL set is dropped in, and both reach 30 fps menus with zero removals, which is the main compatibility claim either way.
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#340
No description provided.