fix(gpu): raise default dynamic slots to 458,752 and honor VICTORY_DYNAMIC_SLOTS on 1M-capped heaps #1007

Open
whoalin1 wants to merge 1 commit from upstream-pr/1007 into main
whoalin1 commented 2026-11-28 10:59:15 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by whoalin1 on 2026-11-28T10:59:15Z.


Summary

Raises the default dynamic descriptor slot budget on PORTABLE_VIEWS-capped heaps (1,000,000 descriptors, typical on NVIDIA) from DYNAMIC (262,144) to DYNAMIC_CAPPED = 7 << 16 (458,752), and makes VICTORY_DYNAMIC_SLOTS respected on those heaps (clamped to [DYNAMIC, null / 2]).

(Unlike #48, which leaves the default at 262,144 and bundles unrelated ambient.rs/indirect.rs changes, this isolates dynamic_slots in descriptor/host.rs and raises the out-of-the-box default so 1M-capped heaps stop dropping draws.)

Why

On 1M-capped heaps (null < PORTABLE_VIEWS), dynamic_slots previously early-returned DYNAMIC (262,144) and ignored VICTORY_DYNAMIC_SLOTS. In draw-heavy scenes (such as GTA VI outdoor openings), 262,144 dynamic slots ran short and refused 13–22% of dynamic descriptor tables, dropping draws. Raising the capped default to 458,752 keeps 541,247 1:1 title slots while eliminating those refusals.

Change (crates/victory-gpu/src/descriptor/host.rs)

  • Extract pure parse_dynamic_slots(count, null, asked) for testability.
  • Default null < PORTABLE_VIEWS to DYNAMIC_CAPPED (458,752) when VICTORY_DYNAMIC_SLOTS is unset, or clamp the override to [DYNAMIC, (null / 2).max(DYNAMIC)].
  • Add unit test dynamic_slots_tests::dynamic_slots_on_capped_1m_heap.

Verification

Verified on Windows (x86_64-pc-windows-msvc, RTX 4070 SUPER):

  • git diff --check origin/main..HEAD — clean
  • cargo run --locked -p xtask -- policy — asset policy: 294 files ok
  • cargo clippy --workspace --all-targets --locked & --all-features — 0 warnings in crates/victory-gpu/src/descriptor/host.rs
  • cargo test --release -p victory-gpu --locked --lib descriptor:: -- --test-threads=1 — 63 passed, 0 failed, 0 ignored
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5539408315 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1007). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-28T10:59:15Z. --- ## Summary Raises the default dynamic descriptor slot budget on `PORTABLE_VIEWS`-capped heaps (1,000,000 descriptors, typical on NVIDIA) from `DYNAMIC` (`262,144`) to `DYNAMIC_CAPPED = 7 << 16` (`458,752`), and makes `VICTORY_DYNAMIC_SLOTS` respected on those heaps (clamped to `[DYNAMIC, null / 2]`). *(Unlike #48, which leaves the default at `262,144` and bundles unrelated `ambient.rs`/`indirect.rs` changes, this isolates `dynamic_slots` in `descriptor/host.rs` and raises the out-of-the-box default so 1M-capped heaps stop dropping draws.)* ## Why On 1M-capped heaps (`null < PORTABLE_VIEWS`), `dynamic_slots` previously early-returned `DYNAMIC` (`262,144`) and ignored `VICTORY_DYNAMIC_SLOTS`. In draw-heavy scenes (such as GTA VI outdoor openings), `262,144` dynamic slots ran short and refused `13–22%` of dynamic descriptor tables, dropping draws. Raising the capped default to `458,752` keeps `541,247` 1:1 title slots while eliminating those refusals. ## Change (`crates/victory-gpu/src/descriptor/host.rs`) - Extract pure `parse_dynamic_slots(count, null, asked)` for testability. - Default `null < PORTABLE_VIEWS` to `DYNAMIC_CAPPED` (`458,752`) when `VICTORY_DYNAMIC_SLOTS` is unset, or clamp the override to `[DYNAMIC, (null / 2).max(DYNAMIC)]`. - Add unit test `dynamic_slots_tests::dynamic_slots_on_capped_1m_heap`. ## Verification Verified on Windows (`x86_64-pc-windows-msvc`, RTX 4070 SUPER): - `git diff --check origin/main..HEAD` — clean - `cargo run --locked -p xtask -- policy` — `asset policy: 294 files ok` - `cargo clippy --workspace --all-targets --locked` & `--all-features` — 0 warnings in `crates/victory-gpu/src/descriptor/host.rs` - `cargo test --release -p victory-gpu --locked --lib descriptor:: -- --test-threads=1` — 63 passed, 0 failed, 0 ignored
Vaporisateur commented 2026-11-28 14:06:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Vaporisateur on 2026-11-28T14:06:33Z.


A data point for this, from an RTX 3080 10 GB (Windows 11, 32 GB RAM, Series X profile, DLSS Quality), diagnostics builds of v2026.11.27.10 and v2026.11.28.01 with VICTORY_POOL_STATS=1, seven sessions of 5 to 9 minutes each, mostly the residential streets of the first chapter.

Refusals are now rare but come in bursts, and each burst is visible flicker. Since the slot leak fix (1d3b414) the refusals are far below the 13-22% described above: most 5-second windows refuse 0 of about 20,000 tables per frame. But they come back in short bursts while driving, for example:

13:54:44  19745 tables asked, 1 refused   (per frame, 53 frames)
13:54:49  29405 tables asked, 65 refused
13:54:54  27347 tables asked, 80 refused  + 56.6/frame "indirect kind 10: prepare failed"
13:54:59  24265 tables asked, 0 refused
13:55:20  26005 tables asked, 33 refused

The player reported flicker at exactly those times, without knowing the log. Earlier sessions had bursts of 155 to 242 refused per frame for up to three minutes. So with 262,144 dynamic slots the reserve still runs dry at peaks, and raising it should remove the remaining flicker on 1M-capped heaps.

The title does not need the 1:1 slots this takes away. In an earlier measurement on the same setup and scene (one 15-minute session), the highest view slot the title wrote was 341,782. With 458,752 dynamic slots there are still 541,247 slots left for the title, about 200,000 more than it used.

We can run this PR in the same scene and report the refusal counts before and after, if that helps.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240423030 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1007#issuecomment-7240423030). Originally posted by [Vaporisateur](https://github.com/Vaporisateur) on 2026-11-28T14:06:33Z. --- A data point for this, from an RTX 3080 10 GB (Windows 11, 32 GB RAM, Series X profile, DLSS Quality), diagnostics builds of v2026.11.27.10 and v2026.11.28.01 with `VICTORY_POOL_STATS=1`, seven sessions of 5 to 9 minutes each, mostly the residential streets of the first chapter. **Refusals are now rare but come in bursts, and each burst is visible flicker.** Since the slot leak fix (1d3b414) the refusals are far below the 13-22% described above: most 5-second windows refuse 0 of about 20,000 tables per frame. But they come back in short bursts while driving, for example: ``` 13:54:44 19745 tables asked, 1 refused (per frame, 53 frames) 13:54:49 29405 tables asked, 65 refused 13:54:54 27347 tables asked, 80 refused + 56.6/frame "indirect kind 10: prepare failed" 13:54:59 24265 tables asked, 0 refused 13:55:20 26005 tables asked, 33 refused ``` The player reported flicker at exactly those times, without knowing the log. Earlier sessions had bursts of 155 to 242 refused per frame for up to three minutes. So with 262,144 dynamic slots the reserve still runs dry at peaks, and raising it should remove the remaining flicker on 1M-capped heaps. **The title does not need the 1:1 slots this takes away.** In an earlier measurement on the same setup and scene (one 15-minute session), the highest view slot the title wrote was 341,782. With 458,752 dynamic slots there are still 541,247 slots left for the title, about 200,000 more than it used. We can run this PR in the same scene and report the refusal counts before and after, if that helps.
Vaporisateur commented 2026-11-28 14:39:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Vaporisateur on 2026-11-28T14:39:18Z.


Follow-up with this PR applied, same RTX 3080 10 GB, same streets of the first chapter, diagnostics build of v2026.11.28.01 plus this PR (and #1041), one 8.5-minute session driving and walking:

  • 0 dynamic tables refused in the whole session, in every 5-second window, including the busiest ones at 27,000 to 30,919 tables asked per frame.
  • No more "indirect kind 10: prepare failed" bursts that came with the refusals.
  • Before, on the same setup without this PR: bursts of 65 to 80 refused per frame (and up to 155 to 242 in another session), each one seen as flicker by the player.

The player still reports less flicker than before. Some flicker remains in the session, but it does not line up with any refusal, so it has another cause.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240830926 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1007#issuecomment-7240830926). Originally posted by [Vaporisateur](https://github.com/Vaporisateur) on 2026-11-28T14:39:18Z. --- Follow-up with this PR applied, same RTX 3080 10 GB, same streets of the first chapter, diagnostics build of v2026.11.28.01 plus this PR (and #1041), one 8.5-minute session driving and walking: - **0 dynamic tables refused in the whole session**, in every 5-second window, including the busiest ones at 27,000 to 30,919 tables asked per frame. - No more "indirect kind 10: prepare failed" bursts that came with the refusals. - Before, on the same setup without this PR: bursts of 65 to 80 refused per frame (and up to 155 to 242 in another session), each one seen as flicker by the player. The player still reports less flicker than before. Some flicker remains in the session, but it does not line up with any refusal, so it has another cause.
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/1007:upstream-pr/1007'
git switch 'upstream-pr/1007'

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