GPU: unprotect guarded alias pages when their last tracker drops #3154

Open
github-bot wants to merge 1 commit from github-bot/gh-3154 into main AGit
Owner

@⁠reeledMarek on GitHub · 2026-11-26 10:27 UTC · original
reeledMarek:fix/gpu-watch-drop-unprotect-aliases → main · +45 −1 · 1 files · 1 commits · open

Summary

  • Tracked::take_split calls guard_aliases, marking aliased virtual pages PAGE_READONLY and inserting them into Guards::protected even when no tracker holds those alias pages directly in Guards::holders.
  • Tracked::drop in crates/victory-gpu/src/watch.rs previously only called open(&mut g, page) for the dropped tracker's own pages and never opened their aliases, leaving alias pages permanently PAGE_READONLY and stranded in Guards::protected after all trackers watching them or their aliases are dropped.
  • When a freed page is no longer watched through any alias, also open each of its alias pages that has no remaining holder and no watched alias.
  • Add Windows regression test dropping_the_last_tracker_unprotects_guarded_aliases verifying both Guards::protected cleanup and PAGE_READWRITE restoration.
**@⁠reeledMarek** on GitHub · 2026-11-26 10:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3154) `reeledMarek:fix/gpu-watch-drop-unprotect-aliases` → `main` · +45 −1 · 1 files · 1 commits · open ## Summary - `Tracked::take_split` calls `guard_aliases`, marking aliased virtual pages `PAGE_READONLY` and inserting them into `Guards::protected` even when no tracker holds those alias pages directly in `Guards::holders`. - `Tracked::drop` in `crates/victory-gpu/src/watch.rs` previously only called `open(&mut g, page)` for the dropped tracker's own pages and never opened their aliases, leaving alias pages permanently `PAGE_READONLY` and stranded in `Guards::protected` after all trackers watching them or their aliases are dropped. - When a freed page is no longer watched through any alias, also open each of its alias pages that has no remaining holder and no watched alias. - Add Windows regression test `dropping_the_last_tracker_unprotects_guarded_aliases` verifying both `Guards::protected` cleanup and `PAGE_READWRITE` restoration.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:08:54 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-26 11:25 UTC · original

Independent local verification of head 079d9e2 on Windows 11, Rust 1.100.0/MSVC:

  • cargo test --locked -p victory-gpu --lib dropping_the_last_tracker_unprotects_guarded_aliases — 1 passed, 0 failed.
  • git diff --check origin/main HEAD — clean.

CPU-only guarded-alias test; no D3D12 device or game assets used. Worktree-local CARGO_TARGET_DIR. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only). No game data.

**@⁠cloph-dsp** on GitHub · 2026-11-26 11:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/3154#issuecomment-7190704669) Independent local verification of head `079d9e2` on Windows 11, Rust 1.100.0/MSVC: - `cargo test --locked -p victory-gpu --lib dropping_the_last_tracker_unprotects_guarded_aliases` — 1 passed, 0 failed. - `git diff --check origin/main HEAD` — clean. CPU-only guarded-alias test; no D3D12 device or game assets used. Worktree-local `CARGO_TARGET_DIR`. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only). No game data.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 11:29 UTC · original · approved these changes

Verified against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib watch:: -- --test-threads=1: 16/16 passed (including dropping_the_last_tracker_unprotects_guarded_aliases).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly unprotects guarded alias pages when their last tracker is dropped.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 11:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/3154#pullrequestreview-6073380385) · **approved these changes** Verified against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib watch:: -- --test-threads=1`: 16/16 passed (including `dropping_the_last_tracker_unprotects_guarded_aliases`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly unprotects guarded alias pages when their last tracker is dropped. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
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/3154/head:github-bot/gh-3154'
git switch 'github-bot/gh-3154'

Merge

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