perf(gpu): avoid full texture pool scans on first-upload admission #4455

Closed
github-bot wants to merge 11 commits from github-bot/gh-4454 into main AGit
Owner

@⁠v8816 on GitHub · 2026-11-30 20:34 UTC · original
v8816:perf/texture-pool-fit → main · +824 −849 · 33 files · 11 commits · closed without merging

Problem

When the card is at or over budget, first-upload admission computes the largest free range across both texture pools for each candidate. The earlier budget guards can settle some decisions without that scan. The remaining candidates only need to know whether a single reusable range fits.

Change

Defer the range lookup until it can affect admission, and stop at the first fitting range. Keep the existing budget limits and decision counters. A new test covers fragmented ranges, the cooldown before returned pieces become reusable, and coalescing after reclaim. The admission tests also verify that guard decisions skip the lookup.

Validation

  • Release resource and pool suites: 96 passed, 4 ignored. The asset policy passed for both changed files.
  • Synthetic CPU comparison with 57 blocks, 29 ranges per block, and 6,000 requests: median of nine runs was 9.84 ms before and 1.43 ms after for mixed fits. With every lookup missing, it was 9.90 ms before and 11.64 ms after. This microbenchmark isolates one pool lookup. Gameplay and sustained FPS have not been measured.
**@⁠v8816** on GitHub · 2026-11-30 20:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4454) `v8816:perf/texture-pool-fit` → `main` · +824 −849 · 33 files · 11 commits · closed without merging ## Problem When the card is at or over budget, first-upload admission computes the largest free range across both texture pools for each candidate. The earlier budget guards can settle some decisions without that scan. The remaining candidates only need to know whether a single reusable range fits. ## Change Defer the range lookup until it can affect admission, and stop at the first fitting range. Keep the existing budget limits and decision counters. A new test covers fragmented ranges, the cooldown before returned pieces become reusable, and coalescing after reclaim. The admission tests also verify that guard decisions skip the lookup. ## Validation - Release resource and pool suites: 96 passed, 4 ignored. The asset policy passed for both changed files. - Synthetic CPU comparison with 57 blocks, 29 ranges per block, and 6,000 requests: median of nine runs was 9.84 ms before and 1.43 ms after for mixed fits. With every lookup missing, it was 9.90 ms before and 11.64 ms after. This microbenchmark isolates one pool lookup. Gameplay and sustained FPS have not been measured.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 20:35:52 +00:00
Author
Owner

@⁠tikD1337 on GitHub · 2026-11-30 20:51 UTC · original

Tested headlessly on origin/main (e1251c31, Windows 11, no game run):

  • Merge check: clean against origin/main.
  • cargo test -p victory-gpu --lib -- pool::tests: 31 passed, 0 failed, 3 ignored (1166 filtered).
  • cargo test -p victory-gpu --lib -- first_upload: 10 passed, 0 failed (1190 filtered), no new warnings.

(AI-assisted build/unit-test check; game runtime not launched.)

**@⁠tikD1337** on GitHub · 2026-11-30 20:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4454#issuecomment-7291560426) Tested headlessly on `origin/main` (`e1251c31`, Windows 11, no game run): - Merge check: clean against `origin/main`. - `cargo test -p victory-gpu --lib -- pool::tests`: **31 passed, 0 failed, 3 ignored** (1166 filtered). - `cargo test -p victory-gpu --lib -- first_upload`: **10 passed, 0 failed** (1190 filtered), no new warnings. *(AI-assisted build/unit-test check; game runtime not launched.)*
github-bot closed this pull request 2026-12-01 18:43:36 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:41 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4454#issuecomment-7321353159) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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!4455
No description provided.