GPU: release directly indexed buffer ranges with their heap #67

Open
ryotdev wants to merge 1 commit from upstream-pr/67 into main
ryotdev commented 2026-11-24 21:06:57 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ryotdev on 2026-11-24T21:06:57Z.


State::heap_buffers stored each heap's directly indexed buffer ranges in a process-wide map keyed by its address. Releasing the heap left the map holding its shadow buffers. A heap allocated at that address could also inherit the previous heap's pass count and stale slot ranges.

The host descriptor heap now owns its slot ranges and pass count alongside its buffer-view writes. Its first pass visits every buffer slot. Subsequent passes visit written slots, with the existing full rescan every 16 passes. Other owners, including in-flight lists, keep their own resource references.

Verification

  • Built the victory-gpu Windows x64 test binary with Rust 1.98.1. The new CPU-only lifetime regression and six neighboring descriptor tests passed on Windows.
  • The regression observes the last strong reference through a weak reference, replaces the tracking state at the same address, and checks the replacement heap's first pass. The same fixture failed on the lifetime assertion in a standalone negative control using the old process-wide address-keyed ownership.
  • A synthetic single-heap run with 81,920 slots, 64 writes per pass and 128 passes visited 663,040 slots, with eight full scans and matching range checksums under both ownership models.
  • All-targets, all-features Clippy for victory-gpu passed with warnings denied. The repository's asset policy passed.

AI-assisted. Validation used synthetic inputs.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6591424524 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/67). Originally posted by [ryotdev](https://github.com/ryotdev) on 2026-11-24T21:06:57Z. --- `State::heap_buffers` stored each heap's directly indexed buffer ranges in a process-wide map keyed by its address. Releasing the heap left the map holding its shadow buffers. A heap allocated at that address could also inherit the previous heap's pass count and stale slot ranges. The host descriptor heap now owns its slot ranges and pass count alongside its buffer-view writes. Its first pass visits every buffer slot. Subsequent passes visit written slots, with the existing full rescan every 16 passes. Other owners, including in-flight lists, keep their own resource references. ### Verification - Built the `victory-gpu` Windows x64 test binary with Rust 1.98.1. The new CPU-only lifetime regression and six neighboring descriptor tests passed on Windows. - The regression observes the last strong reference through a weak reference, replaces the tracking state at the same address, and checks the replacement heap's first pass. The same fixture failed on the lifetime assertion in a standalone negative control using the old process-wide address-keyed ownership. - A synthetic single-heap run with 81,920 slots, 64 writes per pass and 128 passes visited 663,040 slots, with eight full scans and matching range checksums under both ownership models. - All-targets, all-features Clippy for `victory-gpu` passed with warnings denied. The repository's asset policy passed. AI-assisted. Validation used synthetic inputs.
adriaespii commented 2026-11-24 21:30:43 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by adriaespii on 2026-11-24T21:14:29Z.


Independent test run on commit 8a761ec (AMD RDNA4):

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings
  • cargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-gpu: 111 passed, 0 failed, 1 ignored; victory-shader: 210 passed, 0 failed, 2 ignored)
  • Not tested: live game run (no game files on this machine)

AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7144666676 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/67#issuecomment-7144666676). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-24T21:14:29Z. --- Independent test run on commit `8a761ec` (AMD RDNA4): - **Hardware:** AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (`x86_64-pc-windows-msvc`) - `cargo clippy --workspace --all-targets -- -D warnings`: 0 warnings - `cargo test --workspace`: 497 passed, 0 failed, 7 ignored (`victory-gpu`: 111 passed, 0 failed, 1 ignored; `victory-shader`: 210 passed, 0 failed, 2 ignored) - **Not tested:** live game run (no game files on this machine) *AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.*
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/67:upstream-pr/67'
git switch 'upstream-pr/67'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/67'
git switch 'upstream-pr/67'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/67'
git switch 'upstream-pr/67'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/67'
git switch 'main'
git merge --squash 'upstream-pr/67'
git switch 'main'
git merge --ff-only 'upstream-pr/67'
git switch 'main'
git merge 'upstream-pr/67'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!67
No description provided.