GPU allocation latency, memory queries and descriptor allocation optimizations #3561

Closed
github-bot wants to merge 7 commits from github-bot/gh-3561 into main AGit
Owner

@⁠edge2labs on GitHub · 2026-11-30 01:02 UTC · original
edge2labs:edge2labs/performance-submit → main · +1114 −95 · 7 files · 7 commits · closed without merging

Integrated performance contribution by Edge2Labs, containing seven commits rebased onto v2026.11.29.05 (41adb551).

Synthetic benchmark improvements:

  • Staging allocation peak latency: 99.39% reduction.
  • Accumulated staging allocation time: 90.17% reduction.
  • Mapped memory queries: up to 91.17% reduction.
  • GPU pool selection: 80.72% reduction.
  • Descriptor allocation: 26.97% reduction.
  • BC6H decoding: 1.26% reduction.
  • Fixed three failing BC7 reference parity tests.

Validation:

Release and Diagnostics builds passed. Targeted correctness tests passed. Existing upstream policy and Clippy failures remain, along with intermittent GPU test failures.

Experimental options:

  • VICTORY_STAGING_REFILL=1
  • VICTORY_MAPPED_BLOCK_BATCH=1

Both options remain disabled by default.

Hardware: i9-14900K, RTX 4080 SUPER, 64 GB RAM.

All results are synthetic. No in-game FPS improvement is claimed. Based on the maintainer's feedback, these changes should primarily reduce hitches and improve frame-time stability.

The BC7 correction overlaps with PR #3263.

Looking forward to the in-game benchmark without frame generation.

Edge2Labs

**@⁠edge2labs** on GitHub · 2026-11-30 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3561) `edge2labs:edge2labs/performance-submit` → `main` · +1114 −95 · 7 files · 7 commits · closed without merging Integrated performance contribution by Edge2Labs, containing seven commits rebased onto v2026.11.29.05 (41adb551). **Synthetic benchmark improvements:** - Staging allocation peak latency: 99.39% reduction. - Accumulated staging allocation time: 90.17% reduction. - Mapped memory queries: up to 91.17% reduction. - GPU pool selection: 80.72% reduction. - Descriptor allocation: 26.97% reduction. - BC6H decoding: 1.26% reduction. - Fixed three failing BC7 reference parity tests. **Validation:** Release and Diagnostics builds passed. Targeted correctness tests passed. Existing upstream policy and Clippy failures remain, along with intermittent GPU test failures. **Experimental options:** - VICTORY_STAGING_REFILL=1 - VICTORY_MAPPED_BLOCK_BATCH=1 Both options remain disabled by default. **Hardware:** i9-14900K, RTX 4080 SUPER, 64 GB RAM. All results are synthetic. No in-game FPS improvement is claimed. Based on the maintainer's feedback, these changes should primarily reduce hitches and improve frame-time stability. The BC7 correction overlaps with PR #3263. Looking forward to the in-game benchmark without frame generation. Edge2Labs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 01:03:22 +00:00
Author
Owner

@⁠davemathews12 on GitHub · 2026-11-30 05:26 UTC · original

I read the staging refill and the BCPack change.

Staging refill (67d9f4b): one race worth closing. The worker checks p.free_bytes < BLOCK / 2 && p.may_grow(now()), then drops the lock to allocate. Back under the lock it re-checks STAGING_SPARES and free_bytes, but not may_grow. If a required allocation grows the pool to its cap in that window, the worker still adds its block. The pool then goes one 64 MiB block over its growth limit, although the comment says it obeys the idle cap. Adding && p.may_grow(now()) to the condition before p.add(...) closes it. The new block is already dropped outside the lock when it isn't kept. Since the feature is opt-in (VICTORY_STAGING_REFILL=1), the default path is unaffected.

BC6H header plans (c8bbcc2): equivalent to the old loop. The field indices (ep * 3 + ch, partition at 12) match the flat array. The only partition run is D = r(3, 0, 0, 5), so (part >> 0) & 31 over 5 bits equals the old put_unmasked(part, 5), because part = s[31] & 31. The const assertion also checks the 82/65 bit totals.

One gap in the new bc6_header_plan_matches_bit_writer test: its expected value uses put(fields[12] >> run.first, run.len) for the partition, the new interpretation. The old code wrote put_unmasked(part, 5). An assertion that every ch == 3 run is first 0, len 5 would pin the two together.

**@⁠davemathews12** on GitHub · 2026-11-30 05:26 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3561#issuecomment-7269673049) I read the staging refill and the BCPack change. **Staging refill (67d9f4b):** one race worth closing. The worker checks `p.free_bytes < BLOCK / 2 && p.may_grow(now())`, then drops the lock to allocate. Back under the lock it re-checks `STAGING_SPARES` and `free_bytes`, but not `may_grow`. If a required allocation grows the pool to its cap in that window, the worker still `add`s its block. The pool then goes one 64 MiB block over its growth limit, although the comment says it obeys the idle cap. Adding `&& p.may_grow(now())` to the condition before `p.add(...)` closes it. The new block is already dropped outside the lock when it isn't kept. Since the feature is opt-in (`VICTORY_STAGING_REFILL=1`), the default path is unaffected. **BC6H header plans (c8bbcc2):** equivalent to the old loop. The field indices (`ep * 3 + ch`, partition at 12) match the flat array. The only partition run is `D = r(3, 0, 0, 5)`, so `(part >> 0) & 31` over 5 bits equals the old `put_unmasked(part, 5)`, because `part = s[31] & 31`. The const assertion also checks the 82/65 bit totals. One gap in the new `bc6_header_plan_matches_bit_writer` test: its expected value uses `put(fields[12] >> run.first, run.len)` for the partition, the new interpretation. The old code wrote `put_unmasked(part, 5)`. An assertion that every `ch == 3` run is `first 0, len 5` would pin the two together.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:51 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:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3561#issuecomment-7321675513) 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.
github-bot closed this pull request 2026-12-01 18:58:21 +00:00

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