Invalidate cached buffer lookups at registration and idle sweep #1245

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

@⁠UwUCammie on GitHub · 2026-11-26 01:46 UTC · original
UwUCammie:fix/upstream-shadow-publication → main · +108 −25 · 1 files · 2 commits · open

This follows the lookup cache imported in 32be36d. Registration could publish its new generation while a recording thread could still see the old table. A lookup could also upgrade a weak reference to a loose window after the idle sweep removed it and before it dropped its last reference.

Registration now publishes under the table lock after insertion. A cached loose window is checked against the window table and marked in use under the same lock as the idle sweep. Registered-buffer hits keep their fast path. The existing 0, 1 and alt modes stay available.

Both focused regressions fail on the original contributor branch and pass with these fixes under Wine 11.22 on the RX 7900 XT (RADV 26.3.1). The registration case uses no GPU. The sweep case uses a synthetic window. The patch also builds against 7496a4c.

Four first-room pairs on the patched contributor branch gave 6.02 FPS with the cache off and 6.01 with it on, with 132 million cached lookups in the enabled blocks. Those measurements compare the switch settings on the patched binary. Run details · Contributor PR

**@⁠UwUCammie** on GitHub · 2026-11-26 01:46 UTC · [original](https://github.com/fxceless/victory-fork/pull/1245) `UwUCammie:fix/upstream-shadow-publication` → `main` · +108 −25 · 1 files · 2 commits · open This follows the lookup cache imported in `32be36d`. Registration could publish its new generation while a recording thread could still see the old table. A lookup could also upgrade a weak reference to a loose window after the idle sweep removed it and before it dropped its last reference. Registration now publishes under the table lock after insertion. A cached loose window is checked against the window table and marked in use under the same lock as the idle sweep. Registered-buffer hits keep their fast path. The existing `0`, `1` and `alt` modes stay available. Both focused regressions fail on the original contributor branch and pass with these fixes under Wine 11.22 on the RX 7900 XT (RADV 26.3.1). The registration case uses no GPU. The sweep case uses a synthetic window. The patch also builds against `7496a4c`. Four first-room pairs on the patched contributor branch gave 6.02 FPS with the cache off and 6.01 with it on, with 132 million cached lookups in the enabled blocks. Those measurements compare the switch settings on the patched binary. [Run details](https://github.com/UwUCammie/victory-amd/blob/ff88d27/benchmarks/README.md#profiling-after-the-comparison) · [Contributor PR](https://github.com/KyleS98/victory-fork/pull/5)
(cherry picked from commit 289f3d6e9d3f32f3ddb4f9701db0053b6c8db16f)
(cherry picked from commit a9137f530963638771729e21bca839c852f8ea70)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:00:16 +00:00
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 01:47 UTC · original

I also ran the two tests on this PR head (7b42ef2) on the RX 7900 XT. Both passed in three separate-process pairs and in three grouped runs. One Wine process per pair cut the median wall time from 9.71 to 4.92 seconds. Exact command and timings

**@⁠UwUCammie** on GitHub · 2026-11-26 01:47 UTC · [original](https://github.com/fxceless/victory-fork/pull/1245#issuecomment-7180132005) I also ran the two tests on this PR head (`7b42ef2`) on the RX 7900 XT. Both passed in three separate-process pairs and in three grouped runs. One Wine process per pair cut the median wall time from 9.71 to 4.92 seconds. [Exact command and timings](https://github.com/UwUCammie/victory-amd/blob/fccf829/benchmarks/README.md#running-focused-windows-tests-together)
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/shadow.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1245'
git switch 'github-bot/gh-1245'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1245'
git switch 'github-bot/gh-1245'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1245'
git switch 'main'
git merge --squash 'github-bot/gh-1245'
git switch 'main'
git merge --ff-only 'github-bot/gh-1245'
git switch 'main'
git merge 'github-bot/gh-1245'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.