Shaders: lower root UAV accesses as ROVs in POPS pixel shaders #2490
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!2490
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2490"
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?
@reeledMarek on GitHub · 2026-11-25 14:48 UTC · original
reeledMarek:fix/shader-pops-root-uav-rov→main· +232 −22 · 2 files · 1 commits · openProblem
In
crates/victory-shader/src/emit/lower.rs:self.pops == true,DB_SHADER_CONTROLbit 16),Lower::handle()ORs the ROV flag (0x2000) intoprops.0for UAV handles (0x100B->0x300B). However, theSource::Builtmatch arms only matched0x100Band11, causing any root UAV store/atomic/UAV-annotated load in a POPS pixel shader to fail translation with"a root UAV or typed root view".Lower::root_view()hardcoded(11 | 0x1000, 0)without checkingself.pops, so root UAV heap handles in POPS shaders lost the0x2000ROV annotation (andglobal_load_*on a root UAV, which passesprops.0 == 11intohandle(), also skipped settingflags::ROVS).Fix
props.0 & !0x2000inLower::handle()forSource::Builtroot descriptors so ROV-annotated raw UAV handles (0x300B) route toroot_view(..., true)(orroot_uav_handlewhenroot_memoryis active).Lower::root_view(), whenuav && self.pops, setself.s.flags |= flags::ROVSand annotate the heap handle with(11 | 0x1000 | 0x2000, 0). (Shader::heap_handlestill recordsview_indexbecause0x300B & 0x1000 != 0and0x300B & 0xFF == 11, so write marks keep working.)emit::lower::tests::pops_pixel_shader_lowers_root_uav_accesses_as_rovscoveringbuffer_store_dword,global_store_dword, andglobal_load_dwordon root UAVs in POPS and non-POPS pixel shaders (with and withoutview_marks).Verification
cargo test -p victory-shader --locked(145 passed, 0 failed)cargo test -p xtask --locked(repository_passes_policypassed)cargo clippy -p victory-shader --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings(0 warnings)839803a2e5tof11c1b43ea@Marvisak on GitHub · 2026-11-25 15:58 UTC · original · edited 2026-11-26 07:22 UTC
Automated triage for the maintainers.
Needs work: CI fails. Thanks for the rebase and the
root_memorychange. The logic reads right.classify_root_descriptorincrates/victory-shader/src/emit/lower.rsaccepts the ROV bit (0x2000) only on the!root_memoryview arms. Withroot_memory, POPS root UAVs stay refused instead of becoming unorderedroot_uav_handles.root_viewsetsflags::ROVSand0x300Bfor POPS.However, the
checkrun onf11c1b4failsxtaskpolicy::tests::repository_passes_policy:crates/victory-shader/src/emit/lower.rs: 526918 bytes exceeds the 524288-byte limit. The ~160-line test pushes the file over the policy's size cap. Please movepops_pixel_shader_lowers_root_uav_accesses_as_rovs(and, if needed,RootBinding/classify_root_descriptor) into a separate file, for example a#[cfg(test)]module next tolower.rs. Do not changextask/src/policy.rs. With CI green this would be back to a merge candidate.CI: failing (asset policy size limit).
Generated by Claude Code
@reeledMarek on GitHub · 2026-11-25 20:05 UTC · original
Updated to address the triage feedback:
0x2000ROV bit mask to the!self.root_memoryarms viaclassify_root_descriptor, keepingself.root_memory+ POPS root UAV refused (Err("a root UAV or typed root view")) instead of silently lowering to an unorderedShader::root_uav_handle.root_memory = true(both POPS refused and non-POPS allowed) alongsideroot_memory = false.@reeledMarek on GitHub · 2026-11-26 05:55 UTC · original
Rebased cleanly onto current
main(63bcca4) and verifiedcargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningspasses.f11c1b43eatoa4f4c72a67@oni-swr on GitHub · 2026-11-25 15:08 UTC · original · reviewed
Independent verification on Windows,
VICTORY_D3D12_WARP=1(WARP only, no hardware GPU touched). Tested commitd8e54fd834998271d3e6e315b8fe2a312519e32e(clean detached checkout).cargo test -p victory-shader --locked --lib pops_pixel_shader_lowers_root_uav— 1 passed, 0 failed, 0 ignored.if self.popsbranch inroot_viewforced off, the same test fails (panic at the firstl.rovsassert), so it guards the change.cargo test -p victory-shader --locked --lib— 248 passed, 0 failed, 3 ignored (the ignored ones are pre-existing).Code read:
root_view(.., uav=true)now setsflags::ROVSand0x2000under POPS. This covers theglobal_loadroute, wherehandle()seesprops.0 == 11without0x1000and so never adds the ROV bit itself. Theprops.0 & !0x2000mask in the root-descriptor match keeps the0x100Band(Uav, 11)arms matching. The non-POPS path is unchanged, and the test assertsrovs == falsefor it. No problems found.AI-assisted (Claude Code / Claude Sonnet 5.5)
@reeledMarek on GitHub · 2026-11-26 10:21 UTC · original
Moved
pops_pixel_shader_lowers_root_uav_accesses_as_rovsintocrates/victory-shader/src/emit/lower/pops_tests.rs(#[cfg(test)] mod pops_tests;) solower.rsstays well below the 512 KiB asset-policy file size cap. Verifiedcargo test -p xtask --locked(6/6 passed) and Windows cross-clippy (-D warnings).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.