[BUNDLE] Bridge for #1368 and #1386: one storage test changes when both land, stacked on both #1521

Closed
github-bot wants to merge 64 commits from gh-pr/1521/head into gh-pr/1521/base
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 18:43 UTC · original
MamaLeVrai:bundle/hle-bridge → main · +3034 −277 · 21 files · 64 commits · closed without merging

A one-line bridge between two bundles. #1368 and #1386 each pass all checks alone on main. Merged together, one test fails, so this PR is those two bundles merged plus the one change that makes them agree. Rebuilt on the new main (70564ae): it now carries the new tip of #1386, which has main merged in (see there for the one conflict).

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a [BUNDLE] PR. It is stacked on #1368 and #1386, so its diff shows both until they land.

What fails

modules::storage::tests::the_path_is_the_drive_root_and_its_nul (added by #1193, in #1386) asserts that a null buffer leaves used untouched:

assert!(path(this, size, std::ptr::null_mut(), &mut used) < 0);
assert_eq!(used, usize::MAX, "nothing written");

#446 (in #1368) changes put_string so that the string getters report the required size, NUL included, even when the buffer is missing (the same change that made me adapt a test of #1199 inside #1368). With both merged, used is the size, so the assertion fails.

The change

One assertion, in modules/storage.rs: it now expects the required size.

assert_eq!(used, size, "the required size is reported");

If the maintainer prefers the old behaviour for this getter, the other way out is to leave #446 out of #1368 and keep #1193's assertion.

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 541 passed, 0 failed, 7 ignored (two runs; main: 476 passed, 7 ignored)

All the bundles of the index #1495 (17 branches, 195 PRs) also merge together without a textual conflict; this is the only test that fails when they are all merged, which is why this bridge exists. The title was not run.

Re-verify

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/hle-bridge
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

**@⁠MamaLeVrai** on GitHub · 2026-11-24 18:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/1521) `MamaLeVrai:bundle/hle-bridge` → `main` · +3034 −277 · 21 files · 64 commits · closed without merging **A one-line bridge between two bundles.** #1368 and #1386 each pass all checks alone on `main`. Merged together, one test fails, so this PR is those two bundles merged plus the one change that makes them agree. Rebuilt on the new `main` (`70564ae`): it now carries the new tip of #1386, which has `main` merged in (see there for the one conflict). > For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a `[BUNDLE]` PR. It is stacked on #1368 and #1386, so its diff shows both until they land. ## What fails `modules::storage::tests::the_path_is_the_drive_root_and_its_nul` (added by #1193, in #1386) asserts that a null buffer leaves `used` untouched: ```rust assert!(path(this, size, std::ptr::null_mut(), &mut used) < 0); assert_eq!(used, usize::MAX, "nothing written"); ``` #446 (in #1368) changes `put_string` so that the string getters report the required size, NUL included, even when the buffer is missing (the same change that made me adapt a test of #1199 inside #1368). With both merged, `used` is the size, so the assertion fails. ## The change One assertion, in `modules/storage.rs`: it now expects the required size. ```rust assert_eq!(used, size, "the required size is reported"); ``` If the maintainer prefers the old behaviour for this getter, the other way out is to leave #446 out of #1368 and keep #1193's assertion. ## Verification Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain): | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 541 passed, 0 failed, 7 ignored (two runs; `main`: 476 passed, 7 ignored) | All the bundles of the index #1495 (17 branches, 195 PRs) also merge together without a textual conflict; this is the only test that fails when they are all merged, which is why this bridge exists. The title was not run. ## Re-verify ```powershell git fetch https://github.com/MamaLeVrai/VIctory.git bundle/hle-bridge git checkout FETCH_HEAD cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked ``` AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`victory run GTA6.exe`, run from the game folder, gives an exe path with
an empty parent, and that empty folder was mounted as G:. An empty path
cannot be made absolute, so the root stayed empty and G:\x64\a.rpf
became \x64\a.rpf: the root of the current drive. The title then found
none of its files.

An empty root is now the current directory, which is what an empty
folder means everywhere else (`Path::new("").join("x")` is `x` in the
current directory). Passing a path with a folder in it is unaffected.
MapViewOfFile3 with MEM_REPLACE_PLACEHOLDER replaces exactly one
placeholder: the range must be the placeholder's own. map() split the
placeholder around the range and mapped one view over it, so it worked
only when the range lay in a single placeholder. Every mapping leaves its
reservation split at its ends and unmapping does not join the pieces, so
after a partial unmap, a scattered mapping or a shorter earlier run, a
run over those pages failed with ERROR_INVALID_ADDRESS and
XMemMapPhysicalPages returned NULL, its range already unmapped.

map() now splits only at the run's two ends and gives each placeholder in
the range a view of its part. Placeholders are never coalesced: the host
also coalesces placeholders of separate reservations, and pieces a title
split itself would stay joined after the unmap. If a view fails, those
made before it become placeholders again. The split call also frees
memory that replaced a placeholder back to one, committed pages
included, so split_at() splits only where everything below the split
point is reserved.

New tests: a run remapped after a partial unmap, a run from one
placeholder into the next, a title-split piece kept through a map and an
unmap, and a failed run that is rolled back without touching committed
memory next to it. The first three fail on main (XMemMapPhysicalPages
returns NULL). cargo test --workspace passes on Windows 11. Wine's
virtual.c splits placeholders into separate views and reports them the
same way (AllocationBase, region end, exact MEM_REPLACE_PLACEHOLDER
match); not run under Wine.
The source resolver's rule (local files only) knew a share as `\..`,
`//..` or `file://server/..`. The host knows more spellings: any two
leading separators (`/\server\share`), the object manager's prefix
(`\??\UNC\server\share`), and a `file:` URL with no host whose path
starts with two separators (`file:////server/share`,
`file:\server\share`, also percent-encoded). Those fell through as
relative paths or drive-less local files and went to the host's
resolver unchanged.

They are refused now, naming the server. Paths with one leading
separator, a drive after the slashes or the prefix, and the path of a
URL that names this machine pass as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XStoreQueryPackageIdentifier documents E_INVALIDARG for a store id that
has no installed package. We returned XPackage's 0x89245208 instead.
host::module held the module cache's lock while it called
LoadLibraryExA. Loading a DLL that is not loaded yet takes the OS
loader lock, and title code runs under that lock too (a title DLL's
thread attach, TLS callbacks run as threads start), where it can need
the cache: any first use of a host! function, or a late-bound title
DLL. One thread holding the cache and waiting for the loader lock,
another holding the loader lock and waiting for the cache: the process
hangs, and cannot even exit, as ExitProcess needs the loader lock too.

The cache is now looked up, then unlocked for the load, then locked
again to keep the handle; a thread that loaded the same DLL meanwhile
got the same module, which stays loaded.
The MicrosoftGame.config reader ended a tag at its first '>', but XML
allows '>' unescaped inside an attribute value. A value with one
(DefaultDisplayName="A > B") cut the tag short: its '/>' was never
seen, so the element stayed open and every element after it was read
as its child. Game/TitleId and the storage quota were then not found,
and the title ran as id 00000000 with no storage quota, its saves and
temporary files in that folder, without a warning.

A tag now ends at the first '>' outside quotes.
XGameUiShowTextEntryAsync documents a 1024-character maximum on console,
1024 for a maxTextLength of 0, and 1024 for the Password scope whatever
the title asks. 0 meant no limit here, larger limits were kept and the
scope was ignored.
A refused XMemVirtualAlloc or XMemAllocDefault handed the title a null in
silence, and the title then writes at null plus an offset, which reads
like a title bug. In #289 the faulting write is at 0x217800, the
request's length 0x2173a0 rounded up to 2 KiB, so the base it built on
was most likely such a null.

At the commit limit, XMemVirtualAlloc now writes the same crashes.log
report the physical-page commit writes since #51 (the shared part is
`commit_refused`); other refusals, and a host heap out of memory, are
warnings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move the lexical drive, separator, verbatim and dot-segment decisions out of the Windows-only files module into a host-independent paths module with seven unit tests. The Windows module keeps only the host calls and delegates to the same rules. Add no behaviour change.
runtime stores an absolute image path while relaunch_args searched raw CLI arguments for exact text, so a relative launch argument made XLaunchNewGame silently rerun the old title. Normalize the argument the same way runtime does before replacing it. Also split the title's quoted config args into proper arguments instead of split_whitespace. Add a regression covering a relative startup path, a different target and quoted/empty args.
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).
Merges #335 #475 #446 #1199 #449 #939 #412 #674 #957 #648 #455 #370 #1167
onto main (ffe310e), each head unchanged, no conflicts.

One change of mine: #446 makes the string getters report the required size
on the insufficient-buffer branch (the two-call pattern of the real API),
and the test #1199 adds, put_string_refuses_what_it_cannot_fit, asserted
that no size is reported. Together they failed; the test now expects the
size, NUL included (4 for "abc").

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(370 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Merges #337 #359 #357 #531 #1125 #133 #290 #207 #480 #76 #538 #997 #1169
#1193 onto main (ffe310e), each head unchanged, no conflicts.

One change of mine: a test #290 adds wrapped a raw string in format!(),
which clippy::useless_format rejects under -D warnings; it now compares
with the string directly.

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(379 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
#446 (in #1368) makes the string getters report the required size, NUL
included, even when the buffer is missing. A test #1193 adds (in #1386),
the_path_is_the_drive_root_and_its_nul, asserted that a null buffer leaves
`used` untouched. Each bundle passes alone; together that one assertion
fails. It now expects the required size.

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(407 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
xmem.rs: main records which views show each page (shown) inside map_view; the bundle's PR moved
the view bookkeeping to map(), per placeholder. The same bookkeeping now runs there for each view.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The branch it builds on moved (a new head, or a merge of main).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:34:58 +00:00
github-bot closed this pull request 2026-11-26 04:34:58 +00:00
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-24 19:33 UTC · original

Runtime boot check on real hardware with a retail dump

Result: no difference from main in this test.

I merged head 780e617 (with #1368 and #1386 inside) onto main ffe310e, built it (release), and ran victory run <title exe> --execute with an empty data folder for 100 s, without any input.

main ffe310e this PR
Reaches the first-boot screens yes yes
crashes.log entries 0 0
Committed memory 11.1 GB 11.1 GB
Warnings 7 7, the same kinds and counts

The empty data folder also exercises the storage paths that the bridged test is about: the title creates its save and settings folders on the first boot.

I leave out frame rates. This run happened while other builds kept the CPU busy, and under that load main itself presents the 30 fps menus faster than 30 (see #1542). So no timing comparison is possible from this run.

Limits. Without input, the title stays on the first-boot screens. I did not run the PR's tests. Machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2, game 1.0.2.1. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-24 19:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/1521#issuecomment-7142263473) ### Runtime boot check on real hardware with a retail dump **Result: no difference from `main` in this test.** I merged head 780e617 (with #1368 and #1386 inside) onto `main` ffe310e, built it (release), and ran `victory run <title exe> --execute` with an empty data folder for 100 s, without any input. | | `main` ffe310e | this PR | |---|---|---| | Reaches the first-boot screens | yes | yes | | `crashes.log` entries | 0 | 0 | | Committed memory | 11.1 GB | 11.1 GB | | Warnings | 7 | 7, the same kinds and counts | The empty data folder also exercises the storage paths that the bridged test is about: the title creates its save and settings folders on the first boot. I leave out frame rates. This run happened while other builds kept the CPU busy, and under that load `main` itself presents the 30 fps menus faster than 30 (see #1542). So no timing comparison is possible from this run. **Limits.** Without input, the title stays on the first-boot screens. I did not run the PR's tests. Machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2, game 1.0.2.1. AI-assisted (Claude Code).
Author
Owner

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

Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/1521#issuecomment-7148784420) Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!1521
No description provided.