Shaders/Lower: reject non-zero soffset/built_offset on typed buffer_store_format_xyzw #3009
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!3009
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3009"
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?
@RVZO6 on GitHub · 2026-11-26 03:19 UTC · original
RVZO6:rvzo/typed-buffer-store-offset→main· +118 −1 · 2 files · 1 commits · openLower::buffer's typedbuffer_load_format_*path (crates/victory-shader/src/emit/lower.rs:9785) rejects any non-zerosoffsetorbuilt_offsetviaif *offen || matches!(off, V::Inst(_)) || *offset != 0, whereas the typedbuffer_store_format_xyzwpath (L9675) checked onlycount != 4 || *offen || *offset != 0.When
soffsetwas a scalar register or non-zero inline constant (orbuilt_offsetadded a non-zero base/extra),buffer_store_format_xyzwsilently discardedoffand wrote to elementindexat offset 0 instead of returningErr.Add
matches!(off, V::Inst(_))to matchbuffer_load_format_*. Tests live incrates/victory-shader/src/emit/lower/typed_store_tests.rs(keepinglower.rsat520,628 B, well under the 512 KiB limit).Verification
typed_buffer_store_rejects_nonzero_soffset_and_accepts_zerofailed (typed buffer store with inline soffset=16 must not silently drop the offset).soffset = 16and SGPRsoffset = s0, whilesoffset = 0continues lowering cleanly and passingdxil.dllvalidation.--tests+--features diagnosticsclippy,xtask policy, full workspace tests): RVZO6/VIctory CI run #45747688145 (green, combined Wave 9 check on63bcca4).AI-assisted: T3 Code (Antigravity, gemini-4-neon).
@futurepro62 on GitHub · 2026-11-26 03:58 UTC · original
NVIDIA full-suite run, to go with the reports above by Dukestar69, since none of them names a GPU run. Tested exact head
4eeb2eb(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.typed_buffer_store_rejects_nonzero_soffset_and_accepts_zero.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@Marvisak on GitHub · 2026-11-26 06:17 UTC · original
Automated triage for the maintainers.
This is a one-line change to the typed-store branch of
Lower::buffer(emit/lower.rs). Today that branch drops a non-zerosoffset, or abuilt_offsetbase or extra, without warning and writes at elementindex. The PR addsmatches!(off, V::Inst(_))to the refusal condition, the same check the typed-load branch already uses. I confirmed thatModule::bindoesn't fold constants, so any offset added tooffmakes it aV::Inst, and only a zero or nullsoffsetwith no built offset keeps the store. The new testtyped_store_tests.rschecks refusal for an inlinesoffsetof 16 and for an SGPRsoffset, and acceptance for zero.Trade-off for the maintainer: a typed store whose SGPR
soffsethappens to be zero at run time now refuses the shader, where today it works. That matches the typed-load behaviour.CI:
checkpassing.Generated by Claude Code
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.