Repository navigation
GPU: a fifth root constant is not a root view's offset (BVH build kernels stay dropped) - #10
Merged
Merged
Conversation
A user-data entry was taken for a root view's offset by its dword (4) alone, whatever its root parameter was. Root constants have a dword 4 too: a program reading its fifth root constant found no root view in its constants' slot, and every draw or dispatch of it was dropped without a reason. Only a root descriptor's entry takes the offset now. The paths that drop a draw for want of a root view now give a reason (counted with the other drop reasons) and a rate-limited warning with the root parameter, the kind, the address and what is known of it. Live run on the RTX 5090: the BVH builder kernels this dropped now run at world load, and a later bottom-up refit pass in the same list then runs for over 5 s and the device is removed (DEVICE_HUNG). That refit already ran before this change; it is the newly built data it walks that makes it run long. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With dword 4 of root constants no longer taken for a root view's offset, the console ray-tracing library's BVH build kernels (title-memory compute programs reading a fifth root constant) start to run, and a later refit dispatch of the same library then climbs node links without end: device hung at world load (three live runs, also with half of the newly running kernels skipped). Until that is understood, such programs stay dropped as before, now with a logged reason; every other program reading a fifth root constant runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wbkepler
marked this pull request as ready for review
November 25, 2026 17:48
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.
Cause
State::bind(crates/victory-gpu/src/draw.rs) treated any user-data entry withdword == ROOT_VIEW_OFFSET(4) as a root view's byte offset, whatever its root parameter was. The arm was missing theu.root == Descriptorcheck thatis_root_viewalready has. A root constants parameter has a dword 4 as well, so every program that reads a fifth root constant looked up its constants' slot, foundRoot::Constantsthere instead ofRoot::View, and returnedfalse. Each draw or dispatch of such a program was dropped, and no reason was recorded (~190 of the ~265 "dropped" per world frame had no reason).Fix
is_root_view_offset(u)=u.root == Descriptor && u.dword == ROOT_VIEW_OFFSET, and the offset arm uses it. Dword 4 of root constants now goes touser_valuelike the other constants.shadow::about(address).draw::tests::root_constants_are_not_root_views(incl.reads_fifth_constant).Gate (after merging main
5f9d059): clippy-D warnings(victory-gpu, victory+diagnostics),cargo test -p victory-gpu -- --test-threads=1(187 passed, 5 ignored),cargo xtask policy. No translator change.Measured (RTX 5090, diag build, capped pacing, cache of base 1104646, GPU upload + lazy copy-back on), 240 s
So in this title every program the bug hid is a BVH build kernel: the branch changes no frames, but the drops now say why, and the root-constants mapping is right for anything else. Captures at world+30/60/120 look as on main (dark cutscene interior, same lighting).
Next
Make the BVH build kernels run: find which of the four remaining kernels writes the links the refit loops on (dump parent links/counters before the refit, or skip them one at a time), fix its translation, then lift the drop.
🤖 Generated with Claude Code