hle(files): avoid double-prefixing host paths on the mounted drive letter #4468

Open
github-bot wants to merge 1 commit from github-bot/gh-4467 into main AGit
Owner

@⁠minervamagicka on GitHub · 2026-11-30 20:42 UTC · original
minervamagicka:fix/files-same-drive-double-prefix → main · +54 −0 · 1 files · 1 commits · open

What it changes

When the title's host directory resides on a Windows G: volume (for example G:\SteamLibrary\common\Title) and is mounted as the console's virtual G: drive via mount_at('G', root), host or CRT callers that pass an already-rewritten host path back through files::translate have root prepended a second time (G:\SteamLibrary\common\Title\SteamLibrary\common\Title\...), causing file opens to fail on host G: setups.

translate now checks whether rest is already rooted at the mounted drive's host root (matching case-insensitively and across / and \, with a path-separator boundary check so sibling directories such as TitleExtra are still rewritten as title paths) and returns None when it is.

Adds unit test host_paths_on_the_same_drive_letter_are_not_prefixed_twice covering ordinary title paths, sibling prefix-sharing directories, exact root, subpath, forward-slash/lowercase, and \\?\ verbatim forms.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 4090, Series X, 4K / 1440p, DLSS Quality + 2x Frame Generation, title located on a host G: drive
  • Before: paths re-entering translate on a host G: drive were rewritten twice into G:\<root>\<root>\... and failed to open
  • After: title boots and streams cleanly from a host G: drive without double-prefixing
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (HLE file path translation only)
  • cargo test passed for the crates it touches: yes (cargo test -p victory-hle --locked files::tests — 16/16 passed; cargo xtask policy --staged ok; 0 clippy warnings in files.rs)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3140, #3658, #4022 (touch files.rs for overlapped reads and SearchPath, no overlap with translate same-drive prefixing)
**@⁠minervamagicka** on GitHub · 2026-11-30 20:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4467) `minervamagicka:fix/files-same-drive-double-prefix` → `main` · +54 −0 · 1 files · 1 commits · open ## What it changes When the title's host directory resides on a Windows `G:` volume (for example `G:\SteamLibrary\common\Title`) and is mounted as the console's virtual `G:` drive via `mount_at('G', root)`, host or CRT callers that pass an already-rewritten host path back through `files::translate` have `root` prepended a second time (`G:\SteamLibrary\common\Title\SteamLibrary\common\Title\...`), causing file opens to fail on host `G:` setups. `translate` now checks whether `rest` is already rooted at the mounted drive's host `root` (matching case-insensitively and across `/` and `\`, with a path-separator boundary check so sibling directories such as `TitleExtra` are still rewritten as title paths) and returns `None` when it is. Adds unit test `host_paths_on_the_same_drive_letter_are_not_prefixed_twice` covering ordinary title paths, sibling prefix-sharing directories, exact root, subpath, forward-slash/lowercase, and `\\?\` verbatim forms. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 4090, Series X, 4K / 1440p, DLSS Quality + 2x Frame Generation, title located on a host `G:` drive - Before: paths re-entering `translate` on a host `G:` drive were rewritten twice into `G:\<root>\<root>\...` and failed to open - After: title boots and streams cleanly from a host `G:` drive without double-prefixing - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (HLE file path translation only) - `cargo test` passed for the crates it touches: yes (`cargo test -p victory-hle --locked files::tests` — 16/16 passed; `cargo xtask policy --staged` ok; 0 clippy warnings in `files.rs`) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3140, #3658, #4022 (touch `files.rs` for overlapped reads and `SearchPath`, no overlap with `translate` same-drive prefixing)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 20:46:53 +00:00
Author
Owner

@⁠tikD1337 on GitHub · 2026-11-30 20:51 UTC · original

Tested headlessly on origin/main (e1251c31, Windows 11, no game run):

  • Merge check: clean against origin/main.
  • cargo test -p victory-hle -- modules::files: 17 passed, 0 failed (466 filtered), no new warnings.

(AI-assisted build/unit-test check; game runtime not launched.)

**@⁠tikD1337** on GitHub · 2026-11-30 20:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4467#issuecomment-7291562567) Tested headlessly on `origin/main` (`e1251c31`, Windows 11, no game run): - Merge check: clean against `origin/main`. - `cargo test -p victory-hle -- modules::files`: **17 passed, 0 failed** (466 filtered), no new warnings. *(AI-assisted build/unit-test check; game runtime not launched.)*
github-bot force-pushed github-bot/gh-4467 from 8d541b3245 to 9460c9ce3e 2026-12-01 00:40:53 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4467'
git switch 'github-bot/gh-4467'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4467'
git switch 'github-bot/gh-4467'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4467'
git switch 'main'
git merge --squash 'github-bot/gh-4467'
git switch 'main'
git merge --ff-only 'github-bot/gh-4467'
git switch 'main'
git merge 'github-bot/gh-4467'
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/trustno1-coder--VIctory-NVIDIA!4468
No description provided.