victory play: keep network shares when stripping verbatim paths (#1072) #1076

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

@⁠cloph-dsp on GitHub · 2026-11-28 12:51 UTC · original
cloph-dsp:fix/unc-verbatim-path → main · +21 −3 · 1 files · 1 commits · open

Depends on: #1072

What

victory play canonicalizes the executable path and strips \\?\. On Windows, canonicalize returns \\?\UNC\server\share\... for a network path, so stripping only the prefix leaves the invalid UNC\server\share\.... This adds a small plain_path helper that maps \\?\UNC\... back to \\... while keeping the existing \\?\C:\... → C:\... behaviour, and uses it right after canonicalize.

Change

  • apps/victory/src/play.rs: new plain_path(PathBuf) -> PathBuf; prepare now calls it on the canonicalized path.
  • apps/victory/src/play.rs tests: verbatim_paths_keep_the_network_share covers the UNC form, the drive-letter form and an already-plain UNC path.

Validation

Windows, Rust 1.100.0/MSVC, --locked, per-worktree CARGO_TARGET_DIR (target-unc-path), CARGO_BUILD_JOBS=2:

  • cargo test --locked -p victory --bin victory -- play::tests::verbatim_paths_keep_the_network_share --exact --test-threads=1 --quiet → 1 passed, 0 failed, 26 filtered, exit 0.
  • cargo test --locked -p victory --bin victory -- play::tests --test-threads=1 --quiet → 12 passed, 0 failed, 15 filtered, exit 0.
  • git diff --check clean (1 file, +21/-3).

Only synthetic path strings were used. GPU/driver: N/A (path handling only). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-28 12:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1076) `cloph-dsp:fix/unc-verbatim-path` → `main` · +21 −3 · 1 files · 1 commits · open Depends on: #1072 ## What `victory play` canonicalizes the executable path and strips `\\?\`. On Windows, `canonicalize` returns `\\?\UNC\server\share\...` for a network path, so stripping only the prefix leaves the invalid `UNC\server\share\...`. This adds a small `plain_path` helper that maps `\\?\UNC\...` back to `\\...` while keeping the existing `\\?\C:\...` → `C:\...` behaviour, and uses it right after `canonicalize`. ## Change - `apps/victory/src/play.rs`: new `plain_path(PathBuf) -> PathBuf`; `prepare` now calls it on the canonicalized path. - `apps/victory/src/play.rs` tests: `verbatim_paths_keep_the_network_share` covers the UNC form, the drive-letter form and an already-plain UNC path. ## Validation Windows, Rust 1.100.0/MSVC, `--locked`, per-worktree `CARGO_TARGET_DIR` (`target-unc-path`), `CARGO_BUILD_JOBS=2`: - `cargo test --locked -p victory --bin victory -- play::tests::verbatim_paths_keep_the_network_share --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 26 filtered, exit 0. - `cargo test --locked -p victory --bin victory -- play::tests --test-threads=1 --quiet` → 12 passed, 0 failed, 15 filtered, exit 0. - `git diff --check` clean (1 file, +21/-3). Only synthetic path strings were used. GPU/driver: N/A (path handling only). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:32:35 +00:00
Author
Owner

@⁠jptorres96 on GitHub · 2026-11-28 14:30 UTC · original

Checked this at 467d074 (base 63b902f) on Windows build 26300 with rustc 1.98.1, against a real UNC path. The admin share \\localhost\C$ gives one without any network.

I added a throwaway test, not for commit, that runs \\localhost\C$\Windows\System32\notepad.exe through std::fs::canonicalize. It then compares the old strip with plain_path:

canonical \\?\UNC\localhost\C$\Windows\System32\notepad.exe
old       UNC\localhost\C$\Windows\System32\notepad.exe (is_file false)
new       \\localhost\C$\Windows\System32\notepad.exe (is_file true)
drive     C:\Windows\System32\notepad.exe (is_file true)

So on a real share #1072 reproduces exactly as reported, and this fixes it. new.parent() is \\localhost\C$\Windows\System32, which is all prepare and mod_dlls take from the path. Nothing else in play.rs assumes a drive letter: the other uses of the path go through parent(), and census.rs uses canonicalize only as an identity.

  • cargo test --locked -p victory --bin victory -- play::tests --test-threads=1: 12/12, plus the throwaway one.
  • cargo clippy -p victory --all-targets --no-deps -- -D warnings: clean.

Two small notes:

  • A path that isn't valid UTF-8 now keeps its \\?\ prefix, because to_str() gives None. Before, to_string_lossy stripped it. A verbatim path still opens, so this is harmless.
  • #93 (Caasares, 2026-11-27) makes the same fix, without_verbatim_prefix, but it is based on 29d8dbf and no longer merges cleanly on 63b902f (conflict in play.rs). One of the two can be closed when the other lands.

No game files.

**@⁠jptorres96** on GitHub · 2026-11-28 14:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1076#issuecomment-7240718675) Checked this at `467d074` (base `63b902f`) on Windows build 26300 with rustc 1.98.1, against a real UNC path. The admin share `\\localhost\C$` gives one without any network. I added a throwaway test, not for commit, that runs `\\localhost\C$\Windows\System32\notepad.exe` through `std::fs::canonicalize`. It then compares the old strip with `plain_path`: ``` canonical \\?\UNC\localhost\C$\Windows\System32\notepad.exe old UNC\localhost\C$\Windows\System32\notepad.exe (is_file false) new \\localhost\C$\Windows\System32\notepad.exe (is_file true) drive C:\Windows\System32\notepad.exe (is_file true) ``` So on a real share #1072 reproduces exactly as reported, and this fixes it. `new.parent()` is `\\localhost\C$\Windows\System32`, which is all `prepare` and `mod_dlls` take from the path. Nothing else in `play.rs` assumes a drive letter: the other uses of the path go through `parent()`, and `census.rs` uses `canonicalize` only as an identity. - `cargo test --locked -p victory --bin victory -- play::tests --test-threads=1`: 12/12, plus the throwaway one. - `cargo clippy -p victory --all-targets --no-deps -- -D warnings`: clean. Two small notes: - A path that isn't valid UTF-8 now keeps its `\\?\` prefix, because `to_str()` gives `None`. Before, `to_string_lossy` stripped it. A verbatim path still opens, so this is harmless. - #93 (Caasares, 2026-11-27) makes the same fix, `without_verbatim_prefix`, but it is based on `29d8dbf` and no longer merges cleanly on `63b902f` (conflict in `play.rs`). One of the two can be closed when the other lands. No game files.
Author
Owner

@⁠anastasesg on GitHub · 2026-11-28 14:54 UTC · original

Tested #1076 (commit 467d0746, built from the PR head) on Windows 11, RTX 5070, with the game dump on an SMB share. victory play \192.168.1.104\dumps\…\game_scarlett_master.exe now starts the game. The play log shows the dump mapped as \192.168.1.104\dumps\… and no UNC\… path anywhere. Before the change it stopped on UNC\192.168.1.104\…. Nothing else in play broke on the network path in this run. Thanks for the quick fix.

**@⁠anastasesg** on GitHub · 2026-11-28 14:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1076#issuecomment-7241027744) Tested #1076 (commit 467d0746, built from the PR head) on Windows 11, RTX 5070, with the game dump on an SMB share. victory play \\192.168.1.104\dumps\…\game_scarlett_master.exe now starts the game. The play log shows the dump mapped as \\192.168.1.104\dumps\… and no UNC\… path anywhere. Before the change it stopped on UNC\192.168.1.104\…. Nothing else in play broke on the network path in this run. Thanks for the quick fix.
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.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/1076/head:github-bot/gh-1076'
git switch 'github-bot/gh-1076'

Merge

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