Draw: a table UAV a shader's buffer stores do not name is not written back #3066
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#3066
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Adriwin06 on GitHub · 2026-11-29 19:52 UTC · original
What it changes
A bound table's buffer UAVs were all taken as written whenever the
stage could store to buffers at all, so every one of them was marked
for write-back. The pipeline now works out which
usedbufferdescriptors a store or atomic names (from the instruction's rsrc / SMEM
base SGPR, when it is known), TablePlan keeps one
writtenflag pertable entry, and a binding is marked written (BINDING_WRITES) only if
one of its stores can reach it. A store whose descriptor is not known
still marks every entry, as before.
Ported from uiliannn/VItoriaBr@6d97bea, GPL-3.0-or-later.
How it was tested
cargo testpassed for the crates it touches:cargo test -p victory-gpu --lib -- draw:: pipeline::: 95 passedcargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).cargo clippyalso with--all-featuresadds no finding, andcargo test --workspace --lockedfails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).Checked for overlap
None found for per-descriptor UAV write-back.
🤖 Generated with Claude Code
Pull request details or commits were not available from GitHub; kept as an issue.
[pr-performance] Draw: a table UAV a shader's buffer stores do not name is not written backto Draw: a table UAV a shader's buffer stores do not name is not written back@Copilot on GitHub · 2026-11-29 19:57 UTC · original
This assignment can leave
BINDING_WRITESfalse, but the shared-table allocation-failure fallback callsreadableat lines 5844 and 5855 without updating it. With shared and same-table reuse enabled, a writable UAV in a later table can inherit that false value and lose its write-back. Reset the flag toSTORESat the start of each snapshot-table group, or propagate per-entry flags through both fallback loops.@Copilot on GitHub · 2026-11-29 19:57 UTC · original
lower_boundis a logical shader register (victory-shader/src/native.rs:431–432), not the physical SGPR incode. If u0's descriptor is loaded into s[12:15] and u12 is also declared, this comparison marks u12 written and leaves u0 unwritten without triggering the unknown fallback, suppressing u0's write-back. Trace the descriptor's origin to its table slot/offset; until that mapping is available, keep the unknown-write fallback even when these numbers match.@Adriwin06 on GitHub · 2026-11-30 01:10 UTC · original
Fixed in a84e210b: both fallback loops now set
BINDING_WRITESbeforereadable. The entries' loop sets each entry's own flag fromgroup.written, and the selected views' loop sets the stage'sSTORES, the same as the snapshot loop.@Adriwin06 on GitHub · 2026-11-30 01:10 UTC · original
Right, the SGPR number is no guide. Fixed in 0452ddf2:
written_usednow traces each buffer store's descriptor withresource::track, the waypicked.rsand the translator'sused_kinddo. A load from a table at a fixed offset names that entry, and a root descriptor names its own. Anything else (a computed offset, the heap, a built descriptor, a scalar store, or a program that needs the structure pass) is unknown, so every writable UAV is written back. Regression test:pipeline::tests::a_store_names_the_entry_its_descriptor_was_loaded_from(u0's descriptor in s[20:23] beside a declared u20).