Audit fixes #26

Open
github-bot wants to merge 10 commits from github-bot/gh-26 into main AGit
Owner

@⁠R0dbar on GitHub · 2026-11-30 12:14 UTC · original
R0dbar:audit-fixes → main · +145 −157 · 10 files · 10 commits · open

Fixes: FSR crash, setup data loss, PlayStation pads, play blocked by an untranslatable shader

Small, independent fixes found while auditing and playing on an RX 6950 XT
(RDNA2). Every commit stands on its own; nothing here changes how a
translated shader comes out.

Crashes and things that stopped play

  • resolution: leave out a FidelityFX scale the title's FSR 4 cannot take.
    VICTORY_FFX_SCALE=0.67 on 1920x1080 renders 1286x723; the title's FSR 4
    build only takes 1920x1080 rendered at 1280x720, logs a mismatch and then
    divides by zero at +0x28f03e8 (the crash the module's notes already
    describe). The scale is now patched only when it gives exactly that pair
    (VICTORY_FFX_SCALE=0.6666667 with VICTORY_OUTPUT=1920x1080); otherwise
    it and VICTORY_UPSCALER=7 are left out with a message, and the title runs
    its own upscaler. Test: 0.67 gives the 1286x723 the title refused.
  • warm: a known shader that does not translate no longer stops play.
    Preparation repaired the translation of every known shader and counted
    every pipeline without a native one as missing; once a run had noted a
    shader that does not translate, play failed for good ("rerun play to
    resume"). Such shaders are now left out of the repair and their pipelines
    are tried again next time instead of counting as missing.
  • descriptor: stand-in copies off unless VICTORY_STAND_IN=1, read once.
    stand_in copies from a shader-visible slot, which vkd3d-proton's RDNA2
    descriptor layout crashes on in CopyDescriptorsSimple
    (d3d12core.dll+0xf94f). The switch is read once: stand_in runs each
    time a texture slot changes.

Setup and tools

  • setup: PlayStation and Switch pads reach XInput. Through Wine's hidraw
    backend a DualShock 4 is raw HID only, so XInput (all gameinput reads)
    had no pad and the keyboard's stand-in drove the title. The prefix step
    sets winebus DisableHidraw=1, so SDL takes the pad and maps it to XInput
    (checked with an XInput probe in the game's sandbox: slot 0 connected).
    Existing prefixes get it with ./setup.sh prefix.
  • setup: the wine step keeps unsaved deps/wine edits, like the others.
    source_of stopped before a reset over edits tools/patch.sh had not
    saved; step_wine did not, so a Wine upgrade wiped them. Both share
    keep_edits now.
  • setup: amdxcffx64.dll for FSR 4 from AMD itself, its signature
    checked.
    fsr4 takes AMDXCFFX64=<the DLL, or the Adrenalin installer it ships in> and installs it only if its Authenticode signature verifies
    and the signer is Advanced Micro Devices, instead of downloading it from a
    third party. README updated.
  • patch.sh: names new files the patch leaves out (git add -u never
    staged them; not git add -A, which would take build leftovers such as
    vkd3d's subprojects/.wraplock).
  • policy: 1 MiB file limit. emit/lower.rs is 887 KiB, past the old
    640 KiB, so cargo xtask policy and its test failed on every checkout. The
    "too big" test passed only through the encoded-run check; it now tests the
    size.

Clean-up

  • descriptor: drop the raw-twin path no branch reaches. Since
    records::on() went, buffer_srv/buffer_uav read
    if let Some(twin) = twin {..} else if let Some(twin) = twin {..}; the
    second branch never ran. Gone with it: twin_window and its test, the
    TWINS counters and their frame line. move_raw is test-only now.
  • clippy: a no-op | 0 and an unwrap after is_some.

Checked

  • cargo xtask policy, cargo test -p xtask (9/9), victory-shader tests.
  • cargo clippy (release, Windows target): no new warnings.
  • resolution tests under Wine (6/6, one new).
  • Played: play after a run that noted untranslatable shaders (preparation
    now ends: "2215 known shaders do not translate: left out").
  • Pads: an XInput probe run in the game's sandbox reports slot 0 connected
    with a DualShock 4 over USB.
  • Not played: the FSR 4 path with VICTORY_FFX_SCALE=0.6666667 (covered by
    the new test only).
**@⁠R0dbar** on GitHub · 2026-11-30 12:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/26) `R0dbar:audit-fixes` → `main` · +145 −157 · 10 files · 10 commits · open # Fixes: FSR crash, setup data loss, PlayStation pads, play blocked by an untranslatable shader Small, independent fixes found while auditing and playing on an RX 6950 XT (RDNA2). Every commit stands on its own; nothing here changes how a translated shader comes out. ## Crashes and things that stopped play - **resolution: leave out a FidelityFX scale the title's FSR 4 cannot take.** `VICTORY_FFX_SCALE=0.67` on 1920x1080 renders 1286x723; the title's FSR 4 build only takes 1920x1080 rendered at 1280x720, logs a mismatch and then divides by zero at `+0x28f03e8` (the crash the module's notes already describe). The scale is now patched only when it gives exactly that pair (`VICTORY_FFX_SCALE=0.6666667` with `VICTORY_OUTPUT=1920x1080`); otherwise it and `VICTORY_UPSCALER=7` are left out with a message, and the title runs its own upscaler. Test: `0.67` gives the 1286x723 the title refused. - **warm: a known shader that does not translate no longer stops play.** Preparation repaired the translation of every known shader and counted every pipeline without a native one as missing; once a run had noted a shader that does not translate, `play` failed for good ("rerun play to resume"). Such shaders are now left out of the repair and their pipelines are tried again next time instead of counting as missing. - **descriptor: stand-in copies off unless `VICTORY_STAND_IN=1`, read once.** `stand_in` copies from a shader-visible slot, which vkd3d-proton's RDNA2 descriptor layout crashes on in `CopyDescriptorsSimple` (`d3d12core.dll+0xf94f`). The switch is read once: `stand_in` runs each time a texture slot changes. ## Setup and tools - **setup: PlayStation and Switch pads reach XInput.** Through Wine's hidraw backend a DualShock 4 is raw HID only, so XInput (all `gameinput` reads) had no pad and the keyboard's stand-in drove the title. The prefix step sets winebus `DisableHidraw=1`, so SDL takes the pad and maps it to XInput (checked with an XInput probe in the game's sandbox: slot 0 connected). Existing prefixes get it with `./setup.sh prefix`. - **setup: the wine step keeps unsaved `deps/wine` edits, like the others.** `source_of` stopped before a reset over edits `tools/patch.sh` had not saved; `step_wine` did not, so a Wine upgrade wiped them. Both share `keep_edits` now. - **setup: `amdxcffx64.dll` for FSR 4 from AMD itself, its signature checked.** `fsr4` takes `AMDXCFFX64=<the DLL, or the Adrenalin installer it ships in>` and installs it only if its Authenticode signature verifies and the signer is Advanced Micro Devices, instead of downloading it from a third party. README updated. - **patch.sh: names new files the patch leaves out** (`git add -u` never staged them; not `git add -A`, which would take build leftovers such as vkd3d's `subprojects/.wraplock`). - **policy: 1 MiB file limit.** `emit/lower.rs` is 887 KiB, past the old 640 KiB, so `cargo xtask policy` and its test failed on every checkout. The "too big" test passed only through the encoded-run check; it now tests the size. ## Clean-up - **descriptor: drop the raw-twin path no branch reaches.** Since `records::on()` went, `buffer_srv`/`buffer_uav` read `if let Some(twin) = twin {..} else if let Some(twin) = twin {..}`; the second branch never ran. Gone with it: `twin_window` and its test, the `TWINS` counters and their frame line. `move_raw` is test-only now. - **clippy:** a no-op `| 0` and an `unwrap` after `is_some`. ## Checked - `cargo xtask policy`, `cargo test -p xtask` (9/9), `victory-shader` tests. - `cargo clippy` (release, Windows target): no new warnings. - `resolution` tests under Wine (6/6, one new). - Played: `play` after a run that noted untranslatable shaders (preparation now ends: "2215 known shaders do not translate: left out"). - Pads: an XInput probe run in the game's sandbox reports slot 0 connected with a DualShock 4 over USB. - Not played: the FSR 4 path with `VICTORY_FFX_SCALE=0.6666667` (covered by the new test only).
VICTORY_FFX_SCALE=0.67 on 1920x1080 renders 1286x723; the title's FSR 4
build takes only 1920x1080 rendered at 1280x720, says so, and divides by
zero at +0x28f03e8 (three crashes in crashes.log). The scale is now
patched only when it gives exactly that pair (VICTORY_FFX_SCALE=0.6666667
with VICTORY_OUTPUT=1920x1080); otherwise it and VICTORY_UPSCALER=7 are
left out, said why, and the title runs its own upscaler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
emit/lower.rs is 887 KiB, past the 640 KiB limit, so cargo xtask policy
and its test failed on every file list. The 'too big' test passed only
through the encoded-run check (600 KiB of one letter); it now uses short
lines, so only the size refuses it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
source_of stopped before a reset over edits tools/patch.sh had not saved;
step_wine did not, so a Wine upgrade wiped them. Both share keep_edits
now. When wine.patch does not apply, um-patch is reset with the tree, so
the next run does not take the old patch for edits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
git add -u stages only tracked files, so a new file in deps/<name> never
reached the patch and a fresh setup would miss it. Not git add -A: build
leftovers such as vkd3d's subprojects/.wraplock would go in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The working tree's change (it copies from a shader-visible slot, which
vkd3d-proton's RDNA2 descriptor layout crashes on in CopyDescriptorsSimple:
d3d12core.dll+0xf94f in crashes.log), with the switch read once: stand_in
runs each time a texture slot changes, and each read took the process's
environment lock and allocated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since records::on() went (2773fdf), buffer_srv and buffer_uav read
'if let Some(twin) = twin { .. } else if let Some(twin) = twin { .. }':
the second branch never runs. Gone with it: twin_window and its test, the
TWINS counters and their frame line, which only that branch counted.
move_raw is now test-only (the card measurement in indirect uses it).
Nothing that runs changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Through Wine's hidraw backend a DualShock 4 is raw HID only (no IG_
device), so XInput, all gameinput reads, has no pad and the keyboard's
stand-in drives the title. With hidraw off, SDL takes the pad and maps
it to XInput: checked with a probe in the game's sandbox, slot 0
connected. Set on every prefix step, so existing prefixes get it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preparation repaired the translation of every shader the title ever
used, and counted every pipeline without a native one as missing; both
stopped play ('rerun play to resume', for good) once a run had noted a
shader that does not translate. Such shaders are now left out of the
repair, and their pipelines (no host pipeline) are not missing: they are
tried again next time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fsr4 no longer downloads the driver DLL from a third party's page. It
takes AMDXCFFX64=<the DLL, or the Adrenalin installer it ships in>,
extracts it from the installer if need be (7z), and installs it only if
osslsigncode verifies its Authenticode signature and the signer is
Advanced Micro Devices; with neither the variable nor a DLL already
installed it says where to get one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:41:35 +00:00
Author
Owner

@⁠SyBozz on GitHub · 2026-11-30 16:55 UTC · original

My understanding is that this is a proton problem / thing as steams brings controller into the games with their controller tool.

running wine control joy.cpl shows it working fine under system / normal wine while proton (including the wine from proton) does not work.

So I would suggest to only do the reg edit if any proton version is used as I'm not sure if it would break something under normal wine.

**@⁠SyBozz** on GitHub · 2026-11-30 16:55 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/26#discussion_r4742530355) My understanding is that this is a proton problem / thing as steams brings controller into the games with their controller tool. running `wine control joy.cpl` shows it working fine under system / normal wine while proton (including the wine from proton) does not work. So I would suggest to only do the reg edit if any proton version is used as I'm not sure if it would break something under normal wine.
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:00 UTC · original

There is real value in this PR, but as one PR it will not land: it flips a global default, rewrites setup.sh, and carries ten unrelated commits. Split it into three or four, in this order.

  1. Warm-up + FFX guard (the two genuinely useful fixes): crates/victory-gpu/src/pipeline/known.rs:426-466 skipping shaders that do not translate is the right call for playability but loses the diagnostic — keep the skip and log each hash once at debug level. crates/victory-loader/src/resolution.rs:106-121 hardcodes the one size pair the title accepts and silently drops VICTORY_UPSCALER=7 otherwise; the test is good, the user-facing warning is not.
  2. Tooling and clippy bits: policy cap with its test, tools/patch.sh untracked-file reporting, draw.rs:1704. Uncontroversial on their own.
  3. The stand-in default flip, separately: crates/victory-gpu/src/descriptor/host.rs:3037-3048 now returns false unless VICTORY_STAND_IN=1. That turns a workaround for a specific vkd3d-proton 64_16_packed bug into a behaviour change for every user, and VICTORY_STAND_IN appears in no doc and no run.conf.default line — so nobody can discover they need it. Either document it, or gate it on the driver actually being detected.

The last one is the only part that needs a decision from the maintainer; the first two are mergeable on their own.

**@⁠Luxuride** on GitHub · 2026-12-04 12:00 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/26#issuecomment-7410836117) There is real value in this PR, but as one PR it will not land: it flips a global default, rewrites `setup.sh`, and carries ten unrelated commits. **Split it** into three or four, in this order. 1. **Warm-up + FFX guard** (the two genuinely useful fixes): `crates/victory-gpu/src/pipeline/known.rs:426-466` skipping shaders that do not translate is the right call for playability but loses the diagnostic — keep the skip and log each hash once at debug level. `crates/victory-loader/src/resolution.rs:106-121` hardcodes the one size pair the title accepts and silently drops `VICTORY_UPSCALER=7` otherwise; the test is good, the user-facing warning is not. 2. **Tooling and clippy bits**: policy cap with its test, `tools/patch.sh` untracked-file reporting, `draw.rs:1704`. Uncontroversial on their own. 3. **The stand-in default flip, separately**: `crates/victory-gpu/src/descriptor/host.rs:3037-3048` now returns `false` unless `VICTORY_STAND_IN=1`. That turns a workaround for a specific vkd3d-proton `64_16_packed` bug into a behaviour change for every user, and `VICTORY_STAND_IN` appears in no doc and no `run.conf.default` line — so nobody can discover they need it. Either document it, or gate it on the driver actually being detected. The last one is the only part that needs a decision from the maintainer; the first two are mergeable on their own.
This pull request has changes conflicting with the target branch.
  • README.md
  • apps/victory/src/warm.rs
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/pipeline/known.rs
  • crates/victory-loader/src/resolution.rs
  • setup.sh
  • tools/patch.sh
  • xtask/src/policy.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/26/head:github-bot/gh-26'
git switch 'github-bot/gh-26'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-26'
git switch 'github-bot/gh-26'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-26'
git switch 'github-bot/gh-26'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-26'
git switch 'main'
git merge --squash 'github-bot/gh-26'
git switch 'main'
git merge --ff-only 'github-bot/gh-26'
git switch 'main'
git merge 'github-bot/gh-26'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.