xmem: map_alias of no pages changes nothing, next to a reservation shown whole too #99

Closed
github-bot wants to merge 1 commit from github-bot/gh-99 into main AGit
Owner

@⁠ySKELLETONX on GitHub · 2026-11-25 14:03 UTC · original
ySKELLETONX:fix/map-alias-no-pages → main · +5 −0 · 1 files · 1 commits · closed without merging

Why

map_alias(to, from, 0) should change nothing, but it returns false when to is the first byte past one reservation and the next reservation is shown whole. in_whole(to, 0) is true for an empty range at either end of a whole range (at <= to && to + 0 <= at + n).

mapping_no_pages_changes_nothing calls it at a + 2 * PAGE, right past its own 2-page reservation. With #93 applied, its new a_large_run_of_pages_is_shown_whole leaves a 65-page reservation shown whole. When the two tests run in parallel and that reservation is placed directly after the small one, the test fails at the assert!(map_alias(at as u64, a as u64, 0)) line.

What

map_alias returns true for len == 0 before it takes the lock. Nothing else changes.

Testing

RX 7600 XT 16 GB (RDNA3), Windows 11 Pro build 26300, Rust 1.98.1.

  • #93 (68d437d) alone: cargo test -p victory-hle --lib xmem failed in 9 of 40 runs, always mapping_no_pages_changes_nothing. With --test-threads=1, or with --skip a_large_run_of_pages_is_shown_whole: 0 of 40.
  • #93 + this change: 0 of 60 parallel runs. Full crate: 103 passed, 0 failed, 1 ignored.
  • On main alone, this moves mapping_no_pages_changes_nothing past its map_alias check (the failure at xmem.rs:1386 in #91). It still fails further on (4096 vs 8192), and #93 fixes that part. The other 4 xmem failures are unchanged here.

Related: #93, #91, #8.

**@⁠ySKELLETONX** on GitHub · 2026-11-25 14:03 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/99) `ySKELLETONX:fix/map-alias-no-pages` → `main` · +5 −0 · 1 files · 1 commits · closed without merging ## Why `map_alias(to, from, 0)` should change nothing, but it returns false when `to` is the first byte past one reservation and the next reservation is shown whole. `in_whole(to, 0)` is true for an empty range at either end of a whole range (`at <= to && to + 0 <= at + n`). `mapping_no_pages_changes_nothing` calls it at `a + 2 * PAGE`, right past its own 2-page reservation. With #93 applied, its new `a_large_run_of_pages_is_shown_whole` leaves a 65-page reservation shown whole. When the two tests run in parallel and that reservation is placed directly after the small one, the test fails at the `assert!(map_alias(at as u64, a as u64, 0))` line. ## What `map_alias` returns true for `len == 0` before it takes the lock. Nothing else changes. ## Testing RX 7600 XT 16 GB (RDNA3), Windows 11 Pro build 26300, Rust 1.98.1. - #93 (`68d437d`) alone: `cargo test -p victory-hle --lib xmem` failed in **9 of 40** runs, always `mapping_no_pages_changes_nothing`. With `--test-threads=1`, or with `--skip a_large_run_of_pages_is_shown_whole`: 0 of 40. - #93 + this change: **0 of 60** parallel runs. Full crate: 103 passed, 0 failed, 1 ignored. - On `main` alone, this moves `mapping_no_pages_changes_nothing` past its `map_alias` check (the failure at xmem.rs:1386 in #91). It still fails further on (`4096` vs `8192`), and #93 fixes that part. The other 4 xmem failures are unchanged here. Related: #93, #91, #8.
in_whole holds for an empty range at either end of a reservation shown
whole, so a count of 0 at the first byte past one reservation, when the
next one is shown whole, was refused. mapping_no_pages_changes_nothing
does exactly that at `a + 2 * PAGE`: with #93's
a_large_run_of_pages_is_shown_whole running beside it, it failed in 9 of
40 parallel runs on an RX 7600 XT, Windows 11 build 26300.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:46 +00:00
github-bot force-pushed github-bot/gh-99 from 5c0efcc776 to 600075e6c5 2026-11-26 13:09:01 +00:00 Compare
github-bot closed this pull request 2026-11-26 15:14:44 +00:00
Author
Owner

@⁠ySKELLETONX on GitHub · 2026-11-26 15:10 UTC · original

Closing this: #14 and #16 both carry the same change (map_alias returns true for len == 0 before the in_whole check) together with the fix for the five xmem failures, so whichever of them is merged covers it, and this would only conflict. Checked here on main 4f62c2a: each of them passes all xmem tests (#16 in 50 of 50 runs).

**@⁠ySKELLETONX** on GitHub · 2026-11-26 15:10 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/99#issuecomment-7195893142) Closing this: #14 and #16 both carry the same change (`map_alias` returns `true` for `len == 0` before the `in_whole` check) together with the fix for the five `xmem` failures, so whichever of them is merged covers it, and this would only conflict. Checked here on `main` 4f62c2a: each of them passes all `xmem` tests (#16 in 50 of 50 runs).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.