HLE: handle verbatim/drive-root mounts and UNC/verbatim GetDiskFreeSpaceW roots #1772

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

@⁠n-romanovich on GitHub · 2026-11-24 22:17 UTC · original
n-romanovich:fix/hle-files-verbatim-and-volume-roots → main · +122 −24 · 1 files · 1 commits · open

Fixes #1742

Fixes virtual-drive path translation and volume-root extraction in crates/victory-hle/src/modules/files.rs:

  • Keep the trailing \ on verbatim drive-root mounts (\\?\C:\) in root_wide() and verbatim().
  • Route \\?\-mounted roots and \\?\ title paths through verbatim() so / and ./.. are normalized and \\?\ is never prepended twice; avoid doubling separators on plain drive-root mounts (C:\).
  • Extract volume roots in GetDiskFreeSpaceW via volume_root() for C:\, \\?\C:\, \\server\share\, and \\?\UNC\server\share\.
  • Add synthetic unit tests verbatim_and_drive_root_mounts_translate_cleanly and volume_root_extracts_drive_and_unc_roots.

AI-assisted; verified with cargo test -p victory-hle --locked (101 passed) and cargo clippy -p victory-hle --all-targets --locked.

**@⁠n-romanovich** on GitHub · 2026-11-24 22:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772) `n-romanovich:fix/hle-files-verbatim-and-volume-roots` → `main` · +122 −24 · 1 files · 1 commits · open Fixes #1742 Fixes virtual-drive path translation and volume-root extraction in `crates/victory-hle/src/modules/files.rs`: - Keep the trailing `\` on verbatim drive-root mounts (`\\?\C:\`) in `root_wide()` and `verbatim()`. - Route `\\?\`-mounted roots and `\\?\` title paths through `verbatim()` so `/` and `.`/`..` are normalized and `\\?\` is never prepended twice; avoid doubling separators on plain drive-root mounts (`C:\`). - Extract volume roots in `GetDiskFreeSpaceW` via `volume_root()` for `C:\`, `\\?\C:\`, `\\server\share\`, and `\\?\UNC\server\share\`. - Add synthetic unit tests `verbatim_and_drive_root_mounts_translate_cleanly` and `volume_root_extracts_drive_and_unc_roots`. AI-assisted; verified with `cargo test -p victory-hle --locked` (101 passed) and `cargo clippy -p victory-hle --all-targets --locked`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:10 +00:00
Author
Owner

@⁠DesertGamer on GitHub · 2026-11-24 22:23 UTC · original

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

**@⁠DesertGamer** on GitHub · 2026-11-24 22:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7146172273) ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:35 UTC · original · edited 2026-11-25 02:28 UTC

Automated triage for the maintainers.

Recommended for a maintainer's look. In crates/victory-hle/src/modules/files.rs, translate now sends any title \\?\ path, or any mount whose root is itself \\?\, through verbatim(). That removes the doubled \\?\ prefix, converts / and resolves ./.. there, and produces \\?\UNC\... for UNC roots. root_wide and verbatim keep the backslash of a \\?\C:\ root, a C:\ mount no longer doubles separators, and GetDiskFreeSpaceW reduces verbatim and UNC paths to their volume root through the new volume_root. I traced each case in the new tests against the code and they hold; the bugs are as described in #1742. One small thing: the long strip_prefix line in volume_root is not rustfmt-formatted (CI does not run cargo fmt). CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7149733214) · edited 2026-11-25 02:28 UTC <!-- victory-triage v1 head=92bc933761d83c0c40be837423b2af7ce5cd41c2 verdict=merge-candidate at=2026-11-25T02:20:29Z --> Automated triage for the maintainers. Recommended for a maintainer's look. In `crates/victory-hle/src/modules/files.rs`, `translate` now sends any title `\\?\` path, or any mount whose root is itself `\\?\`, through `verbatim()`. That removes the doubled `\\?\` prefix, converts `/` and resolves `.`/`..` there, and produces `\\?\UNC\...` for UNC roots. `root_wide` and `verbatim` keep the backslash of a `\\?\C:\` root, a `C:\` mount no longer doubles separators, and `GetDiskFreeSpaceW` reduces verbatim and UNC paths to their volume root through the new `volume_root`. I traced each case in the new tests against the code and they hold; the bugs are as described in #1742. One small thing: the long `strip_prefix` line in `volume_root` is not rustfmt-formatted (CI does not run `cargo fmt`). CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 01:45 UTC · original

@⁠Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.

**@⁠n-romanovich** on GitHub · 2026-11-25 01:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7149925932) @⁠Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 02:29 UTC · original

Independent run on 92bc933, Windows 10 19045 (x64), current suite:

cargo test -p victory-hle --lib --locked — 145 passed, 0 failed. The suite has grown since your run (101 then), so the two new tests plus all existing ones are green here too. mergeable: true from GitHub on this head; the triage verdict from 02:20 was merge-candidate. Nothing in the diff looks off to me: the volume_root cases cover C:\, \\?\C:\, \\server\share\, \\?\UNC\…, and a relative path falls through to the host call unchanged, which is what Windows does.

**@⁠Calvix2k** on GitHub · 2026-11-25 02:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7150794715) Independent run on `92bc933`, Windows 10 19045 (x64), current suite: `cargo test -p victory-hle --lib --locked` — **145 passed, 0 failed**. The suite has grown since your run (101 then), so the two new tests plus all existing ones are green here too. `mergeable: true` from GitHub on this head; the triage verdict from 02:20 was merge-candidate. Nothing in the diff looks off to me: the `volume_root` cases cover `C:\`, `\\?\C:\`, `\\server\share\`, `\\?\UNC\…`, and a relative path falls through to the host call unchanged, which is what Windows does.
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-25 02:32 UTC · original

Independent Windows validation on 940d32f and this PR at 92bc933. I canonicalized a temporary directory to get a verbatim host mount and exercised the real Win32 calls through our HLE wrappers.

Synthetic check Upstream With #1772
Open a fixture using forward slashes and a dot segment Fail Pass
Open the fixture using an extended virtual-drive path Fail Pass
Query free space using a plain virtual-drive root Pass Pass
Query free space using an extended virtual-drive root Fail Pass

cargo test -p victory-hle --locked --lib -- --test-threads=1 with the local probe: 146 passed, 0 failed. The fixture was generated locally. No game files or network shares were used.

Merge overlap: Git reports a conflict between this head and #421 (83b2037) in files.rs. Both route an already-extended title path through verbatim(). One explicit behavior to preserve or decide when resolving the overlap is #421's trailing separator for a bare extended virtual drive mounted to a host subdirectory. #1772 separately covers canonicalized host roots and volume queries.

AI-assisted (OpenAI Codex).

**@⁠BaggyALPHA** on GitHub · 2026-11-25 02:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7150848913) Independent Windows validation on `940d32f` and this PR at `92bc933`. I canonicalized a temporary directory to get a verbatim host mount and exercised the real Win32 calls through our HLE wrappers. | Synthetic check | Upstream | With #1772 | | --- | --- | --- | | Open a fixture using forward slashes and a dot segment | Fail | Pass | | Open the fixture using an extended virtual-drive path | Fail | Pass | | Query free space using a plain virtual-drive root | Pass | Pass | | Query free space using an extended virtual-drive root | Fail | Pass | `cargo test -p victory-hle --locked --lib -- --test-threads=1` with the local probe: **146 passed, 0 failed**. The fixture was generated locally. No game files or network shares were used. Merge overlap: Git reports a conflict between this head and #421 (`83b2037`) in `files.rs`. Both route an already-extended title path through `verbatim()`. One explicit behavior to preserve or decide when resolving the overlap is #421's trailing separator for a bare extended virtual drive mounted to a host subdirectory. #1772 separately covers canonicalized host roots and volume queries. AI-assisted (OpenAI Codex).
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:09 UTC · original

Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at 92bc933. cargo test --workspace --locked --no-fail-fast -> 698 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7157943197) **Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24.** Branch at `92bc933`. `cargo test --workspace --locked --no-fail-fast` -> 698 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:41 UTC · original

Code review and Windows 11 verification at head 92bc933761d8 merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-hle/src/modules/files.rs:89-196, 434-490):
    • Preserves trailing \ for \\?\X:\ (min_len = 7) and X:\ (min_len = 3), routes !prefix.is_empty() || root.starts_with(&VERBATIM) || len >= LONG through verbatim(root, tail) so . and .. fold cleanly without escaping the mount root, strips duplicate leading separators on short drive-root mounts (C:\ + foo), and volume_root handles \\?\UNC\server\share\, \\?\C:\, \\server\share\, and C:\ cleanly.
    • Two minor non-blocking notes: \\?\UNC\ matching in volume_root is case-sensitive, and an empty tail on a \\?\UNC\server\share\ mount does not re-add a trailing \.
  • Verified (Windows 11, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-hle --tests -- -D warnings: 0 warnings
    • cargo test --locked -p victory-hle -- --test-threads=1: 156/156 passed (154 lib + fidelityfx + no_dll_planting).

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/1772#issuecomment-7180031416) Code review and Windows 11 verification at head `92bc933761d8` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-hle/src/modules/files.rs:89-196, 434-490`)**: - Preserves trailing `\` for `\\?\X:\` (`min_len = 7`) and `X:\` (`min_len = 3`), routes `!prefix.is_empty() || root.starts_with(&VERBATIM) || len >= LONG` through `verbatim(root, tail)` so `.` and `..` fold cleanly without escaping the mount root, strips duplicate leading separators on short drive-root mounts (`C:\` + `foo`), and `volume_root` handles `\\?\UNC\server\share\`, `\\?\C:\`, `\\server\share\`, and `C:\` cleanly. - Two minor non-blocking notes: `\\?\UNC\` matching in `volume_root` is case-sensitive, and an empty tail on a `\\?\UNC\server\share\` mount does not re-add a trailing `\`. - **Verified (Windows 11, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-hle --tests -- -D warnings`: 0 warnings - `cargo test --locked -p victory-hle -- --test-threads=1`: **156/156 passed** (154 lib + `fidelityfx` + `no_dll_planting`). LGTM.
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/1772/head:github-bot/gh-1772'
git switch 'github-bot/gh-1772'

Merge

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