GPU: release mark owners outside the marks lock #3145

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 10:15 UTC · original
andrewpozdnakov7-jpg:codex2/3137-mark-owners → main · +66 −22 · 1 files · 1 commits · open

Refs #3137.

copy_back_marks upgrades a weak shadow reference while holding the marks registry. When the mark falls outside the copy, dropping that temporary Arc can run Shadow::drop under the same lock. The path for held-back pages also processes them under the registry lock.

Snapshot strong references and their offsets under the lock. Validate the offsets, release rejected references, and process both marked and held-back pages after releasing the lock.

The same isolated Windows/WARP fixture on 63bcca4 lost the rejected owner before iteration. With this change it carries one reference out of the lookup, rejects the out-of-range page, and releases the owner. Its valid-page control resolves to the same address.

  • All 10 shadow tests passed. The full app-local WARP GPU suite passed 247 tests with one ignored.
  • Strict GPU Clippy passed with default and all features. cargo xtask policy checked 191 files.

The fixture checks mark ownership. The layout-rewrite performance measurement in #3137 remains a separate experiment.

AI-assisted. Synthetic data only.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 10:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/3145) `andrewpozdnakov7-jpg:codex2/3137-mark-owners` → `main` · +66 −22 · 1 files · 1 commits · open Refs #3137. `copy_back_marks` upgrades a weak shadow reference while holding the marks registry. When the mark falls outside the copy, dropping that temporary `Arc` can run `Shadow::drop` under the same lock. The path for held-back pages also processes them under the registry lock. Snapshot strong references and their offsets under the lock. Validate the offsets, release rejected references, and process both marked and held-back pages after releasing the lock. The same isolated Windows/WARP fixture on `63bcca4` lost the rejected owner before iteration. With this change it carries one reference out of the lookup, rejects the out-of-range page, and releases the owner. Its valid-page control resolves to the same address. - All 10 `shadow` tests passed. The full app-local WARP GPU suite passed 247 tests with one ignored. - Strict GPU Clippy passed with default and all features. `cargo xtask policy` checked 191 files. The fixture checks mark ownership. The layout-rewrite performance measurement in #3137 remains a separate experiment. AI-assisted. Synthetic data only.
Resolve upgraded shadow owners while holding the marks registry, then filter and process the pages after releasing it. The last Arc can then drop and reclaim its marks safely.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:08:31 +00:00
Author
Owner

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

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib shadow:: -- --test-threads=1: 11/11 passed (including a_rejected_mark_keeps_its_copy_until_after_the_lookup).
  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly drops mark owners outside the marks lock to avoid lock-ordering/reentrancy hazards.

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

**@⁠Dukestar69** on GitHub · 2026-11-26 10:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3145#pullrequestreview-6072435930) · **approved these changes** Verified on RTX 5090 against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib shadow:: -- --test-threads=1`: 11/11 passed (including `a_rejected_mark_keeps_its_copy_until_after_the_lookup`). - `cargo test -p victory-gpu --lib draw:: -- --test-threads=1`: 20/20 passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly drops mark owners outside the marks lock to avoid lock-ordering/reentrancy hazards. 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/3145/head:github-bot/gh-3145'
git switch 'github-bot/gh-3145'

Merge

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