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

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

@⁠whoalin1 on GitHub · 2026-11-28 10:59 UTC · original
whoalin1:pr/dynamic-slots-458k → main · +37 −7 · 1 files · 1 commits · open

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
**@⁠whoalin1** on GitHub · 2026-11-28 10:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1007) `whoalin1:pr/dynamic-slots-458k` → `main` · +37 −7 · 1 files · 1 commits · open ## 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
On heaps capped at `PORTABLE_VIEWS` (1,000,000 descriptors, typical on NVIDIA), `dynamic_slots` previously hardcoded `DYNAMIC` (262,144) and ignored `VICTORY_DYNAMIC_SLOTS`.

- Default capped heaps to `DYNAMIC_CAPPED = 7 << 16` (`458_752` dynamic slots), leaving `541,247` 1:1 title slots.
- Honor `VICTORY_DYNAMIC_SLOTS` on capped heaps, clamped to `[DYNAMIC, null / 2]`.
- Fixes high-draw outdoor openings refusing 13-22% of dynamic descriptor tables and dropping draws.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:31:41 +00:00
Author
Owner

@⁠Vaporisateur on GitHub · 2026-11-28 14:06 UTC · original

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** on GitHub · 2026-11-28 14:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1007#issuecomment-7240423030) 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.
Author
Owner

@⁠Vaporisateur on GitHub · 2026-11-28 14:39 UTC · original

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.

**@⁠Vaporisateur** on GitHub · 2026-11-28 14:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1007#issuecomment-7240830926) 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 has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.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/1007/head:github-bot/gh-1007'
git switch 'github-bot/gh-1007'

Merge

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