Fix 12 verified regressions in shader translation, runtime, caching and texture handling #1005

Open
github-bot wants to merge 22 commits from github-bot/gh-1005 into main AGit
Owner

@⁠THE-PRO-GAME on GitHub · 2026-11-24 14:54 UTC · original
THE-PRO-GAME:main → main · +417 −47 · 7 files · 22 commits · open

Summary

This PR addresses 12 reproducible regressions in VIctory, including nine previously identified issues and three newly discovered bugs.

Changes

  • Improve shader translation and selection.
  • Correct texture handling and validation.
  • Improve shader cache reliability.
  • Prevent valid save files from being deleted during recovery.
  • Preserve data and cache directory paths when the working directory changes.
  • Reject incompatible multisampled texture configurations.

Validation

  • 361 tests passed.
  • 0 tests failed.
  • 3 tests skipped due to missing external reference files.
  • Clippy passed.
  • Each regression was reproduced with a failing test before the fix and a passing test afterward.

Notes

These changes were developed with assistance from OpenAI Codex and tested on Windows using synthetic data.

In-game behavior and performance have not been validated.

Related issue: #810

Feedback and technical review are welcome.

I didn’t write a shit for my own 🔥

**@⁠THE-PRO-GAME** on GitHub · 2026-11-24 14:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/1005) `THE-PRO-GAME:main` → `main` · +417 −47 · 7 files · 22 commits · open Summary This PR addresses 12 reproducible regressions in VIctory, including nine previously identified issues and three newly discovered bugs. Changes * Improve shader translation and selection. * Correct texture handling and validation. * Improve shader cache reliability. * Prevent valid save files from being deleted during recovery. * Preserve data and cache directory paths when the working directory changes. * Reject incompatible multisampled texture configurations. Validation * 361 tests passed. * 0 tests failed. * 3 tests skipped due to missing external reference files. * Clippy passed. * Each regression was reproduced with a failing test before the fix and a passing test afterward. Notes These changes were developed with assistance from OpenAI Codex and tested on Windows using synthetic data. In-game behavior and performance have not been validated. Related issue: #810 Feedback and technical review are welcome. I didn’t write a shit for my own 🔥
Resolve the cache root before opening it so later working-directory changes cannot move shader output. Stage writes in random same-directory temporary files to survive abandoned staging files and recycled process IDs. Atomically publish only when the key has no entry, and reuse a file published by a competing writer.
The emitter reads signatures and pipeline metadata alongside the DXIL program. Compare the parsed parts so containers with matching code and distinct metadata both reach translation, and ignore any bytes past an embedded container.
Two shaders from the same file can match the same label substring. Only use vertex or mesh stages for the first selector and pixel stages for the second selector.
Resolve the path before checking the asset policy and opening the cache. The title can change the host working directory after startup, so later cache reads and writes must keep using the original directory.

A synthetic child-process test changes its working directory between opening the cache and converting bytes. It fails on upstream ffe310e and passes with this change.
Use the workspace tempfile library in the destination directory. A process that inherits a previously used PID can now stage a result even when the old process left its first staging file behind. The temporary file also cleans itself up on a write or publication error.

A synthetic child process plants the abandoned filename before converting. The test failed with ERROR_FILE_EXISTS on the prior implementation and now passes.
Publish a staged result atomically without replacing a file created after the initial cache miss. Return the existing entry for the same content-addressed key and still report publication errors that did not leave a file at the destination.

A synthetic converter simulates another writer publishing during conversion. Its entry timestamp was replaced before this change and is preserved after it.
GFX10 permits linear, Z and render swizzles for 1D resources. Reject standard and display modes before computing a layout, while preserving supported modes. A synthetic regression checks both accepted and rejected modes.

Reference: AMD PAL gfx10addrlib.h, Gfx10Rsrc1dSwModeMask.
Thin tiled volumes allocate the whole mip chain in every depth slice. Report that allocation in depth_pitch for ordinary and tail mips while retaining the logical depth of each mip for copies. The regression exercises both mip placements using one synthetic volume.

Reference: AMD PAL gfx10addrlib.cpp, ComputeSurfaceInfoMacroTiled.
GFX10 Z-order swizzles are invalid for block-compressed formats or for elements wider than 64 bits. Validate those cases before computing the layout. The synthetic regression also verifies that a compatible depth format still works.

Reference: AMD PAL gfx10addrlib.cpp, ValidateSwModeParams.
A scan can find the legacy directory and its committed replacement after interrupted cleanup. Sort and deduplicate matching names and paths before enumeration and quota calculation. Cover the first scan with a synthetic committed migration.
Resolve requested cache and data subdirectories to absolute paths before validating and creating them. Late image loading, saves and crash logs retain the returned paths after startup, including when a title changes the host working directory.

A synthetic child process verifies that both paths still point to the created directories after it changes its working directory.
GFX10 does not support MSAA in these two swizzle families. Reject the incompatible descriptors before calculating a layout. Cover 2x, 4x and 8x with synthetic textures and keep valid render and single-sample cases covered.

Reference: AMD PAL gfx10addrlib.cpp, ValidateSwModeParams.
Version cleanup reconstructs directory names from parsed numbers. A leftover v01 directory must not represent the same version as v1 or cleanup will remove the actual saved data. Only accept the decimal names written by commit. Cover a read with both directories present.
Use the audited implementations and regression tests in overlapping files. Keep the display test portability adjustment from the earlier fork pull request.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:16:43 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:12 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 72b9709: cargo test -p victory -p victory-core -p victory-formats -p victory-hle -p victory-pipeline passes, 146 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1005#issuecomment-7135646239) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 72b9709: `cargo test -p victory -p victory-core -p victory-formats -p victory-hle -p victory-pipeline` passes, 146 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

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

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: apps/victory/src/translate.rs, crates/victory-hle/src/modules/xgamesave.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1005#issuecomment-7148604417) <!-- victory-triage v1 head=72b9709675e5f0fd9b2277a61d31718ff8b7c4e9 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `apps/victory/src/translate.rs`, `crates/victory-hle/src/modules/xgamesave.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • apps/victory/src/translate.rs
  • crates/victory-formats/src/texture.rs
  • crates/victory-hle/src/modules/display.rs
  • crates/victory-hle/src/modules/xgamesave.rs
  • crates/victory-pipeline/src/cache.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/1005/head:github-bot/gh-1005'
git switch 'github-bot/gh-1005'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1005'
git switch 'github-bot/gh-1005'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1005'
git switch 'github-bot/gh-1005'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1005'
git switch 'main'
git merge --squash 'github-bot/gh-1005'
git switch 'main'
git merge --ff-only 'github-bot/gh-1005'
git switch 'main'
git merge 'github-bot/gh-1005'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!1005
No description provided.