GPU: capped view heaps keep the full dynamic range (NVIDIA) #1751
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1751
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1751"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@JurajSimicevic on GitHub · 2026-11-24 21:59 UTC · original
JurajSimicevic:gpu/capped-heap-dynamic→main· +27 −4 · 1 files · 1 commits · closed without mergingSince
c75fdbathe larger dynamic range (DYNAMIC, 2^18 slots) is only given where the host takes a view heap of at leastHEAP_VIEWS(2^21). NVIDIA refuses shader-visible view heaps over 1,000,000 descriptors, so every view heap there fell toMIN_DYNAMIC(2^16). The same change made two tests fail on every NVIDIA host (reported in #1744 and in #1633).Scope (edited after Machad3x's check in the title): this covers title heaps of up to 737,856 views (
1,000,000 - DYNAMIC) and the two tests. It does not change GTA VI's world. The title asks for 1,245,184 views, so its heap still takes the capped fallback withMIN_DYNAMIC, and the drops for lack of dynamic slots (#59, #1496) remain. #1779 covers that heap.What
descriptor/host.rs,HostHeap::new: after(count + DYNAMIC).max(HEAP_VIEWS)is refused, try(count + DYNAMIC).max(PORTABLE_VIEWS)before falling toMIN_DYNAMIC. A capped host gets every title slot, the full dynamic range and, past them, room for the host copies' view pairs (crate::memory), as an uncapped one does. Indices past the heap still fault there, as the existing shortcut says; that part is unchanged.count + DYNAMICexceedsPORTABLE_VIEWSkeep today's path (MIN_DYNAMIC, then the cap). #1548 is about that case and doesn't overlap with this.dynamic_slots_are_held_until_released: theHEAP_VIEWSsize is asserted where the host takes a heap that large, and the full dynamic range everywhere.Tests
RTX 5080 (driver 32.0.16.1742), Windows 11 26200: this host refuses a 2^21 heap and accepts 1,000,000.
cargo test -p victory-gpu --locked: 78 passed (onmain: 76 passed, 2 failed,dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views).cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings: clean.cargo test --workspace --locked: the 3victory-shaderfailures from #1744 remain; that crate doesn't depend on this change.In the game: not checked
Later, on
main940d32fwithout this change (which now reaches the world on this host): the title's heap is capped at 1,000,000 with 65,536 dynamic slots. Machad3x's log in the comments shows the same with this change, as the scope above says.mainat70564aecurrently stops on this NVIDIA host (#1753) about 7 s after start, before the world:CreateUnorderedAccessViewon aB5G5R5A1_UNORMtexture (no typed UAV support), thenDXGI_ERROR_INVALID_CALL. Plainmainand this branch stop the same way (same message, same 310,720title slot past the host heapwarnings), so the drop counts in the world couldn't be compared yet.AI-assisted (Claude Code).
🤖 Generated with Claude Code
@upipibi on GitHub · 2026-11-24 22:01 UTC · original
Same on Ampere: RTX 3070 8 GB, driver 616.56, Windows 11, debug.
cargo test -p victory-gpu --locked:main70564ae: 76 passed, 2 failed (dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views), 1 ignored;Overlap for the reviewers: #1349 gives capped NVIDIA view heaps the full
DYNAMICrange too. It does that withcapped_split, which takes the dynamic range out of the cap, plus adraw.rschange, and it is based onffe310e, before c75fdba'sHEAP_VIEWSclamp. This PR is the smaller change on currentmain. #1349 also covers thecount + DYNAMIC > PORTABLE_VIEWScase that this PR leaves to #1548.AI-assisted (Claude Code). Synthetic tests only.
@BaggyALPHA on GitHub · 2026-11-25 02:19 UTC · original
Independent synthetic Windows verification on an RTX 3080 (driver 621.24). I applied each current PR head separately to upstream
940d32fand rancargo test -p victory-gpu --locked -- --test-threads=1.940d32f7866124)4521591)The two failures on upstream and #1548 were
dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views. Both pass with #1751. That distinguishes the small-heap fallback covered here from the large-heap cap in #1548. No game files were used.AI-assisted (OpenAI Codex).
@fiestorra on GitHub · 2026-11-25 02:32 UTC · original
Measured on this machine, alone on
main940d32f: the cap and the 310,720 slots are still there, and so is the removalI ran it to help triage the four pull requests on this ground (#1779, #1777, this, and #1770), so a maintainer does not have to guess which one to take. Merge of this branch onto
940d32fwas clean; release build, session 1 (interactive desktop), RTX 4090, driver32.0.16.2124, empty cache, 70 s:against
mainalone on the same machine and the same scenario: identical on all five lines.So this branch, by itself, does not change what the title's own log says about the capped heap: the slots past the mirror are still 310,720, the missing 1440p texture is still missing, and the run still dies at frame 64. That is not necessarily a criticism of the change — keeping the full dynamic range on a capped heap is a real thing to fix — but it means it is not the branch that resolves the sidetracked symptom chain in #1952, and a reviewer comparing the four should not expect it to.
For contrast, from my own measurements on the same machine and the same 70 s scenario:
title slot past the host heapmainmain+ #1779main+ thismain+ #1832 + #1630 (mine)That is the whole comparison I can offer: on this hardware #1779 is the one that takes the slots to zero and moves the frame rate, and this one does neither by itself. If the two do different things — yours keeps the dynamic range the cap takes away, #1779 removes the indices past the cap — then the honest outcome is that they are complementary, and the maintainer should know which symptom each one answers before merging either.
I have not reviewed the diff beyond building it. What I can say is that it merges cleanly onto today's
main, builds, and changes nothing visible on this card — which is information in itself, because a change on the descriptor heap should have shown up in that log one way or the other.No game data is involved: counts and warnings.
Written with an AI assistant.
@Marvisak on GitHub · 2026-11-25 03:40 UTC · original · edited 2026-11-25 14:53 UTC
Automated triage for the maintainers.
Merge candidate (small; the maintainer should decide it together with #1779). In
descriptor/host.rs,HostHeap::newgains one more step: when theHEAP_VIEWS-sized view heap is refused, it tries(count + DYNAMIC).max(PORTABLE_VIEWS)before dropping toMIN_DYNAMIC, so capped hosts (NVIDIA, 1,000,000 views) keep the fullDYNAMICrange. Heaps withcount + DYNAMIC > PORTABLE_VIEWSstill take the existing path. The dynamic slots andpairs(count + extra .. total) fit inside the heap, anddynamic_slots_are_held_until_releasednow assertsHEAP_VIEWSonly where the host accepts it. Testers on three NVIDIA cards report that the two heap-cap test failures are fixed.On your reply: agreed. The title's heap (1,245,184 views) is past
PORTABLE_VIEWS - DYNAMIC(737,856), so it never reaches the new branch. This change helps smaller heaps and the two NVIDIA test failures, not the world's dropped draws. Correcting the description as you plan is all that is needed here. #1779 covers the same tests and the title's heap. If it lands, this PR adds nothing and can be closed; until then it is a safe, small step. That choice is the maintainer's.CI: no check runs on the head commit.
Generated by Claude Code
@Machad3x on GitHub · 2026-11-25 11:21 UTC · original
Note from an RTX 3080 Ti (driver 621.24, Windows 11 26300): for this title this change does not reach its new branch.
The title asks for 1,245,184 views.
count + DYNAMICis then overPORTABLE_VIEWS, somake((count + DYNAMIC).max(PORTABLE_VIEWS))is refused too,count + MIN_DYNAMICis refused, and the capped fallback runs withMIN_DYNAMIC. The log on a build with this PR (main940d32fplus this and other open fixes):1,000,000 - 934,464 = 65,536dynamic slots, anda draw or dispatch dropped: no dynamic slots for its tablesstill appears (up todropped=32768in a 7-minute run).The new branch helps only title heaps with
count + DYNAMIC <= 1,000,000(such as the test's small heap). #1548 changes the capped fallback itself; I have not run it.AI-assisted (Claude Code).
@JurajSimicevic on GitHub · 2026-11-25 13:04 UTC · original
@Machad3x you're right, and thanks for checking it in the title. The title asks for 1,245,184 views.
count + DYNAMIConly fits under 1,000,000 forcountup to 737,856, so the title's heap never reaches the new branch. My own runs on the RTX 5080 log the same thing: the heap is capped at 1,000,000 with 65,536 dynamic slots, and draws are still dropped.The description says so in its second bullet, but it also opens with the world's drops from #59 and #1496, which reads as if this change helps there. It doesn't for this title. I'll edit the description to say plainly what it covers: title heaps up to 737,856 views, and the two tests that fail on every NVIDIA host.
#1779 covers both of those and also the title's heap (block remap, dynamic range on capped hosts). If #1779 is the direction you take, this PR adds nothing beside it and I'll close it. If you'd rather have this small change first, it stays as it is.
AI-assisted.
@fuzeofficlal on GitHub · 2026-11-26 01:01 UTC · original
Independent RTX 5090 (1M view-heap cap hardware) + WARP head-to-head comparison (against
#2461) at head45215912b474merged cleanly ontomain(63bcca43c6a0):victory-gpu(descriptor::host::tests+memory::tests,VICTORY_D3D12_DEBUG=1):dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views.--features diagnostics): 23/23 passed.victory-shader(stride_tests,dxil.dll10.0.26100.0,VICTORY_D3D12_DEBUG=1):a_heap_buffer_read_where_no_buffer_view_is_reads_zerosstill fails withdispatch failed: E_INVALIDARG(plus the pre-existing Blackwell baselinea_heap_buffer_read_by_element_takes_the_views_stride).#2461:#1751only adds the 1,000,000-view fallback inHostHeap::new(descriptor/host.rs) without updatingvictory-shader'sHEAP_VIEWS/NULL_BUFFER_VIEW(2^21 - 1),descriptor/host.rs:207-210(null < total) cannot reserve the null buffer view on a 1M heap and shaders still clamp OOB heap reads to2^21 - 1.#2461threadsview_heap_limit()/null_buffer_view()throughvictory-gpu,shader_cache.rs, andvictory-shader, fixing all three NVIDIA 1M-cap failures on RTX 5090 (includinga_heap_buffer_read_where_no_buffer_view_is_reads_zeros).cargo xtask policy(191 files ok),cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics, 0 warnings).Between the two mutually exclusive approaches,
#2461is the more complete fix on NVIDIA 1M-cap hardware.@JurajSimicevic on GitHub · 2026-11-26 11:04 UTC · original
Closing this in favour of #2461.
For this title, #1751 never helps: the title asks for 1,245,184 views, so its heap never reaches the new branch (Machad3x's note above), and on NVIDIA it still gets 65,536 dynamic slots. #2461 makes the heap at the host's cap with the full 2^18 dynamic range, and lowers the shaders' view limit and null buffer view to match.
a_heap_buffer_read_where_no_buffer_view_is_reads_zeros.#1779 covers the same ground. Whichever of the two the maintainers take, this PR adds nothing beside it.
The dynamic range matters for the picture too. In my dumps on #841 on the RTX 5080, the G-buffer stayed nearly empty while 2,188 to 2,880 draws per frame were dropped for dynamic slots.
Thanks @Machad3x and @fuzeofficlal for checking it.
AI-assisted.
Pull request closed