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

Open
opened 2026-11-25 18:26:44 +00:00 by Machad3x · 3 comments
Machad3x commented 2026-11-25 18:26:44 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by Machad3x on 2026-11-25T18:26:44Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6611010868 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2699). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-25T18:26:44Z. --- 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.
Creaa commented 2026-11-25 19:06:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Creaa on 2026-11-25T18:28:15Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7170951447 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2699#issuecomment-7170951447). Originally posted by [Creaa](https://github.com/Creaa) on 2026-11-25T18:28:15Z. --- 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.
Calvix2k commented 2026-11-25 19:06:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T18:35:01Z.


#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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171108304 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2699#issuecomment-7171108304). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T18:35:01Z. --- #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.
Marvisak commented 2026-11-25 19:06:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:49:13Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171443645 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2699#issuecomment-7171443645). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T18:49:13Z. --- <!-- 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)_
Sign in to join this conversation.
No labels
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.

Reference
Marvisak/VIctory#2697
No description provided.