HLE/GPU: invalidate write trackers on 32-bit XMem allocation release and reuse #2824

Open
github-bot wants to merge 2 commits from github-bot/gh-2824 into main AGit
Owner

@⁠VlREX on GitHub · 2026-11-25 21:32 UTC · original
VlREX:fix/xmem32-tracker-lifecycle → main · +116 −4 · 3 files · 2 commits · draft

Summary

Notify GPU write trackers when 32-bit XMem allocations
are released and reused. Complementary to #2612.

Reproduced failure

new allocation was invisible: clean=true, taken=[]

Native verification

Ryzen 5 3600X / RX 5700 XT / Windows 10
Rust 1.98.1

  • Targeted regression: PASS
  • Clippy GPU + HLE: PASS
  • GPU suite: 194 passed, 1 failed, 2 ignored
  • Existing texture failure reproduced on exact baseline.

Baseline: 13f91ca
Tested head: 88c5ea1

Remaining: full XMem integration regression,
workspace/HLE results and concurrent copy-back review.

No gameplay or FPS claims.
AI-assisted development (ChatGPT).
Native verification by VlREX.

**@⁠VlREX** on GitHub · 2026-11-25 21:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/2824) `VlREX:fix/xmem32-tracker-lifecycle` → `main` · +116 −4 · 3 files · 2 commits · draft ### Summary Notify GPU write trackers when 32-bit XMem allocations are released and reused. Complementary to #2612. ### Reproduced failure new allocation was invisible: clean=true, taken=[] ### Native verification Ryzen 5 3600X / RX 5700 XT / Windows 10 Rust 1.98.1 - Targeted regression: PASS - Clippy GPU + HLE: PASS - GPU suite: 194 passed, 1 failed, 2 ignored - Existing texture failure reproduced on exact baseline. Baseline: 13f91ca Tested head: 88c5ea1 Remaining: full XMem integration regression, workspace/HLE results and concurrent copy-back review. No gameplay or FPS claims. AI-assisted development (ChatGPT). Native verification by VlREX.
Candidate: report successful release across all protection regions and notify successful XMemAllocDefault allocations. Isolated synthetic release/reuse regression; native validation pending. Does not serialize pending copy-back with allocation lifecycle (see #2612). AI-assisted.
Clarify the owned-allocation safety contract for rejected interior addresses. Documentation only; native Clippy rerun pending.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:15:09 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 22:41 UTC · original

Verified 88c5ea1d merged onto main (f3578e3) on Windows 11:

  • watch::tests::release_and_reuse_marks_the_whole_title_allocation (--ignored --exact): 1/1 passed.
  • watch::tests: 15/15 passed (1 ignored); victory-hle modules::xmem::tests: 12/12 passed.
  • cargo clippy --locked -p victory-gpu -p victory-hle --all-targets -- -D warnings (default & victory-gpu/diagnostics): 0 warnings; cargo xtask policy: 190 files ok.
  • Audited release_title_allocation: walking VirtualQuery (AllocationBase == address && Type == MEM_PRIVATE) captures multi-protection regions split by PAGE_GUARD while rejecting interior pointers; performing VirtualFree(MEM_RELEASE) inside guards() before clearing g.protected and calling remapped() avoids calling VirtualProtect on freed/reused VA space and clears changed/armed/alias_of atomically without lock-order issues.

Looks clean and ready to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-25 22:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2824#issuecomment-7176666256) Verified `88c5ea1d` merged onto `main` (`f3578e3`) on Windows 11: - `watch::tests::release_and_reuse_marks_the_whole_title_allocation` (`--ignored --exact`): 1/1 passed. - `watch::tests`: 15/15 passed (1 ignored); `victory-hle` `modules::xmem::tests`: 12/12 passed. - `cargo clippy --locked -p victory-gpu -p victory-hle --all-targets -- -D warnings` (default & `victory-gpu/diagnostics`): 0 warnings; `cargo xtask policy`: `190 files ok`. - Audited `release_title_allocation`: walking `VirtualQuery` (`AllocationBase == address && Type == MEM_PRIVATE`) captures multi-protection regions split by `PAGE_GUARD` while rejecting interior pointers; performing `VirtualFree(MEM_RELEASE)` inside `guards()` before clearing `g.protected` and calling `remapped()` avoids calling `VirtualProtect` on freed/reused VA space and clears `changed`/`armed`/`alias_of` atomically without lock-order issues. Looks clean and ready to merge.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2824/head:github-bot/gh-2824'
git switch 'github-bot/gh-2824'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2824'
git switch 'github-bot/gh-2824'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2824'
git switch 'github-bot/gh-2824'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2824'
git switch 'main'
git merge --squash 'github-bot/gh-2824'
git switch 'main'
git merge --ff-only 'github-bot/gh-2824'
git switch 'main'
git merge 'github-bot/gh-2824'
git push origin 'main'
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!2824
No description provided.