Repository navigation
Conversation
…ak#3330) NVIDIA caps shader-visible view heaps at 10^6 slots, while translated shaders clamped their indices below HEAP_VIEWS (2^21): an index past the capped heap hung the device on entering the world. The host device is probed at creation for a heap of HEAP_VIEWS; where it refuses one, shaders clamp below PORTABLE_HEAP_VIEWS (10^6) instead. The limit is part of the shader cache key. A capped heap keeps its last slots for the null buffer views and the clamped index, and a fallback heap is never smaller than the limit shaders index. Hosts that take 2^21 slots (AMD) are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
WARP test report (independent)
AI-assisted (Claude Sonnet 5.5). |
LAKSHYA-cmd-tech
added a commit
to LAKSHYA-cmd-tech/VIctory
that referenced
this pull request
Nov 27, 2026
GPU, Shader: probe host device view-heap limits and clamp descriptor heap indices (Marvisak#3476, Marvisak#3330)
AurumCarlos
reviewed
Nov 27, 2026
AurumCarlos
left a comment
There was a problem hiding this comment.
This is the same fix as #2461 (lhnizdo), which changes the same files and was marked a merge candidate after triage re-reviewed it on current main. Worth linking it and saying what this adds, or closing in its favour; several other open PRs target the same cap too (#2185, #2628, #2683…).
Two differences either way:
- The shader crate's test device isn't probed.
set_heap_viewsis only called fromvictory_gpu::host::create.victory-shader's owncreate_device(emit/host.rs) never sets it, so invictory-shadertestsheap_views()stays 2^21 andView::NullBuffersstill asks for a 2^21-slot heap on NVIDIA; the stride/synthetic failures from #1835 stay. #2461 probes in thatcreate_deviceas well. - The new capped-heap comment only holds in the
Errbranch. Withviewsat 10^6,make((count + MIN_DYNAMIC).max(views))succeeds whenevercount + MIN_DYNAMIC≤ 10^6. A title heap of 934,462–934,464 slots then puts its last dynamic slots on 999,997–999,999 (null UAV, null SRV, clamp target), and thenull > count + extracheck skips writing the null views. Checkingcount + MIN_DYNAMIC > roombefore thatmakewould cover it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NVIDIA caps shader-visible view heaps at 10^6 slots, while translated shaders clamped their indices below HEAP_VIEWS (2^21): an index past the capped heap hung the device on entering the world.
The host device is probed at creation for a heap of HEAP_VIEWS; where it refuses one, shaders clamp below PORTABLE_HEAP_VIEWS (10^6) instead. The limit is part of the shader cache key. A capped heap keeps its last slots for the null buffer views and the clamped index, and a fallback heap is never smaller than the limit shaders index. Hosts that take 2^21 slots (AMD) are unchanged.