perf(descriptor): batch texture recheck claims in heap_textures pass #2605

Open
github-bot wants to merge 1 commit from github-bot/gh-2605 into main AGit
Owner

@⁠qlfu on GitHub · 2026-11-29 14:53 UTC · original
qlfu:pr/perf-batch-recheck-claims → main · +158 −2 · 2 files · 1 commits · open

Summary

Batches speculative texture recheck claims in draw::State::heap_textures instead of acquiring HostHeap::checking and TextureQueue (queue_site::DUE) once per due recheck slot:

  • Adds HostHeap::claim_texture_rechecks(&self, candidates: &[(u32, u64, Checked)], frame: u64) claiming up to Tells::BATCH (64) candidates under one checking lock and one TextureQueue::DUE lock acquisition, with an unwind-safe ReleaseRejected drop guard preserving checking / TextureQueue lock ordering.
  • Adds a lookahead claim_cache in draw::State::heap_textures that refills in batches of up to Tells::BATCH when mark == Some(write) && knew == Some(expected), dropping skipped/unused claims immediately and falling back to single claim_texture_recheck otherwise.

Verification

  • Unit tests: cargo test -p victory-gpu --lib --locked descriptor::host -- --test-threads=1 (79 passed; 0 failed, including new claim_texture_rechecks_batches_valid_busy_and_stale_slots).
  • Full crate tests: cargo test -p victory-gpu --lib --locked -- --test-threads=1 --quiet (926 passed; 0 failed; 57 ignored).
  • cargo clippy -p victory-gpu --lib --tests --locked: 0 new warnings.
  • 90s live release benchmark (1440p DLSS Balanced, RTX 4070 Ti + Ryzen 7 5700X, 0 WARNs / 0 ERRORs):
    • TextureQueue::DUE lock acquisitions per 5s: 8,554 -> 435 (-94.9%)
    • taking the slots due time per 5s: 122 ms -> 28 ms (-77%)
**@⁠qlfu** on GitHub · 2026-11-29 14:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2605) `qlfu:pr/perf-batch-recheck-claims` → `main` · +158 −2 · 2 files · 1 commits · open ## Summary Batches speculative texture recheck claims in `draw::State::heap_textures` instead of acquiring `HostHeap::checking` and `TextureQueue` (`queue_site::DUE`) once per due recheck slot: - Adds `HostHeap::claim_texture_rechecks(&self, candidates: &[(u32, u64, Checked)], frame: u64)` claiming up to `Tells::BATCH` (`64`) candidates under one `checking` lock and one `TextureQueue::DUE` lock acquisition, with an unwind-safe `ReleaseRejected` drop guard preserving `checking` / `TextureQueue` lock ordering. - Adds a lookahead `claim_cache` in `draw::State::heap_textures` that refills in batches of up to `Tells::BATCH` when `mark == Some(write) && knew == Some(expected)`, dropping skipped/unused claims immediately and falling back to single `claim_texture_recheck` otherwise. ## Verification - Unit tests: `cargo test -p victory-gpu --lib --locked descriptor::host -- --test-threads=1` (`79 passed; 0 failed`, including new `claim_texture_rechecks_batches_valid_busy_and_stale_slots`). - Full crate tests: `cargo test -p victory-gpu --lib --locked -- --test-threads=1 --quiet` (`926 passed; 0 failed; 57 ignored`). - `cargo clippy -p victory-gpu --lib --tests --locked`: `0` new warnings. - 90s live release benchmark (`1440p DLSS Balanced`, RTX 4070 Ti + Ryzen 7 5700X, `0 WARNs / 0 ERRORs`): - `TextureQueue::DUE` lock acquisitions per 5s: **`8,554 -> 435` (-94.9%)** - `taking the slots due` time per 5s: **`122 ms -> 28 ms` (-77%)**
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 14:56:19 +00:00
github-bot force-pushed github-bot/gh-2605 from 2251c61509 to 0f4c4cbae4 2026-11-30 00:17:19 +00:00 Compare
Author
Owner

@⁠qlfu on GitHub · 2026-11-30 00:12 UTC · original

Rebased cleanly onto main (41adb551), preserving both #2607's remap-history tests and claim_texture_rechecks_batches_valid_busy_and_stale_slots. Verified cargo test -p victory-gpu --lib --locked -- claim_texture_rechecks --test-threads=1 (1 passed) and cargo check -p victory-gpu --features diagnostics --locked.

**@⁠qlfu** on GitHub · 2026-11-30 00:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2605#issuecomment-7265063897) Rebased cleanly onto `main` (`41adb551`), preserving both `#2607`'s remap-history tests and `claim_texture_rechecks_batches_valid_busy_and_stale_slots`. Verified `cargo test -p victory-gpu --lib --locked -- claim_texture_rechecks --test-threads=1` (1 passed) and `cargo check -p victory-gpu --features diagnostics --locked`.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-30 05:18 UTC · original · approved these changes

Tested locally merged onto main (41adb551).

  • Merge: Clean merge across crates/victory-gpu/src/descriptor/host.rs and draw.rs.
  • Tests (RTX 5090): cargo test -p victory-gpu --lib descriptor::host::tests:: passed (73 passed; 0 failed; 1 ignored, including the new claim_texture_rechecks_batches_valid_busy_and_stale_slots test) with 0 new warnings.

Clean batched texture-recheck claiming optimization reducing lock acquisition overhead. LGTM.

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

**@⁠Dukestar69** on GitHub · 2026-11-30 05:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2605#pullrequestreview-6107202818) · **approved these changes** Tested locally merged onto `main` (`41adb551`). - **Merge**: Clean merge across `crates/victory-gpu/src/descriptor/host.rs` and `draw.rs`. - **Tests (RTX 5090)**: `cargo test -p victory-gpu --lib descriptor::host::tests::` passed (`73 passed; 0 failed; 1 ignored`, including the new `claim_texture_rechecks_batches_valid_busy_and_stale_slots` test) with 0 new warnings. Clean batched texture-recheck claiming optimization reducing lock acquisition overhead. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/draw.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/2605/head:github-bot/gh-2605'
git switch 'github-bot/gh-2605'

Merge

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