HLE: match Windows executable paths case- and separator-insensitively on relaunch #3464
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3464"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by alexandruiulian201-bot on 2026-11-27T03:49:16Z.
Problem
In
crates/victory-hle/src/modules/xgame.rs,relaunch_argsmatches the startup executable argument againstcurrent(runtime::image_path) using exactOsStrequality. On Windows, if the user launchedvictory runwith different ASCII casing or forward slashes (for example,g:/game/gta6.exevsG:\Game\GTA6.exe), the executable slot is not matched andXLaunchNewGamerelaunches the original executable instead ofexe.Fix
same_pathhelper that compares paths case-insensitively (ASCII) and treats/and\equivalently on Windows, while keeping exact comparison on non-Windows targets.same_pathinrelaunch_argsfor both direct andstd::path::absolute-normalized comparisons.a_relaunch_matches_windows_executable_paths_case_and_separator_insensitively.Verification
cargo test -p victory-hle --lib --locked modules::xgame::tests::: all passed.cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean.cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings: clean.cargo run -p xtask --locked -- policy:191 files ok.AI-assisted. Synthetic unit test only (no game files used).
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T04:17:20Z.
Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, per-worktree CARGO_TARGET_DIR, CARGO_BUILD_JOBS=2, no game data).
1322d45f, base63bcca4.cargo test --locked -p victory-hle --lib -- modules::xgame::tests::a_relaunch_matches_windows_executable_paths_case_and_separator_insensitively --exact --test-threads=1 --quiet->test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 152 filtered out.git diff --check 63bcca4 HEAD-> exit 0.63bcca4viagit grepon the file (no output, exit 1).Note: only the named synthetic path test was replayed; a full crate suite was not run. The bare test name matches 0 tests; the module-qualified name is required. GPU/driver: N/A. AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM.
Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-27T10:24:48Z.
Review: COMMENTED
I don't think the mismatch this fixes can happen at runtime.
currentisstd::path::absoluteof the very argumentrelaunch_argssearches for:run.rs:85records thevictory runargument withset_image_path(image.base(), exe), andruntime.rs:29storesstd::path::absolute(path).launch_new_gamethen compares it withargs_os(), which holds that same argument.main, the second check (xgame.rs:113,std::path::absolute(a) == current) already matchesg:/game/gta6.exe: both sides are the sameGetFullPathNameWresult, with the same case and\separators. The new test builds acurrent(G:\Game\GTA6.exe) that the runtime never produces from that argument.Unless there's a path where the image path is recorded differently from the launch argument, this is a guard for a case that doesn't occur. If there is one, a test that goes through
set_image_pathwould show it.Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-11-27T18:53:34Z.
I ran the Windows CLI on
1322d45f5a9e220ae7a1b1759f38242e87ae6d3cand parent63bcca43c6a00a758510398fa43096ce7e4f7df0. A synthetic guest A asks XLaunchNewGame to start guest B. B returns 73 only if its new argument arrived and the original one was removed. Direct controls distinguish an accidentally restarted A (41) and B with stale arguments (74).Both builds launched B with marker 73 in all four cases: absolute, mixed-case relative with mixed separators, mixed-case absolute with forward slashes, and verbatim absolute paths. All three marker controls also passed. The ordinary startup path derives the saved image path from the CLI input. This verifies the relaunch end to end but did not produce a parent failure; a real producer of differing spellings would still help establish when this patch changes behavior.
Synthetic fixture. GTA-VI-3/EIGHT-20261127. AI-assisted with Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.