GPU: the fifth dword of a root constants parameter is read as a constant #2293
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T10:05:23Z.
Summary
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.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:13Z.
Review: COMMENTED
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.
Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-25T10:44:54Z.
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
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:52:50Z.
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
Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T23:15:34Z.
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.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T19:44:46Z.
Review: APPROVED
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.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T22:09:52Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).is_view_offsettou.root == RootType::Descriptorprevents the fifth dword of a root constants parameter from being misinterpreted asROOT_VIEW_OFFSET.cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 21 passed, 0 failed (includingonly_a_root_view_has_a_view_offset).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.