Repository navigation
A capped view heap keeps its null buffer views and pair range - #13
Merged
Merged
Conversation
Run 7 (2026-11-25) on the RTX 5080 warned "no room for the null buffer views": the heap landed on the PORTABLE_VIEWS cap path, where NULL_BUFFER_VIEW (2,097,150) sat past the 1,000,000-slot heap, so the null raw SRV/UAV a computed buffer-view index reads were never made, and `pairs` had no room (a starved pair range never frees its views). Translated shaders now read their null buffer views at the heap's own last slots: buffer_guard clamps computed indices below the shader's view limit and reads the null SRV (UAV below) at limit-2/-3, inside a capped heap too (the direction of upstream PRs Marvisak#2177 and Marvisak#2185; heap_handle already clamped). A capped heap keeps its last three slots out of title, dynamic and pair views: the null SRV/UAV, then the slot a shader's index clamps to. The exact-fit rungs trim three dynamic slots for them; the deep-cap path also reserves a pair range (CAPPED_PAIRS, 16384 pairs) so copy-back view pairs survive, with the whole MIN_DYNAMIC range intact. The pipeline library's tag now hashes the view-heap cap with the rest of the translation settings: a library saved on the other host no longer reuses DXIL whose clamps do not fit. The "title slot past the host heap" diagnostic warns at most once a second with the highest slot seen (187078 lines in run 6); every new maximum logs at debug. Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
…k its tables The capped path sized its dynamic range 2^16 (`MIN_DYNAMIC`), the title's slots keeping their room first. Upstream issue Marvisak#747 measured that trade on an RTX 4070 Ti: the world's tables starved in seconds, indirect and mesh draws dropped by the thousand as "no dynamic slots", the G-buffer about 0.1% covered; 2^18 dynamic slots with fewer title slots mirrored raised coverage to 60-65% and dropped nothing for lack of slots. This fork's `DYNAMIC` is already 2^18, so the capped heap takes it too, over title slots past it (the heap still keeps its pair range and null buffer views, from PR #13): 934464 title slots, 262144 dynamic, 32768 pair, and 3 null slots make exactly 1,000,000. `MIN_DYNAMIC` and its duplicate rungs are gone. A draw or dispatch whose fresh table finds no dynamic slots is dropped, but the fresh tables the same stage had already made stayed reserved (their ranges and their dedupe cache entries) until the list was reset (upstream issue Marvisak#911). They were never recorded into the list — the draw is dropped before its root arguments are set — so the bind gives them back at once: released, uncached, and re-made by the next draw from scratch. Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
MagiccConch
marked this pull request as ready for review
November 25, 2026 08:15
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.
Run 7's evidence (2026-11-25, RTX 5080)
The run reached world entry at 30 fps but removed the device mid submission (
0x887A0006, 7 lists,crashes.log07:03:52), and the log ended with:no room for the null buffer views(1) — the title heap landed on thePORTABLE_VIEWScap path, whereNULL_BUFFER_VIEW(2,097,150) sits past the 1,000,000-slot heap: the null raw SRV/UAV that computed buffer-view indices read were never made.187078 × title slot past the host heapin run 6 — the mirror diagnostic floods the log.What this changes
Translated shaders (
victory-shader):buffer_guardclamps computed buffer-view indices below the shader's view limit (view_limit, already carried perShader) instead ofHEAP_VIEWS - 1, and reads the null SRV/UAV atlimit-2/limit-3— inside a capped heap too.heap_handlealready clamped; this closes the gap between the two clamps (the direction of upstream PRs Marvisak#2177 and Marvisak#2185, which are not merged upstream yet).Host heap layout (
victory-gpudescriptor::host): a capped heap keeps its last three slots out of title, dynamic and pair views — null SRV, null UAV, then the slot a shader's index clamps to:cap == count + DYNAMIC/count + MIN_DYNAMIC, run 7's actual path) trim 3 dynamic slots;CAPPED_PAIRS(1 << 15 slots = 16,384 copy-back view pairs) with the wholeMIN_DYNAMICdynamic range intact (the starved-pairs trap the previousMIN_DYNAMIC - 1sizing created);min(NULL_BUFFER_VIEW, total-2)andtotal-3unconditionally, so theno room for the null buffer viewswarn cannot fire on a capped heap.Pipeline library (
pipeline/library.rs): the tag now hashes the view-heap cap — a library saved on the other GPU no longer reuses DXIL whose clamps point at the wrong slots (the shader cache already keyed on the cap; the library tag did not).Diagnostics: the
title slot past the host heapwarn throttles to once per second carrying the highest slot seen; each new maximum logs atdebug.AMD/uncapped hosts are byte-identical to before: the limit resolves to
HEAP_VIEWS, andmin(NULL_BUFFER_VIEW, total-2)equalsNULL_BUFFER_VIEWon every 2M-slot heap.Verification
cargo check+cargo clippy(0 warnings) +cargo test --no-runall clean onx86_64-pc-windows-gnu(1.98.1); CI runs the real suite on windows-latest. Hardware runs need the user's 5080.Run 8 expectations
no room for the null buffer viewswarn;host view heap capped at 1000000now logskept=836157(title slots) on the deep-cap path, or keeps all title slots with the rung-2 trim.0xc0000005at image+0x2215c35 persists, the next suspect per the run-6 notes is unmarked GPU writes reaching title memory (twin bridge copies) — that would need the run-8VICTORY_LOG_FILEtrace.This PR was created by an AI agent (OpenHands) on behalf of the user.