xmem tests take the per-page path again; a reservation shown whole has its own test #16
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!16
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-16"
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?
@Ekabusto on GitHub · 2026-11-25 11:59 UTC · original
Ekabusto:fix/xmem-tests-per-page-path→main· +73 −13 · 1 files · 1 commits · openFixes the five
xmemfailures in #2 and #8, following the first of the two ways out proposed in #2: keepmap_wholeand point the old tests back at the path they were written for.Cause
Since
map_whole(fa07481), a reservation as long as the section of the pages mapped into it is shown whole by one view, and unmapping inside it changes nothing. Five tests reserved exactly as many pages as they allocated, so they took that path, then found an unmapped page still committed (MEM_COMMIT0x1000 whereMEM_RESERVE0x2000 was expected).Change (
crates/victory-hle/src/modules/xmem.rsonly)physical_pages_map_alias_and_unmap,mapping_no_pages_changes_nothingandpages_and_reservation(used by the foura_run_*/a_failed_run_*tests) allocate one page more than the reservation holds, so mappings go page by page. Their assertions are unchanged.a_reservation_is_shown_whole: a 3-page reservation mapped in three calls is one view of 3 pages; pages land where they are first put (pages 1 and 2 swapped, checked throughpage_bytes); unmapping a page leaves it shown;map_aliasinto it is refused.map_aliaswithlen == 0returnstruebefore thein_wholecheck. This is the one non-test change.in_whole(base, 0)is true whenbaseis the start of a reservation shown whole, somapping_no_pages_changes_nothing's probe "past the view" (a + 2 pages) was refused about 1 run in 20 whenever the new test's reservation happened to follow its own. A copy of no bytes now changes nothing anywhere, the same wayunmapalready returns early forlen == 0. Forlen > 0nothing changes.Checks (Windows 11 build 26300, Rust 1.98.1, no game data)
cargo test --locked -p victory-hle --lib xmem: 15 passed, 0 failed, 100 runs in a row. Onmain(71652a2): 9 passed, 5 failed.cargo test --locked -p victory-hle --lib: 103 passed, 1 ignored.cargo fmt --checkandcargo clippy -p victory-hle --all-targets -- -D warningsreport only what they report onmain(rustfmt line wrapping inmap_whole/map_alias, clippy'sitems_after_test_module); nothing new from this change.Not checked: the game. The
map_aliaschange only affects zero-length copies; I don't know whether the GPU queue ever issues one into the whole-shown heap, but if it did it was refused (with a warning) before and is a no-op now.AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code
@Ekabusto on GitHub · 2026-11-25 12:47 UTC · original
For whoever reviews this: #14 fixes the same five failures and conflicts with this PR. It limits
map_wholeto reservations of 16 MiB and up, matching the GPU side's 16 MiB minimum for in-place mapped views, instead of changing the tests. I think #14 is the better fix for the title; if it is merged, I'll close this one.AI-assisted (Claude Code).
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.