GPU: index bindless texture slots for targeted release and preserve u… #1862

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

@⁠VlREX on GitHub · 2026-11-24 23:44 UTC · original
VlREX:perf/bindless-slot-index-corpus → main · +139 −25 · 2 files · 2 commits · open

Optimize runtime bindless descriptor bookkeeping with a reverse texture-to-slot index and unchanged-view fast path. Includes 200 synthetic regression traces across 10 workload families. Two independent reference checks over 23,680 operations each, zero disagreements. Synthetic release work reduced from 30,006 examined entries to 5,874 targeted removals (80.42% fewer). 204 files, no new dependencies or proprietary assets. Native Rust and GPU validation pending. No FPS improvement claimed. AI-assisted (ChatGPT).

**@⁠VlREX** on GitHub · 2026-11-24 23:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1862) `VlREX:perf/bindless-slot-index-corpus` → `main` · +139 −25 · 2 files · 2 commits · open Optimize runtime bindless descriptor bookkeeping with a reverse texture-to-slot index and unchanged-view fast path. Includes 200 synthetic regression traces across 10 workload families. Two independent reference checks over 23,680 operations each, zero disagreements. Synthetic release work reduced from 30,006 examined entries to 5,874 targeted removals (80.42% fewer). 204 files, no new dependencies or proprietary assets. Native Rust and GPU validation pending. No FPS improvement claimed. AI-assisted (ChatGPT).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:46:49 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 00:10 UTC · original

Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at aab3845: cargo test -p victory-gpu --locked gives 276 passed, 2 failed, 1 ignored. The two failures are the NVIDIA heap-cap ones main also has (descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views, #1744), so there is nothing new on this hardware. Not run: a title.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-25 00:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/1862#issuecomment-7148236056) Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `aab3845`: `cargo test -p victory-gpu --locked` gives 276 passed, 2 failed, 1 ignored. The two failures are the NVIDIA heap-cap ones `main` also has (`descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views`, #1744), so there is nothing new on this hardware. Not run: a title. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:37 UTC · original · edited 2026-11-26 00:22 UTC

Automated triage for the maintainers.

Merge candidate. The head (3ff4bc0) hasn't changed since the last review. bindless::Inner::textures in crates/victory-gpu/src/bindless.rs becomes a texture-to-slot-set index. forget, which runs on every Resource drop, removes only that texture's slots (forget_texture) instead of scanning the whole heap. The seeded test in bindless/slot_tests.rs checks the index against a full-scan reference after every step.

On your reply: thanks for the numbers, including the ones that go against the change. Release gets much faster when a texture has few slots (up to 95x at 32,768 slots), but all nine rewrite-only configurations got slower because of the extra index upkeep. Which of those costs dominates in a real frame is the maintainer's call. A per-frame timing from the title would settle it. Please also finish the truncated PR title.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1862#issuecomment-7149762898) · edited 2026-11-26 00:22 UTC <!-- victory-triage v1 head=3ff4bc053cd9aed53f125b4f6caf001e06347dd4 verdict=merge-candidate at=2026-11-26T00:22:19Z --> Automated triage for the maintainers. **Merge candidate.** The head (`3ff4bc0`) hasn't changed since the last review. `bindless::Inner::textures` in `crates/victory-gpu/src/bindless.rs` becomes a texture-to-slot-set index. `forget`, which runs on every `Resource` drop, removes only that texture's slots (`forget_texture`) instead of scanning the whole heap. The seeded test in `bindless/slot_tests.rs` checks the index against a full-scan reference after every step. On your reply: thanks for the numbers, including the ones that go against the change. Release gets much faster when a texture has few slots (up to 95x at 32,768 slots), but all nine rewrite-only configurations got slower because of the extra index upkeep. Which of those costs dominates in a real frame is the maintainer's call. A per-frame timing from the title would settle it. Please also finish the truncated PR title. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠VlREX on GitHub · 2026-11-25 20:58 UTC · original

Native performance validation

Ryzen 5 3600X / RX 5700 XT / Windows 10
Rust 1.98.1

  • Workspace check: PASS
  • Targeted tests: 2/2 PASS
  • Clippy: PASS
  • Synthetic benchmark: 27/27 matched

32768 slots:

Slots per texture Mixed speedup Release speedup
1 61.796x 95.407x
8 20.261x 41.415x
64 3.021x 5.527x

Release measurements include reinsertion.
13 of 27 configurations improved.
All 9 rewrite-only configurations were slower
due to reverse-index maintenance overhead.

PR head: 3ff4bc0
Benchmark source:
github.com/VlREX/VIREX@b62629774d

Seven alternating-order samples per configuration.
Real workload profiling remains necessary.
Synthetic CPU benchmarks, not game FPS.

AI-assisted development (ChatGPT).
Native local measurements.

**@⁠VlREX** on GitHub · 2026-11-25 20:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/1862#issuecomment-7174432077) ### Native performance validation Ryzen 5 3600X / RX 5700 XT / Windows 10 Rust 1.98.1 - Workspace check: PASS - Targeted tests: 2/2 PASS - Clippy: PASS - Synthetic benchmark: 27/27 matched 32768 slots: | Slots per texture | Mixed speedup | Release speedup | |---:|---:|---:| | 1 | 61.796x | 95.407x | | 8 | 20.261x | 41.415x | | 64 | 3.021x | 5.527x | Release measurements include reinsertion. 13 of 27 configurations improved. All 9 rewrite-only configurations were slower due to reverse-index maintenance overhead. PR head: 3ff4bc0 Benchmark source: https://github.com/VlREX/VIREX/commit/b62629774da0bc36df5e462f7b5d7fd9c145d033 Seven alternating-order samples per configuration. Real workload profiling remains necessary. Synthetic CPU benchmarks, not game FPS. AI-assisted development (ChatGPT). Native local measurements.
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 23:47 UTC · original · reviewed

Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Bindless texture slots indexed for targeted release + preserve…: bindless slot lifecycle; interacts with heap-clamp work #1777/#1779 — check consistency.

**@⁠catminou4** on GitHub · 2026-11-24 23:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1862#pullrequestreview-6049282991) · **reviewed** Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Bindless texture slots indexed for targeted release + preserve…: bindless slot lifecycle; interacts with heap-clamp work #1777/#1779 — check consistency.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 19:51 UTC · original · approved these changes

Reviewed and verified 3ff4bc053cd9aed53f125b4f6caf001e06347dd4 merged onto origin/main (63bcca43c6a00a758510398fa43096ce7e4f7df0) on Windows 11 x64 (RTX 5090 + Microsoft WARP, --features diagnostics with VICTORY_D3D12_DEBUG=1, Rust 1.98.1 MSVC).

Code Audit

  • Audited every .textures and .slots access in crates/victory-gpu/src/bindless.rs: Inner::replace (L83-91), Inner::forget_texture (L93-100), and Inner::count (L137-146) maintain a strict bijection between slots (HashMap<u32, Seen>) and the reverse index textures (BTreeMap<usize, BTreeSet<u32>>), removing empty texture entries on overwrite/clear and removing only slots mapped to resource on forget (L372).
  • Existing readers (uploads iterating inner.textures.keys() and log reading inner.textures.len()) remain semantically unchanged, and debug_assert!(matches!(old, Some(Seen::Texture(r)) if r == resource)) (L97) guards against index drift in debug builds.

Local Verification

  • cargo xtask policy — pass (192 files ok).
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features) — 0 warnings.
  • cargo test --locked -p victory-gpu --features diagnostics --lib bindless:: (RTX 5090 and WARP) — 5/5 passed, including slot_tests::release_preserves_overwritten_and_unrelated_slots and slot_tests::seeded_slot_updates_match_full_scan (200 seeds x 256 operations).

(Minor non-blocking nit: the PR title is currently truncated at preserve u....)

Looks good to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 19:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1862#pullrequestreview-6079792276) · **approved these changes** Reviewed and verified `3ff4bc053cd9aed53f125b4f6caf001e06347dd4` merged onto `origin/main` (`63bcca43c6a00a758510398fa43096ce7e4f7df0`) on Windows 11 x64 (RTX 5090 + Microsoft WARP, `--features diagnostics` with `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1 MSVC). ### Code Audit - Audited every `.textures` and `.slots` access in `crates/victory-gpu/src/bindless.rs`: `Inner::replace` (`L83-91`), `Inner::forget_texture` (`L93-100`), and `Inner::count` (`L137-146`) maintain a strict bijection between `slots` (`HashMap<u32, Seen>`) and the reverse index `textures` (`BTreeMap<usize, BTreeSet<u32>>`), removing empty texture entries on overwrite/clear and removing only slots mapped to `resource` on `forget` (`L372`). - Existing readers (`uploads` iterating `inner.textures.keys()` and `log` reading `inner.textures.len()`) remain semantically unchanged, and `debug_assert!(matches!(old, Some(Seen::Texture(r)) if r == resource))` (`L97`) guards against index drift in debug builds. ### Local Verification - `cargo xtask policy` — pass (`192 files ok`). - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`) — 0 warnings. - `cargo test --locked -p victory-gpu --features diagnostics --lib bindless::` (RTX 5090 and WARP) — 5/5 passed, including `slot_tests::release_preserves_overwritten_and_unrelated_slots` and `slot_tests::seeded_slot_updates_match_full_scan` (200 seeds x 256 operations). (Minor non-blocking nit: the PR title is currently truncated at `preserve u...`.) Looks good to merge.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/1862/head:github-bot/gh-1862'
git switch 'github-bot/gh-1862'

Merge

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