xmem: keep tiny reservations per page; map_whole only for large runs #93

Closed
dutch2005 wants to merge 6 commits from upstream-pr/93 into main
dutch2005 commented 2026-11-25 13:51:04 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by dutch2005 on 2026-11-25T13:51:04Z.


Why

Fixes issue #8. On Windows 11 / RDNA2, five victory-hle xmem tests fail because map_whole takes a tiny reservation (three 64 KiB pages) down the whole-reservation path. Unmapping the middle page then reports MEM_COMMIT (4096) where the tests expect MEM_RESERVE (8192), and the address of the split placeholders differs.

What

  • map_whole only makes a new whole view for reservations above 64 pages. The threshold stays in the known match, so a later small call into a range already shown whole still goes to that view.
  • The end of the range is computed with checked_mul/checked_add.
  • map_alias with no pages returns true before the whole-range check (#99, ySKELLETONX); a zero-length alias next to a reservation shown whole is a no-op.
  • The whole-view tests release their view and reservation and hold a test mutex; .cargo/config.toml sets RUST_TEST_THREADS=1 for the global xmem/GPU state.

Review fixes (all on this branch)

  • ySKELLETONX found the first threshold broke the title at startup on the RX 9070 XT (jmal423: os error 487 ~1 s in): the GPU heap is mapped in several calls, and a later 16-page call was refused after the first call showed the reservation whole. Their fix and a_small_run_into_a_reservation_shown_whole_is_mapped were taken from fork PR #1 (commit by ySKELLETONX preserved).
  • gut0to found the new tests leaked xmem state into later tests; release_whole now removes the bookkeeping, unmaps the view and releases the reservation.
  • The allocate doc comment is back on allocate.

Testing

On an RX 6700 XT, Windows 11, Rust 1.98.1:

  • cargo test -p victory-hle --lib xmem -- --test-threads=1 — 16 passed, 0 failed.
  • 30 default-thread runs of the xmem suite: 0 failures (was ~9/40 after the first version).
  • cargo test -p victory-hle --lib — full crate passes.
  • Mutation coverage on the xmem diff: 7 mutants caught, 1 equivalent. The surviving mutant disables the pages.len() <= 64 guard; manual mutation confirmed all 16 xmem tests still pass, so the guard is not observable in this test suite. It is retained because the title's multi-call heap mapping needs it, and the startup-crash regression test covers the other side.

Independent confirmation: RX 6950 XT (MamaLeVrai) 103 passed, 0 failed, 3/3 runs; RX 7600 XT (ySKELLETONX) fixes #91 and reports 0 failures in 40 parallel runs with the startup fix.

Risk

Tiny reservations no longer make a new in-place whole view; the large GPU heap mappings still do. A title run on the RX 9070 XT with the startup fix would confirm the crash is gone; jmal423 was asked in the review thread.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6606019884 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93). Originally posted by [dutch2005](https://github.com/dutch2005) on 2026-11-25T13:51:04Z. --- ## Why Fixes issue #8. On Windows 11 / RDNA2, five `victory-hle` xmem tests fail because `map_whole` takes a tiny reservation (three 64 KiB pages) down the whole-reservation path. Unmapping the middle page then reports `MEM_COMMIT` (4096) where the tests expect `MEM_RESERVE` (8192), and the address of the split placeholders differs. ## What - `map_whole` only makes a **new** whole view for reservations above 64 pages. The threshold stays in the `known` match, so a later small call into a range **already shown whole** still goes to that view. - The end of the range is computed with `checked_mul`/`checked_add`. - `map_alias` with no pages returns true before the whole-range check (`#99`, ySKELLETONX); a zero-length alias next to a reservation shown whole is a no-op. - The whole-view tests release their view and reservation and hold a test mutex; `.cargo/config.toml` sets `RUST_TEST_THREADS=1` for the global xmem/GPU state. ## Review fixes (all on this branch) - ySKELLETONX found the first threshold broke the title at startup on the RX 9070 XT (jmal423: `os error 487` ~1 s in): the GPU heap is mapped in several calls, and a later 16-page call was refused after the first call showed the reservation whole. Their fix and `a_small_run_into_a_reservation_shown_whole_is_mapped` were taken from fork PR #1 (commit by ySKELLETONX preserved). - gut0to found the new tests leaked xmem state into later tests; `release_whole` now removes the bookkeeping, unmaps the view and releases the reservation. - The `allocate` doc comment is back on `allocate`. ## Testing On an RX 6700 XT, Windows 11, Rust 1.98.1: - `cargo test -p victory-hle --lib xmem -- --test-threads=1` — **16 passed, 0 failed**. - 30 default-thread runs of the xmem suite: **0 failures** (was ~9/40 after the first version). - `cargo test -p victory-hle --lib` — full crate passes. - Mutation coverage on the xmem diff: **7 mutants caught, 1 equivalent**. The surviving mutant disables the `pages.len() <= 64` guard; manual mutation confirmed all 16 xmem tests still pass, so the guard is not observable in this test suite. It is retained because the title's multi-call heap mapping needs it, and the startup-crash regression test covers the other side. Independent confirmation: RX 6950 XT (MamaLeVrai) 103 passed, 0 failed, 3/3 runs; RX 7600 XT (ySKELLETONX) fixes #91 and reports 0 failures in 40 parallel runs with the startup fix. ## Risk Tiny reservations no longer make a *new* in-place whole view; the large GPU heap mappings still do. A title run on the RX 9070 XT with the startup fix would confirm the crash is gone; jmal423 was asked in the review thread.
MamaLeVrai commented 2026-11-25 14:01:18 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by MamaLeVrai on 2026-11-25T14:01:18Z.


Tested on the machine of issue #8 and #2 (RX 6950 XT, Windows 11 build 26300, Rust 1.98.1): this PR merged on main 71652a2 (head 68d437d, no conflict), cargo test --release -p victory-hle --lib, 3 runs.

main 71652a2 with this PR
victory-hle 97 passed, 5 failed (the five xmem tests of #8), 3 runs of 3 103 passed, 0 failed, 3 runs of 3

The six new tests are in the 103. victory-shader is not touched by the PR and still has its 2 failures (see #92). Not run in the game.

harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300

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

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7164636565 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#issuecomment-7164636565). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T14:01:18Z. --- Tested on the machine of issue #8 and #2 (RX 6950 XT, Windows 11 build 26300, Rust 1.98.1): this PR merged on `main` `71652a2` (head `68d437d`, no conflict), `cargo test --release -p victory-hle --lib`, 3 runs. | | `main` `71652a2` | with this PR | |---|---|---| | victory-hle | 97 passed, **5 failed** (the five xmem tests of #8), 3 runs of 3 | **103 passed, 0 failed**, 3 runs of 3 | The six new tests are in the 103. `victory-shader` is not touched by the PR and still has its 2 failures (see #92). Not run in the game. harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300 AI-assisted (Claude Code); no game data.
ySKELLETONX commented 2026-11-25 14:03:16 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ySKELLETONX on 2026-11-25T14:03:16Z.


Tested on an RX 7600 XT 16 GB (RDNA3), Windows 11 Pro build 26300, Rust 1.98.1, at 68d437d. It fixes the 5 xmem failures I reported in #91, and the full victory-hle crate passes (103 passed, 1 ignored).

One problem: with the default parallel runner, mapping_no_pages_changes_nothing fails in about 9 of 40 runs of cargo test -p victory-hle --lib xmem, at assert!(map_alias(at as u64, a as u64, 0)). It never fails with --test-threads=1 or with --skip a_large_run_of_pages_is_shown_whole.

The cause: the new test leaves a 65-page reservation shown whole. When it lands directly after the other test's 2-page reservation, map_alias(a + 2 * PAGE, a, 0) is refused because in_whole is true for an empty range at the start of a whole range. #99 makes map_alias with len == 0 return true up front. With #99 on top of this PR: 0 failures in 60 parallel runs. You can also take the 4 lines into this PR, whichever you prefer.

Small nit: the new test was inserted between /// \n` pages of one new allocation.andfn allocate, so that doc comment is now attached to a_large_run_of_pages_is_shown_whole`.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7164686091 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#issuecomment-7164686091). Originally posted by [ySKELLETONX](https://github.com/ySKELLETONX) on 2026-11-25T14:03:16Z. --- Tested on an RX 7600 XT 16 GB (RDNA3), Windows 11 Pro build 26300, Rust 1.98.1, at `68d437d`. It fixes the 5 xmem failures I reported in #91, and the full `victory-hle` crate passes (103 passed, 1 ignored). One problem: with the default parallel runner, `mapping_no_pages_changes_nothing` fails in about 9 of 40 runs of `cargo test -p victory-hle --lib xmem`, at `assert!(map_alias(at as u64, a as u64, 0))`. It never fails with `--test-threads=1` or with `--skip a_large_run_of_pages_is_shown_whole`. The cause: the new test leaves a 65-page reservation shown whole. When it lands directly after the other test's 2-page reservation, `map_alias(a + 2 * PAGE, a, 0)` is refused because `in_whole` is true for an empty range at the start of a whole range. #99 makes `map_alias` with `len == 0` return true up front. With #99 on top of this PR: 0 failures in 60 parallel runs. You can also take the 4 lines into this PR, whichever you prefer. Small nit: the new test was inserted between `/// \`n\` pages of one new allocation.` and `fn allocate`, so that doc comment is now attached to `a_large_run_of_pages_is_shown_whole`.
jmal423 commented 2026-11-25 14:34:44 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by jmal423 on 2026-11-25T14:34:44Z.


Tested this PR on Windows 11 / AMD Radeon RX 9070 XT (on top of 01aadd1 + #39, Series X target):

The title crashes ~1s after launch with os error 487 (Attempt to access invalid address) inside xmem:

INFO victory_hle::modules::xmem: a reservation of physical pages shown whole at=0x10000 len=193986560
WARN victory_hle::modules::xmem: mapping physical pages failed (not a placeholder?) address=0xa10000 len=1048576 error=Attempt to access invalid address. (os error 487)
VIctory: first-chance exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x19f4f58

Dropping #93 (keeping #39) resolves the startup crash.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7165492924 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#issuecomment-7165492924). Originally posted by [jmal423](https://github.com/jmal423) on 2026-11-25T14:34:44Z. --- Tested this PR on Windows 11 / AMD Radeon RX 9070 XT (on top of `01aadd1` + `#39`, Series X target): The title crashes ~1s after launch with `os error 487` (`Attempt to access invalid address`) inside `xmem`: ``` INFO victory_hle::modules::xmem: a reservation of physical pages shown whole at=0x10000 len=193986560 WARN victory_hle::modules::xmem: mapping physical pages failed (not a placeholder?) address=0xa10000 len=1048576 error=Attempt to access invalid address. (os error 487) VIctory: first-chance exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x19f4f58 ``` Dropping `#93` (keeping `#39`) resolves the startup crash.
ySKELLETONX commented 2026-11-25 14:37:56 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ySKELLETONX on 2026-11-25T14:37:56Z.


@jmal423's crash comes from the threshold: pages.len() <= 64 returns before map_whole checks for a whole view that already covers the range. The title maps the GPU heap in several calls. After the first one shows the reservation whole, the 16-page call at 0xa10000 is refused, goes to the per-page path, and fails with error 487 because the whole view replaced the placeholders there.

Fix and regression test (70 of 80 pages mapped whole, then the last 10): dutch2005/VIctory-Belobug-AMD#1, against this PR's branch. The test fails at 0cbedb9 with the same null return and passes with the fix. victory-hle: 104 passed. xmem: 0 failures in 40 parallel runs. The threshold now applies only when a run would make a new whole view, so the #8 tests keep the per-page path.

@jmal423, if you can run the title with that branch on the 9070 XT, that would confirm it.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7165578171 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#issuecomment-7165578171). Originally posted by [ySKELLETONX](https://github.com/ySKELLETONX) on 2026-11-25T14:37:56Z. --- @jmal423's crash comes from the threshold: `pages.len() <= 64` returns before `map_whole` checks for a whole view that already covers the range. The title maps the GPU heap in several calls. After the first one shows the reservation whole, the 16-page call at `0xa10000` is refused, goes to the per-page path, and fails with error 487 because the whole view replaced the placeholders there. Fix and regression test (70 of 80 pages mapped whole, then the last 10): dutch2005/VIctory-Belobug-AMD#1, against this PR's branch. The test fails at `0cbedb9` with the same null return and passes with the fix. `victory-hle`: 104 passed. xmem: 0 failures in 40 parallel runs. The threshold now applies only when a run would make a *new* whole view, so the #8 tests keep the per-page path. @jmal423, if you can run the title with that branch on the 9070 XT, that would confirm it.
gut0to commented 2026-11-25 14:49:44 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T14:49:44Z.

Review: COMMENTED


AI-assisted review: I checked the cleanup behavior in XMemFreePhysicalPages.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review:6059866790 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#pullrequestreview-6059866790). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-25T14:49:44Z. **Review:** COMMENTED --- AI-assisted review: I checked the cleanup behavior in XMemFreePhysicalPages.
gut0to commented 2026-11-25 14:49:44 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T14:49:44Z.

Code review location: crates/victory-hle/src/modules/xmem.rs; line 1467

@@ -1403,6 +1422,51 @@ mod tests {
         assert_eq!(XMemFreePhysicalPages(2, pages.as_ptr()), 1);
     }
 
+    /// A run above the tiny-reservation threshold still takes the whole
+    /// view; a mutation that disables `map_whole` must not pass the suite.
+    #[test]
+    fn a_large_run_of_pages_is_shown_whole() {
+        const N: usize = 65;
+        let pages = allocate(N);
+        let reservation = XMemVirtualAlloc(
+            std::ptr::null_mut(),
+            N * PAGE,
+            MEM_RESERVE | PAGES_64K,
+            0,
+            PAGE_READWRITE,
+        );
+        assert!(!reservation.is_null());
+        assert_eq!(XMemMapPhysicalPages(reservation, N, pages.as_ptr()), reservation);
+
+        let physical = physical();
+        assert!(
+            physical
+                .whole
+                .iter()
+                .any(|&(at, len, _)| at == reservation as usize && len == N * PAGE),
+            "the large reservation is shown whole"
+        );
+        assert_eq!(
+            physical.views.get(&(reservation as usize)).map(|v| v.0),
+            Some(N * PAGE)
+        );
+        drop(physical);
+
+        // No pages into a reservation shown whole: a no-op, not a refusal.
+        assert!(map_alias(
+            reservation as u64 + PAGE as u64,
+            reservation as u64,
+            0
+        ));
+
+        // SAFETY: the whole reservation is mapped read-write.
+        unsafe {
+            reservation.cast::<u8>().write(5);
+            assert_eq!(reservation.cast::<u8>().read(), 5);
+        }
+        assert_eq!(XMemFreePhysicalPages(N, pages.as_ptr()), 1);

Could this test unmap the whole view and release reservation before freeing the pages? XMemFreePhysicalPages only removes the page-table entries; it leaves the mapped view in physical.views/physical.whole and the virtual reservation allocated. That leaks xmem state and address space into later tests, especially when the suite runs in parallel. AI-assisted review.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review-comment:4696640328 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#discussion_r4696640328). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-25T14:49:44Z. **Code review location:** `crates/victory-hle/src/modules/xmem.rs`; line 1467 ~~~~diff @@ -1403,6 +1422,51 @@ mod tests { assert_eq!(XMemFreePhysicalPages(2, pages.as_ptr()), 1); } + /// A run above the tiny-reservation threshold still takes the whole + /// view; a mutation that disables `map_whole` must not pass the suite. + #[test] + fn a_large_run_of_pages_is_shown_whole() { + const N: usize = 65; + let pages = allocate(N); + let reservation = XMemVirtualAlloc( + std::ptr::null_mut(), + N * PAGE, + MEM_RESERVE | PAGES_64K, + 0, + PAGE_READWRITE, + ); + assert!(!reservation.is_null()); + assert_eq!(XMemMapPhysicalPages(reservation, N, pages.as_ptr()), reservation); + + let physical = physical(); + assert!( + physical + .whole + .iter() + .any(|&(at, len, _)| at == reservation as usize && len == N * PAGE), + "the large reservation is shown whole" + ); + assert_eq!( + physical.views.get(&(reservation as usize)).map(|v| v.0), + Some(N * PAGE) + ); + drop(physical); + + // No pages into a reservation shown whole: a no-op, not a refusal. + assert!(map_alias( + reservation as u64 + PAGE as u64, + reservation as u64, + 0 + )); + + // SAFETY: the whole reservation is mapped read-write. + unsafe { + reservation.cast::<u8>().write(5); + assert_eq!(reservation.cast::<u8>().read(), 5); + } + assert_eq!(XMemFreePhysicalPages(N, pages.as_ptr()), 1); ~~~~ --- Could this test unmap the whole view and release reservation before freeing the pages? XMemFreePhysicalPages only removes the page-table entries; it leaves the mapped view in physical.views/physical.whole and the virtual reservation allocated. That leaks xmem state and address space into later tests, especially when the suite runs in parallel. AI-assisted review.
gut0to commented 2026-11-25 15:31:04 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T15:31:04Z.

Review: COMMENTED


AI-assisted review: I compared the updated Cargo config with the repository's documented contributor commands.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review:6060543349 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#pullrequestreview-6060543349). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-25T15:31:04Z. **Review:** COMMENTED --- AI-assisted review: I compared the updated Cargo config with the repository's documented contributor commands.
gut0to commented 2026-11-25 15:31:04 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-25T15:31:04Z.

Code review location: .cargo/config.toml; line 4

@@ -1,2 +1,5 @@
-[alias]
-xtask = "run --quiet --package xtask --"
+# The xmem page pool and the GPU differential tests are global state shared
+# between tests. Run test binaries with one thread by default, as the hardware
+# runs already do; `--test-threads` on the command line still wins.
+[env]

Could this keep the existing xtask alias alongside the test-thread setting? Replacing the [alias] table removes cargo xtask, which the README's policy check and install-hooks instructions rely on. AI-assisted review; I checked the current Cargo config against those README commands.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review-comment:4697190812 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#discussion_r4697190812). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-25T15:31:04Z. **Code review location:** `.cargo/config.toml`; line 4 ~~~~diff @@ -1,2 +1,5 @@ -[alias] -xtask = "run --quiet --package xtask --" +# The xmem page pool and the GPU differential tests are global state shared +# between tests. Run test binaries with one thread by default, as the hardware +# runs already do; `--test-threads` on the command line still wins. +[env] ~~~~ --- Could this keep the existing xtask alias alongside the test-thread setting? Replacing the [alias] table removes cargo xtask, which the README's policy check and install-hooks instructions rely on. AI-assisted review; I checked the current Cargo config against those README commands.
ySKELLETONX commented 2026-11-25 15:57:46 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ySKELLETONX on 2026-11-25T15:57:46Z.


On gut0to's .cargo/config.toml comment: confirmed here. At 30132fc, cargo xtask policy fails with no such command: xtask, so the pre-commit hook (cargo xtask policy --staged) refuses every commit. dutch2005/VIctory-Belobug-AMD#2 puts the alias back beside [env]. With this PR's test mutex, victory-hle had 0 failures in 30 runs at --test-threads=16, so the workspace-wide RUST_TEST_THREADS=1 may not be needed (details in that PR).

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7167468237 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#issuecomment-7167468237). Originally posted by [ySKELLETONX](https://github.com/ySKELLETONX) on 2026-11-25T15:57:46Z. --- On gut0to's `.cargo/config.toml` comment: confirmed here. At `30132fc`, `cargo xtask policy` fails with `no such command: xtask`, so the pre-commit hook (`cargo xtask policy --staged`) refuses every commit. dutch2005/VIctory-Belobug-AMD#2 puts the alias back beside `[env]`. With this PR's test mutex, `victory-hle` had 0 failures in 30 runs at `--test-threads=16`, so the workspace-wide `RUST_TEST_THREADS=1` may not be needed (details in that PR).
dutch2005 commented 2026-11-25 15:57:52 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by dutch2005 on 2026-11-25T15:57:52Z.


Updated fix/xmem-whole-threshold following @gut0to and @ySKELLETONX's reviews:

  • Incorporated @ySKELLETONX's tail-mapping fix for subsequent small XMemMapPhysicalPages calls inside a reservation already shown whole (f3c7be2, fixing @jmal423's RX 9070 XT startup crash) plus map_alias(..., 0) early-out.
  • Kept [alias] xtask = "run --quiet --package xtask --" alongside [env] RUST_TEST_THREADS = "1" in .cargo/config.toml (@gut0to).
  • Cleaned up release_whole (unmaps the whole view and releases the reservation before freeing pages, with // SAFETY: comment) and serialized whole-view tests via WHOLE_TEST.

Verification (after final edit)

  • cargo test -p victory-hle --lib --locked: 104 passed, 0 failed, 1 ignored
  • cargo xtask policy --staged: 2 files ok
  • cargo mutants --in-diff (victory-hle, modules::xmem::tests): 7 caught, 1 documented non-observable missed (xmem.rs:720 pages.len() <= 64 guard — as noted in docs/mutation-testing.md, unit tests use the shared physical pool unless isolated to a fresh section; kept for title multi-call GPU heap mappings)
<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7167469760 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/93#issuecomment-7167469760). Originally posted by [dutch2005](https://github.com/dutch2005) on 2026-11-25T15:57:52Z. --- Updated `fix/xmem-whole-threshold` following @gut0to and @ySKELLETONX's reviews: - Incorporated @ySKELLETONX's tail-mapping fix for subsequent small `XMemMapPhysicalPages` calls inside a reservation already shown whole (`f3c7be2`, fixing @jmal423's RX 9070 XT startup crash) plus `map_alias(..., 0)` early-out. - Kept `[alias] xtask = "run --quiet --package xtask --"` alongside `[env] RUST_TEST_THREADS = "1"` in `.cargo/config.toml` (@gut0to). - Cleaned up `release_whole` (unmaps the whole view and releases the reservation before freeing pages, with `// SAFETY:` comment) and serialized whole-view tests via `WHOLE_TEST`. ### Verification (after final edit) - `cargo test -p victory-hle --lib --locked`: **104 passed, 0 failed, 1 ignored** - `cargo xtask policy --staged`: **2 files ok** - `cargo mutants --in-diff` (`victory-hle`, `modules::xmem::tests`): **7 caught, 1 documented non-observable missed** (`xmem.rs:720` `pages.len() <= 64` guard — as noted in `docs/mutation-testing.md`, unit tests use the shared physical pool unless isolated to a fresh section; kept for title multi-call GPU heap mappings)

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Belobug/VIctory-Belobug-AMD!93
No description provided.