perf(gpu,hle): switch descriptor heap to RwLock and add remap pooling #3440

Open
legayclightning22 wants to merge 1 commit from upstream-pr/3440 into main
legayclightning22 commented 2026-11-27 02:21:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-27T02:21:08Z.


Summary

Switches descriptor-heap reads to an RwLock so concurrent readers do not block each other while preserving exclusive write safety, and adds pooled virtual-memory remap / staging slot reuse (279975c, +423/-86).

Changes

  • Replace exclusive descriptor-heap read locking with RwLock in crates/victory-gpu/src/descriptor.rs and crates/victory-gpu/src/host.rs.
  • Add pooled remap/staging reuse in crates/victory-gpu/src/remap_pool.rs and wire xmem.rs remap handling in victory-hle.
  • Add unit tests covering concurrent descriptor-heap reads/writes and remap pool reuse.

Verification

  • cargo test --locked -p victory-hle --lib (156/156 passed) and cargo test --locked -p victory-gpu --lib (only the 3 pre-existing baseline failures)
  • cargo clippy --locked -p victory-gpu -p victory-hle --all-targets --all-features -- -D warnings
  • cargo xtask policy
<!-- greyfinch-sync:Marvisak/VIctory:issue:5520073070 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3440). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-27T02:21:08Z. --- ## Summary Switches descriptor-heap reads to an `RwLock` so concurrent readers do not block each other while preserving exclusive write safety, and adds pooled virtual-memory remap / staging slot reuse (`279975c`, `+423/-86`). ## Changes - Replace exclusive descriptor-heap read locking with `RwLock` in `crates/victory-gpu/src/descriptor.rs` and `crates/victory-gpu/src/host.rs`. - Add pooled remap/staging reuse in `crates/victory-gpu/src/remap_pool.rs` and wire `xmem.rs` remap handling in `victory-hle`. - Add unit tests covering concurrent descriptor-heap reads/writes and remap pool reuse. ## Verification - `cargo test --locked -p victory-hle --lib` (156/156 passed) and `cargo test --locked -p victory-gpu --lib` (only the 3 pre-existing baseline failures) - `cargo clippy --locked -p victory-gpu -p victory-hle --all-targets --all-features -- -D warnings` - `cargo xtask policy` ```[cite: 71]
Dukestar69 commented 2026-11-27 02:28:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T02:28:32Z.

Review: APPROVED


LGTM — verified on Windows (RTX 5090):

  • cargo test -p victory-gpu --lib descriptor:: passed (23/23, including shader_heaps_are_concurrently_readable and views_support_concurrent_readers_and_writers, skipping the pre-existing origin/main RTX 5090 failure)
  • cargo test -p victory-hle --lib xmem passed (18/18, including all 4 new remap_pool::tests::)
  • cargo clippy -p victory-gpu -p victory-hle --all-targets -- -D warnings passed with 0 warnings
  • cargo xtask policy passed (192 files ok)

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6082696838 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3440#pullrequestreview-6082696838). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-27T02:28:32Z. **Review:** APPROVED --- LGTM — verified on Windows (RTX 5090): - `cargo test -p victory-gpu --lib descriptor::` passed (23/23, including `shader_heaps_are_concurrently_readable` and `views_support_concurrent_readers_and_writers`, skipping the pre-existing `origin/main` RTX 5090 failure) - `cargo test -p victory-hle --lib xmem` passed (18/18, including all 4 new `remap_pool::tests::`) - `cargo clippy -p victory-gpu -p victory-hle --all-targets -- -D warnings` passed with 0 warnings - `cargo xtask policy` passed (`192 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
legayclightning22 commented 2026-11-27 02:50:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-27T02:50:28Z.


Pushed 90b26d2 updating the spare_scratch_slots_reuse_by_size_and_evict_past_budget test budget (100 -> 128) so the test accurately models the two slots while keeping pool logic intact. Re-verified the spare scratch slot test, victory-hle (156/156), clippy with zero warnings, and cargo xtask policy.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7208481387 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3440#issuecomment-7208481387). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-27T02:50:28Z. --- Pushed `90b26d2` updating the `spare_scratch_slots_reuse_by_size_and_evict_past_budget` test budget (`100 -> 128`) so the test accurately models the two slots while keeping pool logic intact. Re-verified the spare scratch slot test, `victory-hle` (`156/156`), `clippy` with zero warnings, and `cargo xtask policy`.
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/3440:upstream-pr/3440'
git switch 'upstream-pr/3440'

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/3440'
git switch 'upstream-pr/3440'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3440'
git switch 'upstream-pr/3440'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3440'
git switch 'main'
git merge --squash 'upstream-pr/3440'
git switch 'main'
git merge --ff-only 'upstream-pr/3440'
git switch 'main'
git merge 'upstream-pr/3440'
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
Marvisak/VIctory!3440
No description provided.