Shaders: DS ops in a program without LDS read 0 and drop writes #1501
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!1501
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1501/head"
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?
@ruvenesh on GitHub · 2026-11-24 18:33 UTC · original
ruvenesh:up/ds-without-lds→main· +181 −3 · 3 files · 1 commits · closed without mergingWhen a compute or mesh program allocates no LDS, its
ds_read*,ds_write*and modelledds_*atomics now translate instead of failing the whole shader.Why: on the console an out-of-bounds LDS access reads 0 and drops its write (the rule the in-bounds path's comment already states). A program that allocates no LDS has every access out of bounds, so refusing it was stricter than the hardware.
Tests:
emit::ds_without_lds_tests(any host): lowers ds_write/ds_read, read2_b32, read_b128, add_rtn_u32 and add_u32 with and without LDS. Checks that ds_read_u8 and ds_add_f32 still refuse with their usual reasons.valu_tests::ds_ops_without_lds_read_zero_and_drop_writes(Windows, needs an SM 6.6 device or WARP): sets a nonzero address, writes a value there and reads it back, then asserts 0. It passed under vkd3d-proton on an RTX 3060.cargo clippy --workspace --all-targets --locked -- -D warnings(with and without--all-features) andcargo xtask policypass.Note: #292 also edits
Lower::ds.lower.rsmerges cleanly with it; only the appended tests invalu_tests.rswould need both kept.Note: with #189 (Wave64 emulation),
s.lds_dwordsalso counts emulation scratch, so the check here must test the title's own allocation (title_lds_dwords). Whichever lands second needs that one-word change. I've run that combination in the title and can rebase either way.🤖 Generated with Claude Code
@marquezinii on GitHub · 2026-11-24 18:48 UTC · original
Ran on an RTX 5070 (desktop, driver 621.40, the only adapter), Windows 11 26300, Rust 1.98.1 at
5b390ef.cargo test -p victory-shader --lib -- --test-threads=1 --nocapturegives 123 passed, 0 failed, 1 ignored. The newds_without_lds_testspass, and no hardware test was skipped; the only skips are the fourdiff_teststhat need the console compiler. Limiting this to compute and mesh, which size their own LDS, and keeping the refusal for stages whose LDS carries ring data seems the right scope.@sinan-cmyk on GitHub · 2026-11-24 20:13 UTC · original
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count change against
main.Offline. I merged head
5b390efontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 21,724 with this PR.One program moves from "LDS the program does not allocate" to "an LDS operation".
Tests: with the same merge,
cargo test --locked -p victory-shader --libpassed 123, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@ruvenesh on GitHub · 2026-11-25 01:28 UTC · original
Closing this. The one program in the title it unblocked (a compute shader refused at a single DS instruction) turns out to stop at a
ds_bpermute_b32, which uses the DS crossbar and not LDS memory. #573 lowers that instruction before the LDS-size check, so #573 alone translates it and this change adds nothing for the title. That matches @sinan-cmyk's measurement (no count change). Thanks to @marquezinii and @sinan-cmyk for testing.@Marvisak on GitHub · 2026-11-25 01:29 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-shader/src/emit/lower.rs,crates/victory-shader/src/emit/valu_tests.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Pull request closed