GPU: the fifth dword of a root constants parameter is read as a constant #2295
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2295
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2295"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@denkencar-sketch on GitHub · 2026-11-25 10:05 UTC · original
denkencar-sketch:fix/draw-001→main· +17 −1 · 1 files · 1 commits · openSummary
Any user-data entry at the view-offset dword was taken for a root view's offset, so a draw reading that constant was dropped. Only a root view descriptor's entry is now read as a view offset; the fifth dword of a root constants parameter is a constant.
Testing
Test
only_a_root_view_has_a_view_offsetfails without the root-view check and passes with this change. It tests the helperis_view_offset, not the whole draw path.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a run in the game.
AI-assisted.
@steven-seagull27 on GitHub · 2026-11-25 10:44 UTC · original
I reproduced the dropped draw on the parent and verified the fix on an RTX 5080 and Windows’ built-in WARP. With the fifth root constant, the parent dropped both draws and left all 256 pixels blue. On the PR, both adapters rendered the expected 128 red pixels on the left and 128 green on the right, with zero pixel mismatches.
Each row below was measured separately on both adapters. The four-dword control reads the last dword of a four-dword parameter.
940d32f940d32f9d8a69b9d8a69bThe test translates a synthetic GFX10 pixel shader that reads
s3ors4, checks which root dword the translator requested, then submits two scissored draws throughState::set_constantsandState::draw. Only the selected constant changes between draws. It checks every RGBA8 pixel after submission against its expected position. The D3D12 device LUIDs resolved to NVIDIA GeForce RTX 5080 (10de:2c02) and Microsoft Basic Render Driver (1414:008c) using the system WARP DLL. This run used synthetic inputs.The test-only commit applies to the PR head or its parent. It builds its shader fixtures locally with Windows SDK DXC. Regression test commit
@Marvisak on GitHub · 2026-11-25 14:52 UTC · original · edited 2026-11-26 00:23 UTC
Automated triage for the maintainers.
Merge candidate (worth a look). The head
8cfd7aadrops the pixel test that randxc.exe, which was the only thing holding this back. What remains: inState(crates/victory-gpu/src/draw.rs), user-data dwordROOT_VIEW_OFFSETis taken as a root view's offset only when the parameter is a root descriptor (is_view_offset, matchingis_root_view), so the fifth dword of a root constants parameter no longer drops the draw. The unit testonly_a_root_view_has_a_view_offsetcovers it. A tester earlier reproduced the dropped draws onmainand correct pixels with the fix on an RTX 5080 and WARP. CIcheckpasses and it merges cleanly.On your reply: confirmed, no process is spawned any more and the diff is only the fix and its unit test.
Generated by Claude Code
@denkencar-sketch on GitHub · 2026-11-25 23:15 UTC · original
Dropped the \dxc.exe-spawning pixel test per triage (keeping the production fix and \only_a_root_view_has_a_view_offset\ unit test) and rebased onto current \main\ (\
842b0cb). \cargo test, \cargo clippy, and \cargo xtask policy\ pass.@catminou4 on GitHub · 2026-11-25 10:19 UTC · original · reviewed
Root constants: the fifth dword check now requires RootType::Descriptor (is_view_offset) — a constants parameter no longer mistaken for a view offset. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
@fuzeofficlal on GitHub · 2026-11-26 19:44 UTC · original · approved these changes
Reviewed and verified
8cfd7aa46cf1bb9169e140d08d6a1767c6128838merged ontoorigin/main(63bcca43c6a00a758510398fa43096ce7e4f7df0) on Windows 11 x64 (RTX 5090 + Microsoft WARP,--features diagnosticswithVICTORY_D3D12_DEBUG=1, Rust 1.98.1 MSVC).Code Audit
ROOT_VIEW_OFFSET,is_root_view, andRootType::Constantsuses acrosscrates/victory-gpu/src/:State::bind(crates/victory-gpu/src/draw.rs:771), shared by both graphics and compute pipelines, was the only site matchingu.dword == victory_shader::emit::ROOT_VIEW_OFFSETwithout verifyingu.root == RootType::Descriptor.is_view_offset(L2013-2015) mirrorsis_root_view(L2018-2019) cleanly so the fifth dword (and beyond) of aRootType::Constantsparameter falls through toself.user_value(...)instead of failing a root-view lookup and dropping the draw/dispatch.Local Verification
cargo xtask policy— pass (191 files ok).cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features) — 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib only_a_root_view_has_a_view_offset(RTX 5090 and WARP) — passed.compute = false) and compute (compute = true) slots: verified dwords0..8never matchis_view_offsetoris_root_view,RootType::TablewithROOT_VIEW_OFFSETis excluded, andState::user_valuereturns every dword verbatim on both RTX 5090 and WARP.Looks good to merge.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.