Shaders: lower partial-channel typed and indexed sub-dword buffer stores #3377
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!3377
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3377"
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?
@Texbirds on GitHub · 2026-11-26 20:58 UTC · original
Texbirds:feat/shader-buffer-stores-partial-and-indexed→main· +969 −49 · 5 files · 1 commits · openProblem
In
crates/victory-shader/src/emit/lower.rs(Lower::buffer), two common GFX10 MUBUF store families are currently refused at translation time even though the surrounding load/atomic/d16 paths already support them:buffer_store_format_{x,xy,xyz},buffer_store_format_d16_{x,xy,xyz}, andbuffer_store_format_d16_hi_x): Line 9675 refusescount != 4("a typed buffer store of some channels or at an offset") and line 9719 hardcodes write mask0xF, rejecting shaders that write 1-, 2-, or 3-channelRWBufferviews (R32_FLOAT,R32G32_FLOAT,R16_UINT/R16_FLOAT,R16G16_UINT/R16G16_FLOAT, etc.).buffer_store_byte,buffer_store_short, and_d16_hivariants withidxen): Line 9600 refusesindex.is_some()("a byte or half buffer store by index"), even thoughbuffer_atomic_*right above it already addresses structured UAVs via(index, off)withstridechecked to be>= 4and 4-byte aligned.Change
Lower::buffer(crates/victory-shader/src/emit/lower.rs):store && (name.ends_with("_d16_hi") || name == "buffer_store_format_d16_hi_x")(hi16), shifting the source VGPR right by 16 bits for_d16_hibyte/short/typed stores (loads remain untouched).buffer_store_byte*/buffer_store_short*), supportindex = Some(index)on structured UAVs (stride >= 4 && stride.is_multiple_of(4)) using(index, at, undef)coordinates for the clear/setatomicBinOp.i32pair andindex * stride + atformark_view_write, matchingbuffer_atomic_*. Rawindex = Nonelowering is unchanged.buffer_store_format_*), relaxcount != 4(still refusing*offen || *offset != 0), pad unused value channelscount..4withundef f32, and passmask = (1u8 << count) - 1(0x1/0x3/0x7/0xF) todx.op.bufferStore.f32(opcode 69). Existingd16widening andinteger_viewhandling already loop over0..count.Tests
All synthetic GFX10 compute shaders (no game data):
emit::lower::tests::partial_typed_and_indexed_subword_buffer_stores_lower_and_validate(cross-platform +dxil.dllvalidation on Windows): lowers and validatesbuffer_store_format_{x,xy,xyz},buffer_store_format_d16_{x,xy,xyz},buffer_store_format_d16_hi_x, and indexedbuffer_store_{byte,short}{,_d16_hi}on a stride-8 structured UAV.emit::stride_tests::partial_typed_buffer_stores_write_float_and_d16_views(Windows hardware GPU + WARP execution readback): dispatches translated shaders writingR32_FLOAT(format_x),R32G32_FLOAT(format_xy),R16G16_UINT/R16G16_FLOAT(format_d16_xy), andR16_UINT/R16_FLOAT(format_d16_xandformat_d16_hi_x), asserting exact per-lane output bytes on both adapters.Verification & scope
check) for build, Clippy-D warnings,dxil.dllvalidation, and hardware/WARP execution tests.3281a54df5to0a2027eb3e@Dukestar69 on GitHub · 2026-11-26 21:09 UTC · original · reviewed
Tested on RTX 5090 and
VICTORY_WARP=1(Windows / D3D12) againstorigin/main(63bcca4).Tests and clippy pass cleanly:
cargo test -p victory-shader --lib emit::stride_tests::partial_typed_buffer_stores_write_float_and_d16_views -- --test-threads=1: passed on RTX 5090 andVICTORY_WARP=1.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.However,
cargo xtask policyfails becausecrates/victory-shader/src/emit/lower.rsgrows to525,320bytes (1,032bytes over the524,288-byte limit):Moving the new store helper into a submodule under
crates/victory-shader/src/emit/lower/will bringlower.rsback under the 512 KiB cap.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
0a2027eb3eto0b0fde07c8@fuzeofficlal on GitHub · 2026-11-26 21:24 UTC · original · requested changes
Requesting changes after auditing
0a2027ebagainstorigin/main(63bcca43) on Windows x64:Blocking issues
xtask policy):crates/victory-shader/src/emit/lower.rsis 525,320 bytes, exceeding the 524,288-byte (512 KiB) limit enforced bycargo xtask policy(exit 1). Splitting helpers or tests out oflower.rsis needed to keep it under 512 KiB.0.0under write mask0xF:crates/victory-shader/src/emit/lower.rs:9703-9710and9745,_x,_xy,_xyz, and_d16_*formatted stores pad omitted channels with0.0and emit DXILbufferStore.f32with mask0xF. On any host view wider thancountchannels (e.g. a 1- or 2-channel store into an RGBA view), this zeros untouched channels rather than preserving them, and RDNA2 SRDDST_SELrouting is ignored.soffset/built_offset:lower.rs:9444-9469accumulatesoffset,soffset, andbuilt_offsetintooff, but the typed branch atlower.rs:9695-9700only rejects*offen || *offset != 0and passesindex.unwrap_or(0)tobufferStore.f32, silently discarding non-zerosoffseton the newly enabled opcodes.lower.rs:9622-9648,index = Some(...)passesat = off & !3straight toatomicBinOp.i32without checkingat < stride(or handling oddshortoffsets crossing a dword boundary). RDNA2 drops writes past the record stride, whereas in DXIL/SM 5.1 an out-of-range byte offset within a structured UAV has undefined behavior.Additional notes
atomicBinOp(ANDthenOR) operations (lower.rs:9641) rather than a CAS loop exposes a zeroed intermediate state and can combine overlapping sub-dword writes; indexed structured sub-dword stores also only have DXIL validation (lower.rs:12260-12286) with no runtime GPU/WARP readback test.cargo xtask policy: FAILED (crates/victory-shader/src/emit/lower.rs: 525320 bytes exceeds the 524288-byte limit).cargo test --locked -p victory-shader --lib -- --test-threads=1 emit::stride_tests:: emit::lower::: 43 passed, 0 failed underVICTORY_WARP=1; 41 passed, 2 failed underVICTORY_WARP=0(same 2 pre-existing baseline failures on63bcca43; PR's new tests pass).cargo clippy -p victory-shader --all-targets --locked -- -D warnings(default and--all-features): clean;rustfmt --edition 2024: clean on changed hunks.Synthetic tests only; no game data used.
@evan-kolberg on GitHub · 2026-11-26 21:31 UTC · original
M4 Pro / CrossOver 26.3 / D3DMetal 4.0 beta 3 adds an independent hardware result for Texbirds’ exact
0a2027e. All eight authored typed-store cases passed. A newformat_xyfixture matched both channels in 32/32 permuted odd RG32_FLOAT elements and preserved 32/32 untouched even elements. Exact #3377 headA local typed-only Mac adaptation also passed the sparse check on RG32_FLOAT, RG32_UINT, and RG8_UNORM, using the Mac fork’s existing float/integer store split. The UINT case preserves values beyond FP32’s exact integer range. These cases use matching channel widths and zero effective offsets. The wider-view questions from fuzeofficlal and canonical file-size failure from Dukestar69 remain open. Format review · Policy review
Prepared and tested with Codex.
@Texbirds on GitHub · 2026-11-26 22:07 UTC · original
Thanks @Dukestar69, @fuzeofficlal, and @evan-kolberg for the thorough testing and review! Pushed
dc03d87addressing all raised points, andCI / checkis now passing:cargo xtask policy(512 KiB cap onlower.rs): Moved the new lowering/validation unit tests intocrates/victory-shader/src/emit/lower/buffer_store_tests.rs(alongsidebvh.rs), bringinglower.rsdown to 522,918 bytes.soffset/built_offset: Now rejected alongside*offen || *offset != 0, with a new unit test (typed_buffer_store_refuses_nonzero_soffset).at < stride(IULT) guard intobegin_guardedfor indexed structured sub-dword stores so out-of-record writes are dropped cleanly like RDNA2 hardware, and rejected statically odd 16-bit offsets (half_buffer_store_refuses_static_odd_offset).View::StructuredUavinemit/host.rsandindexed_subword_buffer_stores_write_structured_uav_and_drop_oobinstride_tests.rscoveringbuffer_store_{byte,short}{,_d16_hi}, untouched-byte preservation, and out-of-boundsoffset >= stridedrop on hardware + WARP.0xFmask /0.0padding: DXILWRITEMASKFORTYPEDUAVSTORE/WRITEMASKMATCHVALUEFORUAVSTORErequire mask0xFand non-undefvalues, and on RDNA2buffer_store_format_{x,xy,xyz}writes the full formatted element rather than performing a partial-channel RMW (hardware ignores channels past the view's format width).AND+ORatomics: Kept consistent with the existing rawbuffer_store_{byte,short}andds_write_b{8,16}lowering inlower.rs.Ready for re-review!
@fuzeofficlal on GitHub · 2026-11-26 22:20 UTC · original · requested changes
Thanks for bringing
crates/victory-shader/src/emit/lower.rsunder the 512 KiB limit (522,918bytes), rejecting nonzerosoffseton typed stores instead of dropping it, and adding theStructuredUavandbuffer_store_testscoverage (verifiedcargo xtask policy:192 files ok,clippyclean, andemit::lower:: emit::stride_tests::46/46 underVICTORY_WARP=1; underVICTORY_WARP=0all new tests pass, 44/46 with the two pre-existinga_heap_buffer_read_*failures atstride_tests.rs:301, 351).However, three blocking correctness issues remain before landing:
crates/victory-shader/src/emit/lower.rs:9722-9728): Padding missing components with0.0(args.resize(3 + 4, zero)) forbufferStore.f32mask0xFoverwrites untouched channels with zero whenever the bound typed UAV has more channels than the opcode (e.g.buffer_store_format_x/_xyon an RGBA format). All new cases instride_tests.rsonly bind 1- or 2-channel views matching the instruction width, so preservation of untouched channels in a multi-channel view is untested and broken.soffset(crates/victory-shader/src/emit/lower.rs:9451, 9644):offalready includessoffset, which RDNA2 applies as a base displacement outside the structured in-recordoffset < stridecheck. Testingat < strideagainstoff & !3drops valid writes whensoffsetadvances across records (e.g.stride = 8, index = 0, offset = 0, soffset = 8).crates/victory-shader/src/emit/lower.rs:9605-9617): Only static constant offsets are checked for odd alignment; a runtime byte offset withoff & 3 == 3shifts by24, writing only the low byte into byte 3 and discarding the upper byte.rustfmt --edition 2024 --checkflags new hunks incrates/victory-shader/src/emit/lower/buffer_store_tests.rs:34, 60, 86, 108,stride_tests.rs:998+, andhost.rs:1362, 1711.@passerbyyhx on GitHub · 2026-11-26 22:33 UTC · original
Tested
dc03d87173f4bc4be7540c0cdabd28b41676d380on Windows D3D12 with an RTX 4090 Laptop GPU (621.14) and Microsoft WARP. One synthetic wave32 issued a single indexed byte-store instruction against a structured UAV with 12-byte records. In one case four lanes each wrote one byte of the same dword. In the other, two lanes wrote bytes 0 and 2 while bytes 1 and 3 retained their nonzero seeds.Both adapters matched the entire readback buffer in all 8 dispatches per case, including the neighbouring dwords and guard records. The first modified word was
13121110for the four-lane case andd411f610for the two-lane case. The D3D12 debug InfoQueue reported zero errors and warning 1328 for the test harness's buffer initial state. The fixture uses synthetic data and covers the host D3D12 lowering.Parent
63bcca43c6a00a758510398fa43096ce7e4f7df0rejected both identical instruction streams at lowering witha byte or half buffer store by index.Synthetic test fixture
AI-assisted with Codex.
@Texbirds on GitHub · 2026-11-26 22:45 UTC · original
Thanks @fuzeofficlal for the detailed review catching those three edge cases, and thanks @passerbyyhx for the independent RTX 4090 Laptop + WARP verification!
Pushed
5648e3efixing all four items, andCI / checkis now green:Preserving untouched channels on wider typed UAVs (
lower.rs):0.0fpadding on partial typed stores (typed && count < 4) with a guardeddx.op.bufferLoad.f32(settingflags::TYPED_UAV_LOADS) insidebegin_guarded(guard), extracting channelscount..4from the existing element and passing them tobufferStore.f32with DXIL write mask0xF.buffer_store_format_xyzw(count == 4) is unchanged (no load, noTYPED_UAV_LOADSflag).emit::stride_tests::partial_typed_buffer_stores_preserve_untouched_rgba_channelsinitializing anR32G32B32A32_FLOATUAV with non-zero RGBA values and verifyingformat_xandformat_xypreserve untouched channels bit-exact.Structured sub-dword bounds check excluding
soffset(lower.rs,lower/buffer_store.rs):record_off(voffset + inst_offset) before addingsoffsetand descriptor-built base offsets, and perform the RDNA2 in-record check(record_off & !3) < strideonrecord_offonly.soffsetor a built base offset is present (has_base_off), total dword offsetat = off & !3is folded into structured UAV coordinates viaeff_idx = index + (at / stride)(UDiv) andeff_at = at % stride(URem), so cross-recordsoffset(e.g.stride = 8, index = 0, offset = 0, soffset = 8) targets record 1 byte 0 instead of being dropped. NoUDiv/URemis emitted whenhas_base_offis false.Dynamic (and static) straddling halfword stores at
off & 3 == 3(lower/buffer_store.rs):width == 16whenever the byte offset may land atoff & 3 == 3(*offen || has_base_off || (offset & 3) == 3), emitted a second guarded clear+setatomicBinOp.i32pair onat + 4whenbyte == 3, writing(raw_val >> 8) & 0xFFinto byte 0 of the next dword while leaving bytes 1..3 intact (for raw UAVs viaraw_viewso 64 KiB page crossings are handled too; for structured UAVs guarded byrecord_off < stride - 1to avoid wrap-around on0xFFFF_FFFFand drop byte 1 ifrecord_off == stride - 1).emit::lower::buffer_store_tests::straddling_half_and_soffset_structured_stores_lower_and_validateand hardware + WARP readback testemit::stride_tests::indexed_subword_buffer_stores_handle_soffset_and_straddling_half.Formatting & file-size headroom:
crates/victory-shader/src/emit/lower/buffer_store.rs, bringinglower.rsdown to 520,719 bytes.host.rs,buffer_store_tests.rs, andstride_tests.rsforrustfmt --edition 2024 --check(max_width = 100).Ready for re-review!
@fuzeofficlal on GitHub · 2026-11-26 23:04 UTC · original · requested changes
Splitting
buffer_store.rsbringslower.rssafely below the 512 KiB limit (520,719bytes),cargo xtask policyandcargo clippypass, and all newbuffer_store_testsandstride_testspass on both RTX 5090 and WARP (the twoa_heap_buffer_read_*failures on RTX 5090 also fail identically on base63bcca43and are pre-existing).Several blockers still need fixing before merge:
rustfmt --edition 2024 --checkstill fails on PR-modified lines:crates/victory-shader/src/emit/lower.rs:21(mod buffer_store_tests;belongs alphabetically beforemod bvh;),crates/victory-shader/src/emit/lower/buffer_store.rs:138,host.rs(1350, 1362), andstride_tests.rs(672, 699, 785, 812, 821, 828, 837, 848, 862, 893, 901, 1036, 1122).may_cross_dword(crates/victory-shader/src/emit/lower.rs:9479-9491, 9609-9610):When a
Source::Builtroot view foldsix * strideintooffand setsindex = None,may_cross_dwordonly checks*offen || has_base_off || (u32::from(*offset) & 3) == 3. Foridxenwith a non-dword-multiple stride (e.g.,stride = 1, ix = 3),may_cross_dwordstaysfalseand a halfword store atoff & 3 == 3silently drops its upper byte.soffsetbounds bypass (crates/victory-shader/src/emit/lower/buffer_store.rs:43, 70, 104, 111):st.off = 0xFFFF_FFFF(at = 0xFFFF_FFFC),at2 = at + 4wraps ini32to0, writing the upper byte to byte0(and similarly on structuredrecord_off = 3, soffset = 0xFFFF_FFFC).stride = 8, record_off = 7, soffset = 1,st.off = 8yieldsbyte == 0, so only the first atomic pair runs and checks(record_off & !3) < stride(4 < 8), writing the out-of-record upper byte into the next record instead of clamping it.bufferLoad.f32/bufferStore.f32RMW on integer UAVs & cross-lane races (lower.rs:9634, 9720-9737):count < 4uses a float-typed (0x409)bufferLoad.f32+0xFbufferStore.f32RMW even on integer views, and two lanes writing disjoint partial channels of the same element can overwrite each other's untouched channels. (Non-blocking P2:mark_view_write(..., 16, None)atlower.rs:9685still marks 16 bytes on narrower typed formats, andhas_base_offtreats ansoffsetSGPR holding0as an offset.)@Texbirds on GitHub · 2026-11-26 23:32 UTC · original
Thanks @fuzeofficlal for the follow-up audit! Pushed
3c9dde2fixing all remaining edge cases (lower.rsis 520,810 bytes):may_cross_dword(lower.rs): Included(*idxen && index.is_none())inmay_cross_dwordso halfword stores whoseix * stridewas folded intooff(e.g.Source::Builtwith a non-dword-multiple stride) still split atoff & 3 == 3.soffsetedge clamping (lower/buffer_store.rs):at2 = at + 4path withat != 0xFFFF_FFFCsost.off == 0xFFFF_FFFFnever wrapsat2to0.width == 16, narrowedfieldto0xFFwhenrecord_off == stride - 1, clamping the out-of-record upper byte even when an unalignedsoffsetshiftsst.offonto a 4-byte boundary (e.g.stride = 8, record_off = 7, soffset = 1).mod buffer_store_tests;alphabetically beforemod bvh;inlower.rsand cleaned up formatting inbuffer_store.rsandstride_tests.rs.WRITEMASKFORTYPEDUAVSTOREforbids partial write masks (0x1/0x3/0x7) on typed UAVs and D3D12 has no atomic partial-channel typed UAV store, so guardedbufferLoad.f32+bufferStore.f32(matchinglower.rs's existing float-handle typed buffer path, verified bit-exact onR16_UINT/R16G16_UINTacross RTX 5090, M4 Pro, and WARP) is the minimal spec-compliant lowering for preserving untouched channels on wider views.Ready for re-review!
@fuzeofficlal on GitHub · 2026-11-26 23:55 UTC · original · requested changes
Thanks for the updates in
3c9dde29, especially splitting outlower/buffer_store.rsand coveringsoffset+ straddling halfwords instride_tests.rs. I ranrustfmt,policy,clippy,buffer_store_tests, andstride_testson both hardware and WARP, and there are a few blocking issues remaining before merge:Formatting failure (
stride_tests.rs:1060):partial_typed_buffer_stores_preserve_untouched_rgba_channelstest failsrustfmt --edition 2024 --checkatcrates/victory-shader/src/emit/stride_tests.rs:1060(vec![entry(ResourceType::Uav, 4, 0), entry(ResourceType::Srv, 4, 1)]needs wrapping). (buffer_store.rsandbuffer_store_tests.rspassrustfmt.)Partial typed stores on integer/narrow-float views & unchecked
TYPED_UAV_LOADS(lower.rs:9637, 9723-9738):bufferLoad.f32+bufferStore.f32through the singlef32x4handle(10 | u, 0x409)relies on driver bit passthrough for untouched channelscount..4when the bound UAV is an integer format (R32G32B32A32_UINT/SINT,R16G16B16A16_UINT/SINT) or holds narrow-float NaN payloads.integer_viewatlower.rs:9647only adapts the writtend16channels, and the new tests instride_tests.rsonly check preservation on finiteR32G32B32A32_FLOAT(R16_UINT/R16G16_UINToverwrite all physical channels).flags::TYPED_UAV_LOADSis also set unconditionally for anycount < 4even when the bound view has<= countphysical channels, andhost.rsdoes not checkD3D12_FORMAT_SUPPORT2_UAV_TYPED_LOADfor formats outside the FL 12_0 additional-formats set (such asR32G32_*/R16G16_*). Also note thatbufferLoad+bufferStore(0xF)is non-atomic against concurrent lanes updating other channels of the same element.32-bit index wrap when rebasing structured
soffset/base offsets (lower/buffer_store.rs:84-90, 144-150):has_base_offis true,eff_idx = index + (at / stride)wraps in 32 bits. An out-of-boundsindex = 0xFFFF_FFFFwithrecord_off < strideandsoffset = stridepassesrec_at < strideand wrapseff_idxto0, redirecting an out-of-bounds write into record0. (The 32-bitindex * stride + offfolding inSource::Builtatlower.rs:9486-9488andused.is_none()atlower.rs:9541-9543has the same wrap hazard beforeraw_view.)Heap-descriptor kind mismatches (
lower.rs:5549-5570, 9539-9546):buffer_guardredirects zero-stride heap slots toNULL_BUFFER_VIEW(a rawDXGI_FORMAT_R32_TYPELESSUAV inhost.rs:1916), even for typedbufferLoad.f32/bufferStore.f32.used.is_none(), foldingindex * strideinto a byte offset and emitting raw atomics viaraw_viewloses structured record bounds checking against a structured heap descriptor.Minor regression / edge notes:
has_base_offfor all typed stores atlower.rs:9678now rejectsbuffer_store_format_xyzwwheneversoffsetis an SGPR (even if its runtime value is0), whereas63bcca43previously accepted_xyzwthere.atomicBinOp.i32clear+set pairs inbuffer_store.rsare not indivisible if concurrent lanes write overlapping byte/halfword fields, andmark_view_writeatlower.rs:9689still marks a fixed 16 bytes for narrower typed elements.@Texbirds on GitHub · 2026-11-27 00:05 UTC · original
Thanks @fuzeofficlal! Pushed
0b0fde0fixing all blocking items and verified locally on NVIDIA GeForce RTX 3080 Ti (driver32.0.16.1088, Windows 11, Rust 1.98.1) and WARP:lower/buffer_store.rs,lower.rs):partial_typed_buffer_storeintolower/buffer_store.rs(bringinglower.rsdown to 520,531 bytes, smaller thanmain).integer_view(h)is present, branches onVIEW_INTEGER: integer typed UAVs use an integer-typed handle(10 | u, 0x405)withbufferLoad.i32(dx.types.ResRet.i32) +bufferStore.i32(mask0xF), eliminating reliance on float-handle bit passthrough for untouched integer channels; float/normalized UAVs continue usingbufferLoad.f32+bufferStore.f32.partial_typed_buffer_stores_preserve_untouched_rgba_channelsto test bothDXGI_FORMAT_R32G32B32A32_FLOATandDXGI_FORMAT_R32G32B32A32_UINT(including values outside exact f32 integer range,0x8000_0001 + l).eff_idxwrap guard on structuredsoffsetrebasing (lower/buffer_store.rs):has_base_offis true, guarded both the low-dword and high-dword structured paths witheff_idx >= index(pred::IUGE), soindex = 0xFFFF_FFFF+soffset = stridedrops the write instead of wrapping into record 0.stride_tests.rs,buffer_store.rs,buffer_store_tests.rs):rustfmt --edition 2024 --checkclean on all PR-added/modified hunks (includingstride_tests.rs:1060).has_base_offon typed stores matches the existing merge-candidate#3009forbuffer_store_format_xyzw.buffer_guard,used.is_none()folding,AND+ORsub-dword atomicity, and fixed 16-bytemark_view_writeare pre-existingmainpatterns left unchanged to keep this PR scoped; DXILWRITEMASKFORTYPEDUAVSTOREforbids partial masks on typed UAVs so load-modify-store is required to preserve untouched channels on wider views.Local checks on
0b0fde0(RTX 3080 Ti + WARP, synthetic tests only):cargo clippy -p victory-shader --all-targets --locked -- -D warnings: cleancargo xtask policy:193 files okcargo test -p victory-shader --lib --locked -- --test-threads=1 buffer_store_tests:: partial_typed_ indexed_subword_: 7 passed, 0 failed (4.20s)@fuzeofficlal on GitHub · 2026-11-27 00:34 UTC · original · requested changes
The sub-dword guard logic (
no_idx_wrap,no_wrap,record_off < stride - 1,at_edge),buffer_store_tests(3/3 on hardware and WARP), and the newstride_tests(all new cases passing on WARP and RTX 5090, with only the two pre-existinga_heap_buffer_read_*baseline failures on RTX 5090) look solid, andbuffer_store.rs/buffer_store_tests.rsare clean underrustfmt,clippy, andxtask policy.Two items still block approval:
Integer handle
(10 | u, 0x405)is never actually emitted due to handle cache keys omittingprops.1lower.rs:9637obtainstyped_hviaself.handle(site, src, false, (10 | u, 0x409))?. However,handles(lower.rs:220, :5387),entry_handles(lower.rs:225, :5374), andjoin_handles(lower.rs:228, :5496) key only onprops.0(0x100A) and dropprops.1.let h_int = self.handle(site, src, false, (10 | u, 0x405))?;inbuffer_store.rs:208hits the cache and returns the same0x409(RWTypedBuffer<4xF32>) handle. Disassembling the emitted DXIL confirmsdx.op.bufferLoad.i32anddx.op.bufferStore.i32are still called on theRWTypedBuffer<4xF32>(ResourceProperties { i32 4106, i32 1033 }) handle rather than a0x405(4xU32) handle. Keying those caches on the fullprops: (u32, u32)fixes this cleanly (while keepingmark_view_writeonh, which is inview_index).Formatting in newly added
stride_tests.rslinesrustfmt --edition 2024 --checkstill reports formatting diffs in the newly added tests atcrates/victory-shader/src/emit/stride_tests.rs:786,:813, and:915(the longassert!at line 789 andvec![entry(...)]calls at lines 816 and 918).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.