GPU: any user-data dword numbered 4 is taken for a root view offset, and the dispatch is dropped #2699

Open
opened 2026-11-26 05:12:17 +00:00 by github-bot · 3 comments
Owner

@⁠Machad3x on GitHub · 2026-11-25 18:26 UTC · original

In crates/victory-gpu/src/draw.rs (main 13f91ca) the user-data loop has
None if u.dword == victory_shader::emit::ROOT_VIEW_OFFSET without looking at
u.root. Root constants with five or more dwords have a real dword 4, so it is
looked up as a root view, none is found, and the draw or dispatch is refused.
Introduced with d71c388.

Seen on an RTX 3080 Ti: the ray-tracing builder's dispatches were refused, about
240 a frame and up to 2,171 while the world loaded, with no log line. After
requiring u.root == RootType::Descriptor in that arm, dropped draws and
dispatches went from about 250 to 18 a frame.

fn is_root_view_offset(u: &UserData) -> bool {
    u.root == RootType::Descriptor && u.dword == victory_shader::emit::ROOT_VIEW_OFFSET
}

Written with Claude Code; tested locally.

**@⁠Machad3x** on GitHub · 2026-11-25 18:26 UTC · [original](https://github.com/Marvisak/VIctory/issues/2699) In `crates/victory-gpu/src/draw.rs` (main 13f91ca) the user-data loop has `None if u.dword == victory_shader::emit::ROOT_VIEW_OFFSET` without looking at `u.root`. Root constants with five or more dwords have a real dword 4, so it is looked up as a root view, none is found, and the draw or dispatch is refused. Introduced with d71c388. Seen on an RTX 3080 Ti: the ray-tracing builder's dispatches were refused, about 240 a frame and up to 2,171 while the world loaded, with no log line. After requiring `u.root == RootType::Descriptor` in that arm, dropped draws and dispatches went from about 250 to 18 a frame. ```rust fn is_root_view_offset(u: &UserData) -> bool { u.root == RootType::Descriptor && u.dword == victory_shader::emit::ROOT_VIEW_OFFSET } ``` Written with Claude Code; tested locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:12:17 +00:00
Author
Owner

@⁠Creaa on GitHub · 2026-11-25 18:28 UTC · original

Taking this: the root-view-offset arm in draw.rs also requires u.root == RootType::Descriptor (an is_root_view_offset helper as you suggest), so dword 4 of root constants of five or more dwords is no longer looked up as a root view; with a unit test of the helper.

AI use: Claude Code (Claude Opus 5.5) drafted this.

**@⁠Creaa** on GitHub · 2026-11-25 18:28 UTC · [original](https://github.com/Marvisak/VIctory/issues/2699#issuecomment-7170951447) Taking this: the root-view-offset arm in `draw.rs` also requires `u.root == RootType::Descriptor` (an `is_root_view_offset` helper as you suggest), so dword 4 of root constants of five or more dwords is no longer looked up as a root view; with a unit test of the helper. AI use: Claude Code (Claude Opus 5.5) drafted this.
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 18:35 UTC · original

#2703 implements this (the is_root_view_offset helper with u.root == RootType::Descriptor, plus the predicate test) and is green. @⁠Creaa claimed this 11 s before I opened it — if you are already on it, say so and I will close #2703; otherwise it is ready for review, and the patch is small enough to reuse either way.

**@⁠Calvix2k** on GitHub · 2026-11-25 18:35 UTC · [original](https://github.com/Marvisak/VIctory/issues/2699#issuecomment-7171108304) #2703 implements this (the `is_root_view_offset` helper with `u.root == RootType::Descriptor`, plus the predicate test) and is green. @⁠Creaa claimed this 11 s before I opened it — if you are already on it, say so and I will close #2703; otherwise it is ready for review, and the patch is small enough to reuse either way.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 18:49 UTC · original

Automated triage for the maintainers.

Confirmed in main (13f91ca): in the user-data loop of crates/victory-gpu/src/draw.rs (the root-constants setup before SetComputeRoot32BitConstants / SetGraphicsRoot32BitConstants), the arm None if u.dword == victory_shader::emit::ROOT_VIEW_OFFSET does not check u.root, unlike is_root_view, which requires RootType::Descriptor. A root constant's or table's dword 4 is therefore looked up as a root view offset, and when none is found the draw or dispatch is refused through not_run.

Open PR #2703 (by @⁠Calvix2k) adds the RootType::Descriptor check through a helper, with a test. @⁠Creaa also said they would take this; one PR is enough.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 18:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/2699#issuecomment-7171443645) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T18:35:01Z at=2026-11-25T18:52:30Z --> Automated triage for the maintainers. Confirmed in main (13f91ca): in the user-data loop of `crates/victory-gpu/src/draw.rs` (the root-constants setup before `SetComputeRoot32BitConstants` / `SetGraphicsRoot32BitConstants`), the arm `None if u.dword == victory_shader::emit::ROOT_VIEW_OFFSET` does not check `u.root`, unlike `is_root_view`, which requires `RootType::Descriptor`. A root constant's or table's dword 4 is therefore looked up as a root view offset, and when none is found the draw or dispatch is refused through `not_run`. Open PR #2703 (by @⁠Calvix2k) adds the `RootType::Descriptor` check through a helper, with a test. @⁠Creaa also said they would take this; one PR is enough. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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#2699
No description provided.