GPU: preserve full DYNAMIC descriptor range when host view heap is capped at PORTABLE_VIEWS #1548

Open
github-bot wants to merge 4 commits from github-bot/gh-1548 into main AGit
Owner

@⁠n-romanovich on GitHub · 2026-11-24 19:02 UTC · original
n-romanovich:fix/nvidia-dynamic-descriptor-slots → main · +60 −13 · 1 files · 4 commits · open

Summary

Fixes Issue #1496, #747.

Preserves the full DYNAMIC (2^18 = 262,144) descriptor range when a host view heap is capped at PORTABLE_VIEWS (1,000,000, e.g., on NVIDIA) instead of shrinking it to MIN_DYNAMIC (2^16 = 65,536):

  • crates/victory-gpu/src/descriptor/host.rs: when count + DYNAMIC > PORTABLE_VIEWS and make(count + DYNAMIC) fails, allocate PORTABLE_VIEWS with count = PORTABLE_VIEWS - DYNAMIC (737,856) and dynamic = DYNAMIC (262,144). draw.rs::tables() already remaps any table entry >= host.count() into dynamic slots, preventing thousands of world draws from being dropped for lack of dynamic slots.
  • Use checked_add / saturating_add for heap size calculations and update the MIN_DYNAMIC doc comment.
  • Added unit test capped_heap_keeps_full_dynamic_range.

Testing

Tested on Windows 11, NVIDIA GeForce RTX 5060 Ti:

  • cargo clippy --workspace --all-targets --locked -- -D warnings (pass)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (pass)
  • cargo test -p victory-gpu --locked (51 passed, 0 failed, 1 ignored)

AI-assisted: implemented and reviewed with AI assistance.

**@⁠n-romanovich** on GitHub · 2026-11-24 19:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548) `n-romanovich:fix/nvidia-dynamic-descriptor-slots` → `main` · +60 −13 · 1 files · 4 commits · open ## Summary Fixes Issue #1496, #747. Preserves the full `DYNAMIC` (`2^18` = 262,144) descriptor range when a host view heap is capped at `PORTABLE_VIEWS` (`1,000,000`, e.g., on NVIDIA) instead of shrinking it to `MIN_DYNAMIC` (`2^16` = 65,536): - `crates/victory-gpu/src/descriptor/host.rs`: when `count + DYNAMIC > PORTABLE_VIEWS` and `make(count + DYNAMIC)` fails, allocate `PORTABLE_VIEWS` with `count = PORTABLE_VIEWS - DYNAMIC` (737,856) and `dynamic = DYNAMIC` (262,144). `draw.rs::tables()` already remaps any table entry `>= host.count()` into dynamic slots, preventing thousands of world draws from being dropped for lack of dynamic slots. - Use `checked_add` / `saturating_add` for heap size calculations and update the `MIN_DYNAMIC` doc comment. - Added unit test `capped_heap_keeps_full_dynamic_range`. ## Testing Tested on Windows 11, NVIDIA GeForce RTX 5060 Ti: - `cargo clippy --workspace --all-targets --locked -- -D warnings` (pass) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (pass) - `cargo test -p victory-gpu --locked` (51 passed, 0 failed, 1 ignored) AI-assisted: implemented and reviewed with AI assistance.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:55 +00:00
Author
Owner

@⁠ThomasHFWright on GitHub · 2026-11-24 19:04 UTC · original

Related Linux/RTX5090 evidence for the 737856 mirrored / 262144 dynamic split: I just tested the one-line capped-tuple variant from #747 on our proton-fixes + #852/#454/#206 diagnostic stack. The observed title heap has1245184 slots, so that variant reaches the same split as this PR on this input.

Allocation-warning counter reached32768 with65536 dynamic slots and was zero with262144. The latter still showed incomplete debug geometry and later hit the #774 title CPU lookup spin, without a kernel Xid or GPU-fence timeout. Full setup, checks and limits: #747

This is not an exact-head test of4002dd7: your revised decision order, overflow handling and new test were not in that build. It supports the capacity change on this capped Linux setup, not every new branch or a claim that it fixes the whole world render. No duplicate PR needed from our side.

AI-assisted testing with Codex; no game-derived attachments.

**@⁠ThomasHFWright** on GitHub · 2026-11-24 19:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7141564544) Related Linux/RTX5090 evidence for the 737856 mirrored / 262144 dynamic split: I just tested the one-line capped-tuple variant from #747 on our `proton-fixes` + #852/#454/#206 diagnostic stack. The observed title heap has1245184 slots, so that variant reaches the same split as this PR on this input. Allocation-warning counter reached32768 with65536 dynamic slots and was zero with262144. The latter still showed incomplete debug geometry and later hit the #774 title CPU lookup spin, without a kernel Xid or GPU-fence timeout. Full setup, checks and limits: https://git.gtahub.st/github/Marvisak--VIctory/issues/747 This is **not an exact-head test of4002dd7**: your revised decision order, overflow handling and new test were not in that build. It supports the capacity change on this capped Linux setup, not every new branch or a claim that it fixes the whole world render. No duplicate PR needed from our side. AI-assisted testing with Codex; no game-derived attachments.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-24 19:13 UTC · original

Thanks for testing and sharing the Linux / RTX 5090 numbers!

Great to see the allocation-warning counter drop from 32,768 to 0 on the 1,245,184-slot heap — I also observed the exact same count=1245184 capped=737856 dynamic=262144 split on Windows 11 with an RTX 5060 Ti.

I've also linked #747 in the PR description since this addresses the same underlying MIN_DYNAMIC exhaustion.

**@⁠n-romanovich** on GitHub · 2026-11-24 19:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7141783841) Thanks for testing and sharing the Linux / RTX 5090 numbers! Great to see the allocation-warning counter drop from 32,768 to 0 on the 1,245,184-slot heap — I also observed the exact same `count=1245184 capped=737856 dynamic=262144` split on Windows 11 with an RTX 5060 Ti. I've also linked #747 in the PR description since this addresses the same underlying `MIN_DYNAMIC` exhaustion.
Author
Owner

@⁠Ender1Dragon on GitHub · 2026-11-24 19:17 UTC · original

Verified on RTX 3080 Ti, driver 32.0.16.2101, Windows 11 build 26300, main @ 2026-11-24, release+diagnostics. Applied this branch and rebuilt (10 s). Same dump, same launch arguments.

Before (main):

WARN a draw or dispatch dropped: no dynamic slots for its tables dropped=32768

My instrumented build reported the first failure as:

requested=11  capacity=65536  free_slots=482  largest_free_run=10

After (this branch):

WARN host view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144
no dynamic slots for its tables: 0 occurrences over a 150 s world run

Note count=1,245,184 here, which is 24% past PORTABLE_VIEWS rather than just over it, so this exercises the capped branch from further out than the 5060 Ti run. Frames captured from the same window went from a 1.8 MB peak to 4.1 MB, and the world no longer drops binds.

3D world content itself is still mostly black on this card, but that is the separate shader/refusal path (#71), not this fix. Slot exhaustion is gone.

**@⁠Ender1Dragon** on GitHub · 2026-11-24 19:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7141882617) Verified on RTX 3080 Ti, driver 32.0.16.2101, Windows 11 build 26300, `main` @ 2026-11-24, release+diagnostics. Applied this branch and rebuilt (10 s). Same dump, same launch arguments. **Before (main):** ``` WARN a draw or dispatch dropped: no dynamic slots for its tables dropped=32768 ``` My instrumented build reported the first failure as: ``` requested=11 capacity=65536 free_slots=482 largest_free_run=10 ``` **After (this branch):** ``` WARN host view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144 ``` ``` no dynamic slots for its tables: 0 occurrences over a 150 s world run ``` Note `count=1,245,184` here, which is 24% past `PORTABLE_VIEWS` rather than just over it, so this exercises the capped branch from further out than the 5060 Ti run. Frames captured from the same window went from a 1.8 MB peak to 4.1 MB, and the world no longer drops binds. 3D world content itself is still mostly black on this card, but that is the separate shader/refusal path (#71), not this fix. Slot exhaustion is gone.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-24 19:22 UTC · original

Awesome, thanks for testing and confirming the fix! Glad to see the slot exhaustion is completely resolved.

**@⁠n-romanovich** on GitHub · 2026-11-24 19:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7142006343) Awesome, thanks for testing and confirming the fix! Glad to see the slot exhaustion is completely resolved.
Author
Owner

@⁠YaBulochka on GitHub · 2026-11-24 19:26 UTC · original

Linux/RADV data point: the fix does what it says, but the warning it adds is loud.

GPU RX 7600 XT, RADV from Mesa 26.3.1
OS Linux, Wine 11.22 in a Proton 11.0 prefix, vkd3d-proton from Proton
Tree ffe310e + #994 + #491 + this PR

The title asks for 1,245,184 views against the 1,000,000 cap, exactly the shape in #1496. With this PR the log shows:

host view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144

Before the PR it mirrored 934,464 with no dynamic range. In a 90-second run:

  • title slot past the host heap: 507,328 lines;
  • of those, for_draw=true: 0.

So no draw loses its slot any more - that part is confirmed on RADV. The run still ends, but on an unrelated vkCreate*Pipelines shader (the pipeline journal catches it and refuses it on the next start), not on the heap.

The one thing worth changing: 507k warnings for 90 seconds produce a 110 MB log, which makes the rest of the log hard to read and costs time. A single line per index range, or a counter printed once per frame or once at exit, would keep the diagnostic without the flood. The for_draw=false case in particular seems to be "a title slot exists that no draw uses", which is not an error at all.

I will keep this build as my baseline and report whether the world draws return once the journal ratchet gets past the remaining pipelines.

**@⁠YaBulochka** on GitHub · 2026-11-24 19:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7142095792) Linux/RADV data point: the fix does what it says, but the warning it adds is loud. | | | |---|---| | GPU | RX 7600 XT, RADV from Mesa 26.3.1 | | OS | Linux, Wine 11.22 in a Proton 11.0 prefix, vkd3d-proton from Proton | | Tree | `ffe310e` + #994 + #491 + this PR | The title asks for 1,245,184 views against the 1,000,000 cap, exactly the shape in #1496. With this PR the log shows: ``` host view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144 ``` Before the PR it mirrored 934,464 with no dynamic range. In a 90-second run: - `title slot past the host heap`: **507,328** lines; - of those, `for_draw=true`: **0**. So no draw loses its slot any more - that part is confirmed on RADV. The run still ends, but on an unrelated `vkCreate*Pipelines` shader (the pipeline journal catches it and refuses it on the next start), not on the heap. The one thing worth changing: 507k warnings for 90 seconds produce a 110 MB log, which makes the rest of the log hard to read and costs time. A single line per index range, or a counter printed once per frame or once at exit, would keep the diagnostic without the flood. The `for_draw=false` case in particular seems to be "a title slot exists that no draw uses", which is not an error at all. I will keep this build as my baseline and report whether the world draws return once the journal ratchet gets past the remaining pipelines.
Author
Owner

@⁠Impre-visible on GitHub · 2026-11-24 19:35 UTC · original

Test result for the idea of this PR on Linux (Wine from GE-Proton11-6 + vkd3d-proton, GTX 1660, NVIDIA 620.73.04), where the view heap is capped (count=1245184 host_limit=1000000).

I could not merge the branch as is (it conflicts with #1523 in descriptor/host.rs, which I already had), so I applied the same idea on top of #1523: the capped heap keeps DYNAMIC slots instead of MIN_DYNAMIC.

Capped heap keeps a draw or dispatch dropped: no dynamic slots for its tables warnings in one run to about frame 1950-2050 title slots left out of the host heap
MIN_DYNAMIC (main) 16 310,720
MIN_DYNAMIC + #1523 17 310,720
DYNAMIC (this PR's idea) 0 507,328

No device removal in any of the three. These drops only show once indirect execution actually runs (under Wine that needs the native d3dcompiler_47, see my note on #523). The final image is still dark in all three, so I cannot say whether the 507,328 left-out title slots are ever read.

**@⁠Impre-visible** on GitHub · 2026-11-24 19:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7142324430) Test result for the idea of this PR on Linux (Wine from GE-Proton11-6 + vkd3d-proton, GTX 1660, NVIDIA 620.73.04), where the view heap is capped (`count=1245184 host_limit=1000000`). I could not merge the branch as is (it conflicts with #1523 in `descriptor/host.rs`, which I already had), so I applied the same idea on top of #1523: the capped heap keeps `DYNAMIC` slots instead of `MIN_DYNAMIC`. | Capped heap keeps | `a draw or dispatch dropped: no dynamic slots for its tables` warnings in one run to about frame 1950-2050 | title slots left out of the host heap | |---|---|---| | `MIN_DYNAMIC` (main) | 16 | 310,720 | | `MIN_DYNAMIC` + #1523 | 17 | 310,720 | | `DYNAMIC` (this PR's idea) | **0** | 507,328 | No device removal in any of the three. These drops only show once indirect execution actually runs (under Wine that needs the native `d3dcompiler_47`, see my note on #523). The final image is still dark in all three, so I cannot say whether the 507,328 left-out title slots are ever read.
Author
Owner

@⁠Bullet18x on GitHub · 2026-11-24 20:07 UTC · original

RTX 5090 (driver 621.40, Windows 11 10.0.28000), head 4002dd7 on ffe310e, diag build, in the world: log shows host view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144, and no no dynamic slots for its tables drops at all (on main the same machine reaches dropped=8192, on #1520's branch dropped=262144). The run still ends in DXGI_ERROR_DEVICE_HUNG ~37 s into the world (as on main), so on this machine the dynamic-slot shortage is not what hangs. Trade-off to note: 507,328 of the title's 1,245,184 slots are now outside the heap (310,720 with MIN_DYNAMIC). Details of the other experiments: #1586.

AI use: Claude Code (Claude Opus 5.5) built, ran and summarised; I checked it.

**@⁠Bullet18x** on GitHub · 2026-11-24 20:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7143071490) RTX 5090 (driver 621.40, Windows 11 10.0.28000), head `4002dd7` on `ffe310e`, diag build, in the world: log shows `host view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144`, and **no** `no dynamic slots for its tables` drops at all (on `main` the same machine reaches `dropped=8192`, on #1520's branch `dropped=262144`). The run still ends in `DXGI_ERROR_DEVICE_HUNG` ~37 s into the world (as on `main`), so on this machine the dynamic-slot shortage is not what hangs. Trade-off to note: 507,328 of the title's 1,245,184 slots are now outside the heap (310,720 with `MIN_DYNAMIC`). Details of the other experiments: #1586. AI use: Claude Code (Claude Opus 5.5) built, ran and summarised; I checked it.
Author
Owner

@⁠Bladureau on GitHub · 2026-11-24 20:12 UTC · original

Tested 4002dd7 in the title on an RTX 4060 Laptop (8 GB). No more dynamic-slot drops. The picture is still black, for another reason (below).

Setup: Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.14), i7-13650HX, 32 GB, title 1.0.2.1 (exe BLAKE3 b99f876b74d4a77f…). This PR is merged onto main ffe310e with #578 (fb7facd, so the world does not hang on this card) and #334 (c99e429), all cleanly. Diag build, VICTORY_D3D12_DRED=1. I played into the first mission's intro by hand. The log shows the expected split: host view heap capped at 1000000 count=1245184, 737,856 mirrored + 262,144 dynamic.

Without this PR (9 earlier runs) main + #578 + #334 + this PR
no dynamic slots for its tables / no free dynamic descriptor slots in every world run; dropped= reached 512 to 65,536 0
Device removal every run (none had #578) none in about 200 s in the world (closed by me)
Picture black still black

From the frame report at the end of the run: 1.0 fps, 968 ms/frame. 636 ms of that is preparation, mostly about 2 GB of refreshes per frame, and 225 ms is on the GPU. 442 draws/frame run. Per frame, 3,777 draws and dispatches are dropped without a host pipeline, plus 5,012 indirect executions. In the per-pipeline list, about four fifths of those drops are pipelines #578 refuses (wave64 mesh and compute), and the rest are shaders that do not translate. So on this card, with #578, the wave64 refusals are now what keeps the picture empty, not the descriptor slots.

**@⁠Bladureau** on GitHub · 2026-11-24 20:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7143180167) Tested `4002dd7` in the title on an **RTX 4060 Laptop (8 GB)**. No more dynamic-slot drops. The picture is still black, for another reason (below). **Setup:** Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.14), i7-13650HX, 32 GB, title 1.0.2.1 (exe BLAKE3 `b99f876b74d4a77f…`). This PR is merged onto `main` `ffe310e` with #578 (`fb7facd`, so the world does not hang on this card) and #334 (`c99e429`), all cleanly. Diag build, `VICTORY_D3D12_DRED=1`. I played into the first mission's intro by hand. The log shows the expected split: `host view heap capped at 1000000 count=1245184`, 737,856 mirrored + 262,144 dynamic. | | Without this PR (9 earlier runs) | `main` + #578 + #334 + this PR | |---|---|---| | `no dynamic slots for its tables` / `no free dynamic descriptor slots` | in every world run; `dropped=` reached 512 to 65,536 | **0** | | Device removal | every run (none had #578) | none in about 200 s in the world (closed by me) | | Picture | black | still black | From the frame report at the end of the run: 1.0 fps, 968 ms/frame. 636 ms of that is preparation, mostly about 2 GB of refreshes per frame, and 225 ms is on the GPU. **442 draws/frame** run. Per frame, 3,777 draws and dispatches are dropped without a host pipeline, plus 5,012 indirect executions. In the per-pipeline list, about four fifths of those drops are pipelines #578 refuses (wave64 mesh and compute), and the rest are shaders that do not translate. So on this card, with #578, the wave64 refusals are now what keeps the picture empty, not the descriptor slots.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:30 UTC · original · edited 2026-11-26 00:25 UTC

Automated triage for the maintainers.

Needs work. Thank you for working through the earlier points. In HostHeap::new (crates/victory-gpu/src/descriptor/host.rs) the comment now says that slots past the cap are left out, which is accurate. The .max(views) problem is gone, and CAPPED_PAIRS leaves room for the copy pairs. Testers on several NVIDIA cards and RADV confirm that the no dynamic slots drops disappear, and one measured more draws per frame. What still stands:

  • The trade-off is still unbacked, and it has grown. For the title's 1,245,184-slot heap, the capped branch now keeps 713,280 title slots (1,000,000 - 262,144 - 24,576), compared with 934,464 on main. As you say in your reply, there is no count yet of draws reading the dropped slots (713,280..934,464) through the heap. That evidence is what would let this land.
  • New regression in the middle range. Branch 3 now requires count + MIN_DYNAMIC <= PORTABLE_VIEWS - CAPPED_PAIRS. A title heap of about 909,900..934,464 slots, which main keeps whole (make(count + MIN_DYNAMIC) fits under 1,000,000), now falls to the capped branch and keeps only 713,280. Please make the step continuous, for example by keeping min(count, PORTABLE_VIEWS - MIN_DYNAMIC - CAPPED_PAIRS) with MIN_DYNAMIC before dropping to the DYNAMIC split. Please also say where 24,576 comes from: a tester needed 16,384, and #1777 reserves 3 slots for the null buffer views.
  • capped_heap_keeps_full_dynamic_range creates two million-slot heaps. A tester reported that this made timing-sensitive tests running beside it intermittently fail. One heap would do.

You also note that #2177 supersedes this PR, and #1777 conflicts with it in the same function. If you plan to rely on #2177, saying so here or closing this PR would help the maintainers.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7149628786) · edited 2026-11-26 00:25 UTC <!-- victory-triage v1 head=6b72ce9db357c7bbc1caf1177709078da1403e23 verdict=needs-work at=2026-11-26T00:25:46Z --> Automated triage for the maintainers. **Needs work.** Thank you for working through the earlier points. In `HostHeap::new` (`crates/victory-gpu/src/descriptor/host.rs`) the comment now says that slots past the cap are left out, which is accurate. The `.max(views)` problem is gone, and `CAPPED_PAIRS` leaves room for the copy pairs. Testers on several NVIDIA cards and RADV confirm that the `no dynamic slots` drops disappear, and one measured more draws per frame. What still stands: - **The trade-off is still unbacked, and it has grown.** For the title's 1,245,184-slot heap, the capped branch now keeps 713,280 title slots (1,000,000 - 262,144 - 24,576), compared with 934,464 on `main`. As you say in your reply, there is no count yet of draws reading the dropped slots (713,280..934,464) through the heap. That evidence is what would let this land. - **New regression in the middle range.** Branch 3 now requires `count + MIN_DYNAMIC <= PORTABLE_VIEWS - CAPPED_PAIRS`. A title heap of about 909,900..934,464 slots, which `main` keeps whole (`make(count + MIN_DYNAMIC)` fits under 1,000,000), now falls to the capped branch and keeps only 713,280. Please make the step continuous, for example by keeping `min(count, PORTABLE_VIEWS - MIN_DYNAMIC - CAPPED_PAIRS)` with `MIN_DYNAMIC` before dropping to the `DYNAMIC` split. Please also say where 24,576 comes from: a tester needed 16,384, and #1777 reserves 3 slots for the null buffer views. - `capped_heap_keeps_full_dynamic_range` creates two million-slot heaps. A tester reported that this made timing-sensitive tests running beside it intermittently fail. One heap would do. You also note that #2177 supersedes this PR, and #1777 conflicts with it in the same function. If you plan to rely on #2177, saying so here or closing this PR would help the maintainers. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 01:44 UTC · original

@⁠Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.

**@⁠n-romanovich** on GitHub · 2026-11-25 01:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7149902415) @⁠Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.
Author
Owner

@⁠astrosteveo on GitHub · 2026-11-25 02:43 UTC · original

On the triage point about heaps between 737,856 and 934,464 slots: I reproduced it on an RTX 5080 (Wine 11.22, vkd3d-proton 3.1, driver 620.73.04), and one word fixes it.

Adding this to capped_heap_keeps_full_dynamic_range fails at 7866124 (left: 737856, right: 934464):

// A heap that fits with the smaller range keeps every title slot.
let count = PORTABLE_VIEWS - MIN_DYNAMIC;
assert_eq!(HostHeap::new(false, count).unwrap().count, count);

With the new branch taken only when the smaller range does not fit either, it passes:

-        } else if count.saturating_add(DYNAMIC) > PORTABLE_VIEWS
+        } else if count.saturating_add(MIN_DYNAMIC) > PORTABLE_VIEWS

The title's heap (1,245,184) still gets your split. Both changes are one commit on top of your head, to cherry-pick if you like: github.com/astrosteveo/VIctory@6763ec7948

cargo test -p victory-gpu --lib: 139 passed, 5 failed, 2 ignored; the 5 also fail on main 940d32f here. Clippy for x86_64-pc-windows-msvc: clean. No title run yet, so this says nothing on the other point, whether the title reads the slots between 737,856 and 934,464 through the heap.

AI-assisted (Claude).

**@⁠astrosteveo** on GitHub · 2026-11-25 02:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7151090719) On the triage point about heaps between 737,856 and 934,464 slots: I reproduced it on an RTX 5080 (Wine 11.22, vkd3d-proton 3.1, driver 620.73.04), and one word fixes it. Adding this to `capped_heap_keeps_full_dynamic_range` fails at `7866124` (`left: 737856, right: 934464`): ```rust // A heap that fits with the smaller range keeps every title slot. let count = PORTABLE_VIEWS - MIN_DYNAMIC; assert_eq!(HostHeap::new(false, count).unwrap().count, count); ``` With the new branch taken only when the smaller range does not fit either, it passes: ```diff - } else if count.saturating_add(DYNAMIC) > PORTABLE_VIEWS + } else if count.saturating_add(MIN_DYNAMIC) > PORTABLE_VIEWS ``` The title's heap (1,245,184) still gets your split. Both changes are one commit on top of your head, to cherry-pick if you like: https://github.com/astrosteveo/VIctory/commit/6763ec7948d9c92edab8000641fe6a59694f783e `cargo test -p victory-gpu --lib`: 139 passed, 5 failed, 2 ignored; the 5 also fail on `main` `940d32f` here. Clippy for `x86_64-pc-windows-msvc`: clean. No title run yet, so this says nothing on the other point, whether the title reads the slots between 737,856 and 934,464 through the heap. AI-assisted (Claude).
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 05:56 UTC · original

@⁠Marvisak, updated fix/nvidia-dynamic-descriptor-slots (75e202b) so the PORTABLE_VIEWS cap fallback only runs on overflow:

  • HostHeap::new now tries count + DYNAMIC, then count + MIN_DYNAMIC, and only falls back to PORTABLE_VIEWS (737,856 title slots + DYNAMIC) when count + MIN_DYNAMIC > PORTABLE_VIEWS.
  • Heaps with count between 737,856 and 934,464 now keep all of their title slots on 1M-capped hosts instead of being truncated.
**@⁠n-romanovich** on GitHub · 2026-11-25 05:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7154287019) @⁠Marvisak, updated `fix/nvidia-dynamic-descriptor-slots` (`75e202b`) so the `PORTABLE_VIEWS` cap fallback only runs on overflow: - `HostHeap::new` now tries `count + DYNAMIC`, then `count + MIN_DYNAMIC`, and only falls back to `PORTABLE_VIEWS` (`737,856` title slots + `DYNAMIC`) when `count + MIN_DYNAMIC > PORTABLE_VIEWS`. - Heaps with `count` between `737,856` and `934,464` now keep all of their title slots on 1M-capped hosts instead of being truncated.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 07:11 UTC · original

@⁠Marvisak, added the middle-range assertion (count = PORTABLE_VIEWS - MIN_DYNAMIC) to capped_heap_keeps_full_dynamic_range in bf0004c and verified on RTX 5060 Ti (1 passed; 0 failed): PORTABLE_VIEWS - MIN_DYNAMIC keeps all 934,464 title slots while PORTABLE_VIEWS keeps the full DYNAMIC (2^18) range.

On the open trade-off: 737,856..934,464 still keeps all title slots as noted; we don't have a separate for_draw=true histogram for 737,856..934,464 specifically to settle whether direct ResourceHeap reads ever target that slice on 1,245,184-slot titles.

**@⁠n-romanovich** on GitHub · 2026-11-25 07:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7155580365) @⁠Marvisak, added the middle-range assertion (`count = PORTABLE_VIEWS - MIN_DYNAMIC`) to `capped_heap_keeps_full_dynamic_range` in `bf0004c` and verified on RTX 5060 Ti (`1 passed; 0 failed`): `PORTABLE_VIEWS - MIN_DYNAMIC` keeps all `934,464` title slots while `PORTABLE_VIEWS` keeps the full `DYNAMIC` (`2^18`) range. On the open trade-off: `737,856..934,464` still keeps all title slots as noted; we don't have a separate `for_draw=true` histogram for `737,856..934,464` specifically to settle whether direct `ResourceHeap` reads ever target that slice on 1,245,184-slot titles.
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-25 08:15 UTC · original

Same change as the one I measured on #747 (RTX 5090, Wine + vkd3d-proton): with the capped heap keeping DYNAMIC slots, the no dynamic slots warnings went from 20 to 0 per run, and the indirect calls dropped as prepare failed for kinds 1 and 2 stopped. Without it, main 940d32f logs title slot past the host heap about 84,000 times before world entry on that card.

AI-assisted (Claude); measured on my machine.

**@⁠neonbyte1** on GitHub · 2026-11-25 08:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7156809897) Same change as the one I measured on #747 (RTX 5090, Wine + vkd3d-proton): with the capped heap keeping `DYNAMIC` slots, the `no dynamic slots` warnings went from 20 to 0 per run, and the indirect calls dropped as `prepare failed` for kinds 1 and 2 stopped. Without it, `main` 940d32f logs `title slot past the host heap` about 84,000 times before world entry on that card. _AI-assisted (Claude); measured on my machine._
Author
Owner

@⁠Machad3x on GitHub · 2026-11-25 11:35 UTC · original · edited 2026-11-25 11:37 UTC

RTX 3080 Ti (driver 621.24, Windows 11 26300): the dynamic-slot drops are gone; two tests need a small change on this card

Base: main 940d32f plus other open fixes, including #1751, with this PR (75e202b) on top. The title asks for 1,245,184 views.

5- to 7-minute runs before this PR with it
no dynamic slots for its tables up to dropped=32768 none
capped heap 934,464 title slots, 65,536 dynamic 721,472 + 262,144 dynamic (with the change below)
dropped indirect calls per frame, last samples 100-870 across earlier runs of the older stack about 95 (not clearly different)

One run per build, so run-to-run variation is not measured.

With this PR as it is, on top of #1751, two tests failed here:

  • descriptor::host::tests::dynamic_slots_are_held_until_released (65,536 vs 262,144): the resolved fallback chain no longer had #1751's (count + DYNAMIC).max(PORTABLE_VIEWS) step for a small title heap.
  • memory::tests::lists_share_a_table_and_copies_keep_their_views (past the dynamic slots): (PORTABLE_VIEWS - DYNAMIC) + DYNAMIC fills the heap, leaving nothing for the copies' view pairs.

Both pass locally after keeping #1751's step before the MIN_DYNAMIC one and capping title slots at PORTABLE_VIEWS - DYNAMIC - 2^14, so that 16,384 slots stay for pairs. The run in the table is with that change. The null buffer views still do not fit (no room for the null buffer views).

AI-assisted (Claude Code).

**@⁠Machad3x** on GitHub · 2026-11-25 11:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7161237689) · edited 2026-11-25 11:37 UTC **RTX 3080 Ti (driver 621.24, Windows 11 26300): the dynamic-slot drops are gone; two tests need a small change on this card** Base: `main` `940d32f` plus other open fixes, including #1751, with this PR (`75e202b`) on top. The title asks for 1,245,184 views. | 5- to 7-minute runs | before this PR | with it | |---|---|---| | `no dynamic slots for its tables` | up to `dropped=32768` | none | | capped heap | 934,464 title slots, 65,536 dynamic | 721,472 + 262,144 dynamic (with the change below) | | dropped indirect calls per frame, last samples | 100-870 across earlier runs of the older stack | about 95 (not clearly different) | One run per build, so run-to-run variation is not measured. With this PR as it is, on top of #1751, two tests failed here: - `descriptor::host::tests::dynamic_slots_are_held_until_released` (65,536 vs 262,144): the resolved fallback chain no longer had #1751's `(count + DYNAMIC).max(PORTABLE_VIEWS)` step for a small title heap. - `memory::tests::lists_share_a_table_and_copies_keep_their_views` (`past the dynamic slots`): `(PORTABLE_VIEWS - DYNAMIC) + DYNAMIC` fills the heap, leaving nothing for the copies' view pairs. Both pass locally after keeping #1751's step before the `MIN_DYNAMIC` one and capping title slots at `PORTABLE_VIEWS - DYNAMIC - 2^14`, so that 16,384 slots stay for pairs. The run in the table is with that change. The null buffer views still do not fit (`no room for the null buffer views`). AI-assisted (Claude Code).
Author
Owner

@⁠Spaghetih on GitHub · 2026-11-25 21:53 UTC · original

Measured on an RTX 4070 Ti (12 GB, driver 32.0.16.2124 / 621.24), i7-13700KF, Windows 11 26200, title 1.0.2.1, Series X, diag build, 9-minute runs into the intro cutscene in the world.

Tree: main 13f91ca + #233, #454, #89, #1906, #2178, #2098, then #1777 and #2634, then this PR.

Without this PR (the capped heap keeps MIN_DYNAMIC), the world dropped draws for lack of dynamic slots every frame:

dropped 1892.0/frame without a host pipeline: indirect kind 10: prepare failed (compute false, mesh true): no dynamic slots for root views
dropped  219.0/frame without a host pipeline: indirect kind 10: prepare failed (compute false, mesh true): no dynamic slots for its tables
dropped   42.5/frame without a host pipeline: indirect kind 1: prepare failed (compute false, mesh false): no dynamic slots for root views

With it: host view heap capped at 1000000 count=1245184 kept=737853 dynamic=262144, and no "no dynamic slots" drop at all in 9 minutes, no device removal. Draws per world frame peaked at 10,452 (6,263 without it). Frame rate stayed about the same (0.7-2 fps with it, 0.2-1.9 without; the run without it also had a cold pipeline library), so the gain here is the draws, not speed.

Combining it with #1777: they conflict in HostHeap::new. #1777 removes PORTABLE_VIEWS (the cap is heap_views()) and keeps the heap's last three slots for the null buffer views and the clamped index; this PR's split (737,856 + 262,144 = 1,000,000) leaves no room for them. I kept both rules:

} else if let dynamic = DYNAMIC
    && count.saturating_add(dynamic + 3) > views
    && views > dynamic + 3
    && let Ok(heap) = make(views)
{
    let kept = views - dynamic - 3;
    tracing::warn!(count, kept, dynamic, "host view heap capped at {views}");
    (heap, kept, dynamic)
}

With that, cargo test -p victory-gpu passes on this card, including #1777's null-view tests. One caveat for the test here: making a second million-slot heap in capped_heap_keeps_full_dynamic_range slowed the timing-sensitive tests running beside it into intermittent failures (3 in 8 full runs; 8/8 green with the test skipped). A single capped heap in that test kept the suite stable.

AI-assisted (Claude Code); the runs and the card are mine.

**@⁠Spaghetih** on GitHub · 2026-11-25 21:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7175671083) Measured on an RTX 4070 Ti (12 GB, driver 32.0.16.2124 / 621.24), i7-13700KF, Windows 11 26200, title 1.0.2.1, Series X, diag build, 9-minute runs into the intro cutscene in the world. **Tree:** `main` 13f91ca + #233, #454, #89, #1906, #2178, #2098, then #1777 and #2634, then this PR. **Without this PR** (the capped heap keeps `MIN_DYNAMIC`), the world dropped draws for lack of dynamic slots every frame: ``` dropped 1892.0/frame without a host pipeline: indirect kind 10: prepare failed (compute false, mesh true): no dynamic slots for root views dropped 219.0/frame without a host pipeline: indirect kind 10: prepare failed (compute false, mesh true): no dynamic slots for its tables dropped 42.5/frame without a host pipeline: indirect kind 1: prepare failed (compute false, mesh false): no dynamic slots for root views ``` **With it:** `host view heap capped at 1000000 count=1245184 kept=737853 dynamic=262144`, and no "no dynamic slots" drop at all in 9 minutes, no device removal. Draws per world frame peaked at 10,452 (6,263 without it). Frame rate stayed about the same (0.7-2 fps with it, 0.2-1.9 without; the run without it also had a cold pipeline library), so the gain here is the draws, not speed. **Combining it with #1777:** they conflict in `HostHeap::new`. #1777 removes `PORTABLE_VIEWS` (the cap is `heap_views()`) and keeps the heap's last three slots for the null buffer views and the clamped index; this PR's split (737,856 + 262,144 = 1,000,000) leaves no room for them. I kept both rules: ```rust } else if let dynamic = DYNAMIC && count.saturating_add(dynamic + 3) > views && views > dynamic + 3 && let Ok(heap) = make(views) { let kept = views - dynamic - 3; tracing::warn!(count, kept, dynamic, "host view heap capped at {views}"); (heap, kept, dynamic) } ``` With that, `cargo test -p victory-gpu` passes on this card, including #1777's null-view tests. One caveat for the test here: making a second million-slot heap in `capped_heap_keeps_full_dynamic_range` slowed the timing-sensitive tests running beside it into intermittent failures (3 in 8 full runs; 8/8 green with the test skipped). A single capped heap in that test kept the suite stable. AI-assisted (Claude Code); the runs and the card are mine.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 22:57 UTC · original

@⁠Marvisak Updated fix/nvidia-dynamic-descriptor-slots (6b72ce9):

  • Reworded the comment on capped heaps to state that descriptors past the cap are left out (HostHeap::mirror returns None for index >= self.count) rather than remapped.
  • Fixed the MIN_DYNAMIC fallback branch to use PORTABLE_VIEWS without .max(views) (HEAP_VIEWS = 2^21), and reserved CAPPED_PAIRS (24_576) so memory::tests::lists_share_a_table_and_copies_keep_their_views passes on a 1M-capped NVIDIA card.
  • Verified capped_heap_keeps_full_dynamic_range and lists_share_a_table_and_copies_keep_their_views locally on a 1M-capped NVIDIA GPU; CI check passes.

Note: #2177 supersedes this with host_heap_views() probing and shader clamping if you prefer to land #2177 instead.

**@⁠n-romanovich** on GitHub · 2026-11-25 22:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7176983697) @⁠Marvisak Updated `fix/nvidia-dynamic-descriptor-slots` (`6b72ce9`): - Reworded the comment on capped heaps to state that descriptors past the cap are left out (`HostHeap::mirror` returns `None` for `index >= self.count`) rather than remapped. - Fixed the `MIN_DYNAMIC` fallback branch to use `PORTABLE_VIEWS` without `.max(views)` (`HEAP_VIEWS = 2^21`), and reserved `CAPPED_PAIRS` (`24_576`) so `memory::tests::lists_share_a_table_and_copies_keep_their_views` passes on a 1M-capped NVIDIA card. - Verified `capped_heap_keeps_full_dynamic_range` and `lists_share_a_table_and_copies_keep_their_views` locally on a 1M-capped NVIDIA GPU; CI `check` passes. Note: #2177 supersedes this with `host_heap_views()` probing and shader clamping if you prefer to land #2177 instead.
Author
Owner

@⁠postblink on GitHub · 2026-11-26 07:39 UTC · original

Linux / Proton, RTX 5080: the dynamic-slot drops are gone with this PR, and #2461 doesn't remove them

Setup: GE-Proton11-14's wine, vkd3d-proton master 71cae091, NVIDIA driver 620.73.04, title 1.0.2.1, diag build, 12-minute runs into the prologue (in the world, with player control). The heap is capped as on Windows: count=1245184, host cap 1,000,000.

Base for all three runs: main 63bcca4 + #2723 + #2969 + #189. Each run adds one heap change. Numbers are per frame, medians over the in-world reports:

base + this PR (6b72ce9) + #2461 (2b5f652)
dropped: no dynamic slots for root views / its tables ~1,056 0 ~445
fps (second half of run) 1.9 1.7 1.7

This PR logs capped=713280 dynamic=262144 pairs=24576. fps doesn't go up because the draws that were dropped now run, and this scene is GPU-bound for other reasons. The other drops are unchanged with or without it: a dispatch whose root view's offset isn't in a title buffer, and pipelines whose shaders don't translate.

AI-assisted (Claude), runs and numbers from my own hardware.

**@⁠postblink** on GitHub · 2026-11-26 07:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1548#issuecomment-7185701602) **Linux / Proton, RTX 5080: the dynamic-slot drops are gone with this PR, and #2461 doesn't remove them** Setup: GE-Proton11-14's `wine`, vkd3d-proton master `71cae091`, NVIDIA driver 620.73.04, title 1.0.2.1, diag build, 12-minute runs into the prologue (in the world, with player control). The heap is capped as on Windows: `count=1245184`, host cap 1,000,000. Base for all three runs: `main` `63bcca4` + #2723 + #2969 + #189. Each run adds one heap change. Numbers are per frame, medians over the in-world reports: | | base | + this PR (`6b72ce9`) | + #2461 (`2b5f652`) | |---|---|---|---| | dropped: `no dynamic slots for root views / its tables` | ~1,056 | **0** | ~445 | | fps (second half of run) | 1.9 | 1.7 | 1.7 | This PR logs `capped=713280 dynamic=262144 pairs=24576`. fps doesn't go up because the draws that were dropped now run, and this scene is GPU-bound for other reasons. The other drops are unchanged with or without it: a dispatch whose root view's offset isn't in a title buffer, and pipelines whose shaders don't translate. _AI-assisted (Claude), runs and numbers from my own hardware._
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1548/head:github-bot/gh-1548'
git switch 'github-bot/gh-1548'

Merge

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