Shaders: LDS sub-dword writes, typed buffers at offsets and of some channels, typed loads by index #1959
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!1959
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1959"
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?
@RaghavVijayanand on GitHub · 2026-11-25 01:45 UTC · original
RaghavVijayanand:shader/buffer-lds-gaps→main· +1381 −40 · 5 files · 5 commits · openBuffer and LDS gaps in the translator, in four commits. Each builds and passes tests.
0b35b7f) already reads and writes LDS bytes and halves, but writes them with an atomic AND then OR, noted there as a shortcut. When several lanes write the same byte, that merges their bits. The write is now a compare-exchange loop on the dword, so neighbouring bytes are never clobbered and exactly one lane's value lands, as on the console. Main's read path is kept.index + offset / element size.tbuffer_load_format_*by index: reads at byteindex * stride + offset, through main's bindless-stride conversions (a root view's built descriptor takes its stride from dword 1, and a heap descriptor from the view-stride table).Tests: the new
emit/buffer_lds_tests.rs(8 tests) and aView::FormatUavin the test host. Every program is hand-assembled, validated with dxil.dll, run on the default hardware adapter and WARP, and checked against a CPU model.A new test,
typed_format_loads_by_index_from_the_heap_take_the_views_stride, covers the heap path. Each change was broken by hand to confirm the tests fail: AND-then-OR instead of compare-exchange, the offset ignored, kept channels zeroed, the index multiply dropped, and typed loads left out of the view-stride table.Rebased onto current main (
940d32f). On this machine, 5 tests fail on main itself, with or without this change:descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views, the twostride_tests::a_heap_buffer_read_*tests, andsynthetic_tests::gathers_at_a_level_match_the_hardware. Everything else passes, and clippy passes with-D warnings, with and without--all-features.@Marvisak on GitHub · 2026-11-25 02:19 UTC · original · edited 2026-11-25 16:03 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs work) was for an older state ofmain.Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 11:01 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
40770f94ontomain940d32f(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: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
40770f9468to3cb38f8552@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 01:45 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@catminou4 on GitHub · 2026-11-25 03:14 UTC · original · approved these changes
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. LDS bytes and halves, typed buffers at offsets and of some channels — sub-dword LDS/buffer access completeness; relates to the LDS sub-dword cluster (#632/#116/#101/#571/#996) and #2003's MUBUF d16.
@RaghavVijayanand on GitHub · 2026-11-26 11:25 UTC · original
Rebased onto
main63bcca4. Merged with whatmaingained since:main's bounds guard from #1949. A write past the allocation is dropped, and of lanes writing the same byte, one value wins.main'styped_hhandle (made once per store, for the d16 integer-view path) together with this branch's byte-offset element and partial-channel merge.Each commit builds. Locally (RTX 5060 Laptop): the buffer/LDS/typed tests pass (14 of 15), and clippy is clean.
typed_stores_of_some_channels_keep_the_othersfails on the RTX with "dispatch failed: The parameter is incorrect". That is the same NVIDIA 1M-view-heap-cap failure thatmain's ownstride_tests::a_heap_buffer_*hit there. On WARP it passes along with those two (VICTORY_WARP=1). Before the rebase it passed on the RTX as well.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.