THIN_BAKE ported to a Linux/Proton build (#440 base): results + notes #362

Open
opened 2026-12-01 18:34:22 +00:00 by github-bot · 2 comments
Owner

@⁠Fedalv on GitHub · 2026-12-01 18:30 UTC · original

VIctory on Linux (Proton, RADV, RX 7900 XTX): findings as of 2026-12-01

Notes from running VIctory under Proton on one Linux PC, for anyone working on the Linux or AMD side.
One machine, so treat single-run numbers as hints. "Light" and "heavy" are phase medians of a fixed scripted
path from one save (light ≈ 1.4k draws, heavy 3–6k draws); same-build spread is about ±4 ms.

Setup

GPU RX 7900 XTX 24 GB, RADV (Mesa 26.2.5)
CPU / OS Zen 4, 8 cores (SMT off), Linux 7.2, Hyprland
Proton Proton Experimental 11.0-20261112, vkd3d-proton 71cae09 (dxil-spirv b540c8a), Win11 d3dcompiler_47
Build upstream main 014d52d + PR #440 (Linux under Wine) + #437 #434 #436 #438 #376 #372 #330 #423 #443 #474 #451 #446 #296 #308 #419 #377 + #454 (FMA commit), diag profile
Profile Series X, native 2560x1440 (VICTORY_OUTPUT=2560x1440, VICTORY_RENDER_SCALE=1.0)
Result light 31–36 ms, heavy 49–65 ms (≈ 28–32 fps light, 15–20 fps heavy)

1. Launching from VS Code (or anything Electron/Chromium-based) kills the game silently

Symptom: the game exits without any error after a random amount of time, in about half of the runs
started from a VS Code terminal (or a tool running inside it). Runs started from a normal terminal are fine.

Cause: VS Code (and Chromium-based browsers) set RLIMIT_RTTIME hard = 0 for their children. The kernel's
CPU-timer check (check_thread_timers) applies the RTTIME limit without checking for a realtime task, so
0 >= 0 → SIGKILL (code=SI_KERNEL) the first time any CPU-time timer fires on one of the game's threads.
A child process cannot raise a hard limit.

Check: grep 'realtime timeout' /proc/$(pgrep -x main)/limits: 0 means the game will die.

Fix: start the game outside that process tree. systemd-run --user --scope does not help (a scope keeps
the caller's limits). A systemd-run --user service starts from the user manager's limits:

export -p > /tmp/victory.env
systemd-run --user --unit=victory-run --wait --pipe --collect --same-dir -p LimitRTTIME=infinity \
  bash -c 'source /tmp/victory.env; exec umu-run victory.exe run "E:\path\game_scarlett_master.exe" --execute --console series-x'

After the switch: 0 early exits in 12+ runs (was about 1 in 2).

2. PR #53 frame generation under Proton: real frames about 2x slower

PR #53 (host FidelityFX upscaler + FSR 3.1 frame generation) merged onto the build above with 3 small conflicts
(none in the FG code). FidelityFX SDK v2.4.0 Kits/FidelityFX/signedbin DLLs. Settings:
VICTORY_UPSCALER=7 VICTORY_FFX_SCALE=1.0 VICTORY_FIDELITYFX_FRAMEGEN=1 VKD3D_DISABLE_EXTENSIONS=VK_EXT_present_timing
(the last one avoids a white screen under Proton).

Arm (one 240 s run each) light heavy
title's own upscaler 36.5 65.1
host FSR at native 1440p, no FG 34.0 61.8
host FSR + frame generation 60.5 92.8
  • FG works: provider 3.1.6/3.1.7, 6 presents per 3 rendered frames, no visual faults in captures.
  • But the submitting thread now waits for the card 21–41 ms per frame (1–3.5 ms without FG). The proxy
    swap chain's Present waits for the previous frame's interpolation, and VIctory's submit path is serial, so
    that wait lands on the critical path. Shown fps ≈ 2 × 16.5 ≈ the same as without FG, with more latency.
  • Host FSR alone at scale 1.0 costs about nothing.
  • Making FG pay would need the present (and its wait) moved off the submitting thread.

3. THIN bake-draw race (foxhound's VICTORY_THIN_BAKE), ported to the build above

readmet3xt-lab/foxhound found that with VICTORY_THIN=1 (scripts/play.ps1's default) lists are translated
later and several at a time, so a list recorded after a decoration/ped bake draw can take a texture slot
before the bake's upload runs, and the bake samples a texture that was never uploaded ("blocks of coloured
noise baked into clothes for the whole scene"). Their fix translates lists that bind a bake pipeline at the
title's call (VICTORY_THIN_BAKE=2), with a wider bake list (7 pixel shaders + 2 geometry stages
089d6271be6650ef, d4111a6e6ea49d91) and a structural bake check (no depth, ≥ 4 square targets ≥ 512).

Ported on top of #440 + PR #53 (keeps #53's for_external wake-up in the worker loop). Results so far:

  • Works under Proton: about 22 bake draws a run go through the in-order path; the title waits up to ~47 ms
    in a single frame for other lists to catch up (a hitch at scene loads).
  • One clean full run (faces, floral shirt, beer label all correct). Our noise rate is about 1 run in 12, so
    this proves nothing yet; 5+ runs per arm needed.
  • Maybe 4–6 ms slower than without it (one run each, within spread).

VICTORY_THIN=0 vs =1 (one run each, without the port): light 35.8 vs 32.3, heavy 54.2 vs 59.2, both clean.

4. Texture corruption: what is known

Seen in about half of all runs on every build before the launch fix, about 1 in 12 after: rainbow/flat
blocks, porcelain skin, wrong texture on a shirt, black bottle label, dark dot-mesh face. Always the same
assets (a face behind sunglasses ~frame 2400, a face ~4096, a floral shirt 4800–6000), so likely a
per-texture upload/order race.

  • Not caused by #438 ORDER_BATCH: noisy runs ~5/20 with it off, ~6/15 on. Caps of 4/8 members corrupt too.
  • No effect: PARTIAL_WRITTEN, PAINTED_EVERY=4, cool_fox alias-view/small-lookup commits (872c383, 43ec622),
    ending batched runs at image stores.
  • Glowing white baby eyes show up with THIN_BAKE on too (1 of 1 FSR runs, ~1 in 3 on cool_fox builds),
    so that one is a separate bug. foxhound fixed a wave32 transmission-prefilter drop (2da4beb386509b77)
    that gave black squares on transmissive eye shaders; may be related.

5. Settings measured on this PC (RADV)

Helps (all kept):

Setting Effect
VICTORY_PORT_CONSTANTS_ORDER_BATCH=1 (#438) heavy 63–65 → 54–57 ms (3+3 runs)
RADV_EXPERIMENTAL=transfer_queue (SDMA) −4 ms
VICTORY_CARD_STEPS=2 =0 costs +60 ms
VICTORY_LAND_THREADS=4, VICTORY_PORT_CBV=1, VICTORY_TEXTURE_MAX=0 small wins
VICTORY_SINGLE_LATCH=0 needed with this vkd3d-proton
VICTORY_CARD_STEPS_LEARN=0 #434's learning costs ~25 ms here

Hurts here: VKD3D_CONFIG=single_queue (5x slower), -LowMemory set (PORT_ALL/INPLACE/WINDOW_KB/RESIDENCY,
2.5x), placed heap in VRAM (252 ms) or write-combined (+7), CARD_BUFFERS_MIN_MB=1 (+5), renderer port 5 off (+8).

Needed for a correct picture: VICTORY_LAND_ECHO on (=0 → faces lose skin, so avoid -Safe), renderer port 2
on (off → tree flicker), VICTORY_FETCH_CHECK=1.

6. Where the time goes (heavy scenes)

Serial chain ~44 ms/frame: title CPU ~16, landing/copy-back ~8, card copies 3.5 + 2.2, submit ~4, wake 1.7.
The submitting thread is saturated (~55 ms of work per frame); the GPU itself is ~6 ms busy. Heavy scenes add
15–30 ms of card waits from 2,500–3,000 lone in-place clamps per frame (see #438).

7. Proton gotchas

  • Valve Proton's default verb swallows VIctory's stdout: use PROTON_VERB=runinprefix, which then needs
    WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3dcompiler_47=n" (otherwise Wine's own dxgi drives the swap chain
    through Wine's vkd3d and the title dies in libvkd3d-1.dll at the first frame).
  • Proton re-copies its d3d12 into system32 each launch; vkd3d writes its shader cache to the cwd unless
    VKD3D_SHADER_CACHE_PATH is set.
  • GE-Proton's vkd3d-proton was too old (exit at first PSO). winetricks' d3dcompiler_47 lacks cs_5_1.
  • On hybrid systems pin the dGPU: DXVK_FILTER_DEVICE_NAME=7900 VKD3D_FILTER_DEVICE_NAME=7900.
  • Two whole-GPU resets happened early on (CPC write to 0xfffffffff000 on a compute ring); they took the
    desktop down and left the NTFS game drive dirty (ntfsfix -d to mount it again). Check
    journalctl -k | grep -iE 'page fault|ring .* timeout|GPU reset' after runs.
**@⁠Fedalv** on GitHub · 2026-12-01 18:30 UTC · [original](https://github.com/readmet3xt-lab/foxhound/issues/362) # VIctory on Linux (Proton, RADV, RX 7900 XTX): findings as of 2026-12-01 Notes from running VIctory under Proton on one Linux PC, for anyone working on the Linux or AMD side. One machine, so treat single-run numbers as hints. "Light" and "heavy" are phase medians of a fixed scripted path from one save (light ≈ 1.4k draws, heavy 3–6k draws); same-build spread is about ±4 ms. ## Setup | | | |---|---| | GPU | RX 7900 XTX 24 GB, RADV (Mesa 26.2.5) | | CPU / OS | Zen 4, 8 cores (SMT off), Linux 7.2, Hyprland | | Proton | Proton Experimental 11.0-20261112, vkd3d-proton 71cae09 (dxil-spirv b540c8a), Win11 d3dcompiler_47 | | Build | upstream main 014d52d + PR #440 (Linux under Wine) + #437 #434 #436 #438 #376 #372 #330 #423 #443 #474 #451 #446 #296 #308 #419 #377 + #454 (FMA commit), `diag` profile | | Profile | Series X, native 2560x1440 (`VICTORY_OUTPUT=2560x1440`, `VICTORY_RENDER_SCALE=1.0`) | | Result | light 31–36 ms, heavy 49–65 ms (≈ 28–32 fps light, 15–20 fps heavy) | ## 1. Launching from VS Code (or anything Electron/Chromium-based) kills the game silently **Symptom:** the game exits without any error after a random amount of time, in about half of the runs started from a VS Code terminal (or a tool running inside it). Runs started from a normal terminal are fine. **Cause:** VS Code (and Chromium-based browsers) set `RLIMIT_RTTIME` hard = 0 for their children. The kernel's CPU-timer check (`check_thread_timers`) applies the RTTIME limit without checking for a realtime task, so `0 >= 0` → SIGKILL (`code=SI_KERNEL`) the first time any CPU-time timer fires on one of the game's threads. A child process cannot raise a hard limit. **Check:** `grep 'realtime timeout' /proc/$(pgrep -x main)/limits`: `0` means the game will die. **Fix:** start the game outside that process tree. `systemd-run --user --scope` does **not** help (a scope keeps the caller's limits). A `systemd-run --user` **service** starts from the user manager's limits: ``` export -p > /tmp/victory.env systemd-run --user --unit=victory-run --wait --pipe --collect --same-dir -p LimitRTTIME=infinity \ bash -c 'source /tmp/victory.env; exec umu-run victory.exe run "E:\path\game_scarlett_master.exe" --execute --console series-x' ``` After the switch: 0 early exits in 12+ runs (was about 1 in 2). ## 2. PR #53 frame generation under Proton: real frames about 2x slower PR #53 (host FidelityFX upscaler + FSR 3.1 frame generation) merged onto the build above with 3 small conflicts (none in the FG code). FidelityFX SDK v2.4.0 `Kits/FidelityFX/signedbin` DLLs. Settings: `VICTORY_UPSCALER=7 VICTORY_FFX_SCALE=1.0 VICTORY_FIDELITYFX_FRAMEGEN=1 VKD3D_DISABLE_EXTENSIONS=VK_EXT_present_timing` (the last one avoids a white screen under Proton). | Arm (one 240 s run each) | light | heavy | |---|---|---| | title's own upscaler | 36.5 | 65.1 | | host FSR at native 1440p, no FG | 34.0 | 61.8 | | host FSR + frame generation | **60.5** | **92.8** | - FG works: provider 3.1.6/3.1.7, 6 presents per 3 rendered frames, no visual faults in captures. - But the submitting thread now waits for the card **21–41 ms per frame** (1–3.5 ms without FG). The proxy swap chain's Present waits for the previous frame's interpolation, and VIctory's submit path is serial, so that wait lands on the critical path. Shown fps ≈ 2 × 16.5 ≈ the same as without FG, with more latency. - Host FSR alone at scale 1.0 costs about nothing. - Making FG pay would need the present (and its wait) moved off the submitting thread. ## 3. THIN bake-draw race (foxhound's `VICTORY_THIN_BAKE`), ported to the build above readmet3xt-lab/foxhound found that with `VICTORY_THIN=1` (scripts/play.ps1's default) lists are translated later and several at a time, so a list recorded after a decoration/ped bake draw can take a texture slot before the bake's upload runs, and the bake samples a texture that was never uploaded ("blocks of coloured noise baked into clothes for the whole scene"). Their fix translates lists that bind a bake pipeline at the title's call (`VICTORY_THIN_BAKE=2`), with a wider bake list (7 pixel shaders + 2 geometry stages `089d6271be6650ef`, `d4111a6e6ea49d91`) and a structural bake check (no depth, ≥ 4 square targets ≥ 512). Ported on top of #440 + PR #53 (keeps #53's `for_external` wake-up in the worker loop). Results so far: - Works under Proton: about 22 bake draws a run go through the in-order path; the title waits up to ~47 ms in a single frame for other lists to catch up (a hitch at scene loads). - One clean full run (faces, floral shirt, beer label all correct). Our noise rate is about 1 run in 12, so this proves nothing yet; 5+ runs per arm needed. - Maybe 4–6 ms slower than without it (one run each, within spread). `VICTORY_THIN=0` vs `=1` (one run each, without the port): light 35.8 vs 32.3, heavy 54.2 vs 59.2, both clean. ## 4. Texture corruption: what is known Seen in about half of all runs on every build before the launch fix, about 1 in 12 after: rainbow/flat blocks, porcelain skin, wrong texture on a shirt, black bottle label, dark dot-mesh face. Always the same assets (a face behind sunglasses ~frame 2400, a face ~4096, a floral shirt 4800–6000), so likely a per-texture upload/order race. - **Not** caused by #438 ORDER_BATCH: noisy runs ~5/20 with it off, ~6/15 on. Caps of 4/8 members corrupt too. - No effect: PARTIAL_WRITTEN, PAINTED_EVERY=4, cool_fox alias-view/small-lookup commits (872c383, 43ec622), ending batched runs at image stores. - **Glowing white baby eyes** show up with THIN_BAKE on too (1 of 1 FSR runs, ~1 in 3 on cool_fox builds), so that one is a separate bug. foxhound fixed a wave32 transmission-prefilter drop (`2da4beb386509b77`) that gave black squares on transmissive eye shaders; may be related. ## 5. Settings measured on this PC (RADV) Helps (all kept): | Setting | Effect | |---|---| | `VICTORY_PORT_CONSTANTS_ORDER_BATCH=1` (#438) | heavy 63–65 → 54–57 ms (3+3 runs) | | `RADV_EXPERIMENTAL=transfer_queue` (SDMA) | −4 ms | | `VICTORY_CARD_STEPS=2` | `=0` costs +60 ms | | `VICTORY_LAND_THREADS=4`, `VICTORY_PORT_CBV=1`, `VICTORY_TEXTURE_MAX=0` | small wins | | `VICTORY_SINGLE_LATCH=0` | needed with this vkd3d-proton | | `VICTORY_CARD_STEPS_LEARN=0` | #434's learning costs ~25 ms here | Hurts here: `VKD3D_CONFIG=single_queue` (5x slower), `-LowMemory` set (`PORT_ALL`/`INPLACE`/`WINDOW_KB`/`RESIDENCY`, 2.5x), placed heap in VRAM (252 ms) or write-combined (+7), `CARD_BUFFERS_MIN_MB=1` (+5), renderer port 5 off (+8). Needed for a correct picture: `VICTORY_LAND_ECHO` on (`=0` → faces lose skin, so avoid `-Safe`), renderer port 2 on (off → tree flicker), `VICTORY_FETCH_CHECK=1`. ## 6. Where the time goes (heavy scenes) Serial chain ~44 ms/frame: title CPU ~16, landing/copy-back ~8, card copies 3.5 + 2.2, submit ~4, wake 1.7. The submitting thread is saturated (~55 ms of work per frame); the GPU itself is ~6 ms busy. Heavy scenes add 15–30 ms of card waits from 2,500–3,000 lone in-place clamps per frame (see #438). ## 7. Proton gotchas - Valve Proton's default verb swallows VIctory's stdout: use `PROTON_VERB=runinprefix`, which then needs `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3dcompiler_47=n"` (otherwise Wine's own dxgi drives the swap chain through Wine's vkd3d and the title dies in libvkd3d-1.dll at the first frame). - Proton re-copies its d3d12 into system32 each launch; vkd3d writes its shader cache to the cwd unless `VKD3D_SHADER_CACHE_PATH` is set. - GE-Proton's vkd3d-proton was too old (exit at first PSO). winetricks' d3dcompiler_47 lacks cs_5_1. - On hybrid systems pin the dGPU: `DXVK_FILTER_DEVICE_NAME=7900 VKD3D_FILTER_DEVICE_NAME=7900`. - Two whole-GPU resets happened early on (CPC write to 0xfffffffff000 on a compute ring); they took the desktop down and left the NTFS game drive dirty (`ntfsfix -d` to mount it again). Check `journalctl -k | grep -iE 'page fault|ring .* timeout|GPU reset'` after runs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 18:34:23 +00:00
Author
Owner

@⁠kwaadrat on GitHub · 2026-12-01 23:43 UTC · original

Re: section 7 (d3dcompiler_47 lacks cs_5_1): PRs #388, #409, and #411 convert the internal victory-gpu shaders (CARD_COMPARE/CARD_COMPARE_BATCH, Series S Composer, and indirect argument clamps) to sm_5_0 with explicit D3D12SerializeVersionedRootSignature in Rust, so they now compile out-of-the-box with Wine/Proton's built-in d3dcompiler_47 without needing a Win11 d3dcompiler_47 DLL override.

Also, #412 makes pipeline::make skip entries from warm-bad.txt so live compilation after skipping warm doesn't wedge worker threads on known-hanging pipelines.

**@⁠kwaadrat** on GitHub · 2026-12-01 23:43 UTC · [original](https://github.com/readmet3xt-lab/foxhound/issues/362#issuecomment-7329707052) Re: section 7 (`d3dcompiler_47 lacks cs_5_1`): PRs #388, #409, and #411 convert the internal `victory-gpu` shaders (`CARD_COMPARE`/`CARD_COMPARE_BATCH`, Series S `Composer`, and `indirect` argument clamps) to `sm_5_0` with explicit `D3D12SerializeVersionedRootSignature` in Rust, so they now compile out-of-the-box with Wine/Proton's built-in `d3dcompiler_47` without needing a Win11 `d3dcompiler_47` DLL override. Also, #412 makes `pipeline::make` skip entries from `warm-bad.txt` so live compilation after skipping `warm` doesn't wedge worker threads on known-hanging pipelines.
Author
Owner

@⁠Anzymanz on GitHub · 2026-12-02 09:11 UTC · original

Written with Claude Code.

Some data on sections 2 and 4 from another Linux machine (RX 9070 XT, Mesa 26.3.1 RADV, GE-Proton, xmem-line tree, 1440p render, ray tracing off), in case it saves you time.

FG wait. We see the same thing: with FSR 3.1 FG 2X the render thread waits 18-40 ms a frame in Present, for the previous frame's composition. What we measured:

  • A presenter thread that takes the proxy Present (and its wait) off the submitting thread: 56.4 -> 51.1 ms a real frame in one in-run A/B. It helps but does not remove the cost.
  • The rest is FFX itself: in one A/B FG 2X added about 19 ms a base frame, roughly half FFX's own GPU work and half the card standing partly idle. A second present slot and async-compute interpolation both gave nothing.
  • FFX's default 0.1 ms safety margin holds each real frame for about half an interval. A margin adjusted once a second from measured screen evenness kept about 25 fps rendered while moving, at 0.93 evenness.
  • If you see warping at disocclusions, check the camera values handed to FFX: in our integration the FOV given to frame generation was 60 degrees where the title uses 14-38 (the motion vectors were fine: the same texture and scale the title gives its own upscaler).

Section 4, textures that keep old bytes. Two ports cut it for us: telling the textures on the block and on the page's other views when a write fault opens a guarded block (Raptorbk45's fbe18edc, VICTORY_GUARD_TELLS): "changed after its upload with nothing to tell of it" lines went from 27.2/21.8 to about 9 a second and the worst lateness from about 1,950 to 16 frames, picture-neutral otherwise. borntofrag34's issue #66 lists the related ports (ALIAS_WRITES, PARTIAL_WRITTEN, upload-ahead races) with file:line pointers.

White eyes / glowing spots for a few frames. Not proven to be yours, but one cause we found: a 0.5-grey stand-in shown while a new texture uploads lights emissive and glass masks white for 1-3 frames (about half of new texture slots on our route). A stand-in of the slot's kind (black for masks and emission, a flat normal for normal maps) removed those flashes for us.

**@⁠Anzymanz** on GitHub · 2026-12-02 09:11 UTC · [original](https://github.com/readmet3xt-lab/foxhound/issues/362#issuecomment-7340514402) Written with Claude Code. Some data on sections 2 and 4 from another Linux machine (RX 9070 XT, Mesa 26.3.1 RADV, GE-Proton, xmem-line tree, 1440p render, ray tracing off), in case it saves you time. **FG wait.** We see the same thing: with FSR 3.1 FG 2X the render thread waits 18-40 ms a frame in Present, for the previous frame's composition. What we measured: - A presenter thread that takes the proxy Present (and its wait) off the submitting thread: 56.4 -> 51.1 ms a real frame in one in-run A/B. It helps but does not remove the cost. - The rest is FFX itself: in one A/B FG 2X added about 19 ms a base frame, roughly half FFX's own GPU work and half the card standing partly idle. A second present slot and async-compute interpolation both gave nothing. - FFX's default 0.1 ms safety margin holds each real frame for about half an interval. A margin adjusted once a second from measured screen evenness kept about 25 fps rendered while moving, at 0.93 evenness. - If you see warping at disocclusions, check the camera values handed to FFX: in our integration the FOV given to frame generation was 60 degrees where the title uses 14-38 (the motion vectors were fine: the same texture and scale the title gives its own upscaler). **Section 4, textures that keep old bytes.** Two ports cut it for us: telling the textures on the block and on the page's other views when a write fault opens a guarded block (Raptorbk45's `fbe18edc`, `VICTORY_GUARD_TELLS`): "changed after its upload with nothing to tell of it" lines went from 27.2/21.8 to about 9 a second and the worst lateness from about 1,950 to 16 frames, picture-neutral otherwise. borntofrag34's issue #66 lists the related ports (ALIAS_WRITES, PARTIAL_WRITTEN, upload-ahead races) with file:line pointers. **White eyes / glowing spots for a few frames.** Not proven to be yours, but one cause we found: a 0.5-grey stand-in shown while a new texture uploads lights emissive and glass masks white for 1-3 frames (about half of new texture slots on our route). A stand-in of the slot's kind (black for masks and emission, a flat normal for normal maps) removed those flashes for us.
This discussion has been locked. Commenting is limited to contributors.
No description provided.