fix(gpu): retain every rebound stride table until list reset #645

Open
github-bot wants to merge 12 commits from github-bot/gh-645 into main AGit
Owner

@⁠tommiehansen on GitHub · 2026-12-05 22:50 UTC · original
tommiehansen:prc/stride-buffer-lifetime-20261205 → main · +263 −4 · 4 files · 12 commits · open

Why

A command list can bind multiple descriptor heaps before execution. Retaining the stride table only on the first refresh allows subsequent tables to lose their last external owner before the GPU consumes them. This is a resource-lifetime bug, not an FPS optimization.

What changes

Retain every distinct stride table before the once-per-list refresh guard. Per-list identity deduplication retains one COM reference per resource; reset releases the references. The existing refresh cadence is unchanged. Credit: Larp #277.

Benchmark results — isolated Windows guard cost

Eight paired blocks; actual GPU readback checked separately.

Audit Original Retention fix Paired incremental cost
Initial 12.71 ns 24.43 ns 11.69 ns
Repeat 19.151 ns 37.823 ns 18.242 ns

This measures the isolated guard, not whole draw or frame time.

Why this should be merged

It prevents a use-after-release when descriptor heaps are rebound in one recorded list, with bounded retention and explicit cleanup. The added per-call CPU cost is disclosed; no gameplay performance claim is needed for this correctness fix.

Validation

Final CI at 29a9c75 passes three real WARP compute dispatches reading A/B/A (96 exact dwords), after releasing external owners, stable COM references over 128 repeated bindings and reset cleanup. Restoring the original guard order reproduces one retained table instead of two. Initial retention and GPU readback also passed. The final workflow corrects only the negative-control exit wrapper. No runtime switch or AMD-specific dependency.

**@⁠tommiehansen** on GitHub · 2026-12-05 22:50 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/645) `tommiehansen:prc/stride-buffer-lifetime-20261205` → `main` · +263 −4 · 4 files · 12 commits · open ## Why A command list can bind multiple descriptor heaps before execution. Retaining the stride table only on the first refresh allows subsequent tables to lose their last external owner before the GPU consumes them. This is a resource-lifetime bug, not an FPS optimization. ## What changes Retain every distinct stride table before the once-per-list refresh guard. Per-list identity deduplication retains one COM reference per resource; reset releases the references. The existing refresh cadence is unchanged. Credit: [Larp #277](https://github.com/gamingwithhomie/larp/pull/277). ## Benchmark results — isolated Windows guard cost Eight paired blocks; actual GPU readback checked separately. | Audit | Original | Retention fix | Paired incremental cost | |---|---:|---:|---:| | [Initial](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47580487533) | 12.71 ns | 24.43 ns | 11.69 ns | | [Repeat](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47581139313) | 19.151 ns | 37.823 ns | 18.242 ns | This measures the isolated guard, not whole draw or frame time. ## Why this should be merged It prevents a use-after-release when descriptor heaps are rebound in one recorded list, with bounded retention and explicit cleanup. The added per-call CPU cost is disclosed; no gameplay performance claim is needed for this correctness fix. ## Validation [Final CI](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47581139313) at `29a9c75` passes three real WARP compute dispatches reading A/B/A (96 exact dwords), after releasing external owners, stable COM references over 128 repeated bindings and reset cleanup. Restoring the original guard order reproduces one retained table instead of two. [Initial retention](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47579135783) and [GPU readback](https://github.com/tommiehansen/VIctory-xmem/actions/runs/47580288927) also passed. The final workflow corrects only the negative-control exit wrapper. No runtime switch or AMD-specific dependency.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 22:51:28 +00:00
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/645/head:github-bot/gh-645'
git switch 'github-bot/gh-645'

Merge

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