Shaders: rebuild all descriptor slices of merged s_load_dwordx8/x16 loads #2046
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!2046
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2046/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?
@fuzeofficlal on GitHub · 2026-11-25 04:06 UTC · original
fuzeofficlal:fix/shader-buffer-stride-and-merged-loads→main· +654 −139 · 3 files · 1 commits · closed without mergingSummary
s_load_dwordx8ors_load_dwordx16load inLower::descriptor_data(crates/victory-shader/src/emit/lower.rs):main,descriptor_datastops at the firstuse_ofmatch and sets all other loaded dwords toVal::Missing, so any shader reading dimensions or record counts from a second slice of a mergeds_load_dwordx8/s_load_dwordx16(or across split reloads from the same base) fails lowering.load == site) with same-base reload slices (same_basewithdeltainside[0, 4 * count)), ranking image and indexed-buffer uses above raw/scalar buffer uses.0..spanregisters so an unread failing slice (such as a CBV) does not poison sibling SRV/UAV slices.dim == 3,!uav,kind = 5, GFX10TYPE = 11in dwords 1..3) alongside 1D/2D/3D/array views, while keepingmain's buffer dword 0..3 andNUM_RECORDSsemantics unchanged.Verification
emit::descriptor_tests::merged_loads_and_split_reloads_rebuild_all_buffer_slices(dxil.dllvalidated, hardware GPU + WARP): coverss_load_dwordx8multi-slice buffer rebuilding,s_load_dwordx16split same-base reloads, and unread buffer dword refusal.emit::descriptor_tests::merged_cube_and_2d_slices_sample_and_read_dimensions(dxil.dllvalidated, hardware GPU + WARP): covers mergeds_load_dwordx16with 4x4 cube (dim == 3) + 6x3 2D (dim == 1) slices and per-slice CBV refusal isolation.cargo clippy -p victory-shader --tests --locked -- -D warningsandcargo xtask policy: passed.@jeremygold02 on GitHub · 2026-11-25 04:09 UTC · original
Triage verdict — Keep, cover split reloads and mixed descriptor slices (
8df2ae4)Evidence
Checks and limits
Next step
s_load_dwordx8pair with one distinct resource consumer per reload and a scalar read of the other slice’s record count. Also cover a merged 2D metadata read plus a cube handle used only for sampling. These cases check that recovery combines compatible evidence without imposing metadata restrictions on unrelated slices.This verification was AI-assisted.
@fuzeofficlal on GitHub · 2026-11-25 05:02 UTC · original
Updated in
51eecad4— thanks @jeremygold02 for catching both cases:descriptor_datanow scans everyRole::Resourceslice whose load matchessiteor sharessame_base(a, b)with an offset inside[b.offset, b.offset + 4 * count), merging slices by relative dword offset andrankrather than stopping at the first reload.dim == 3,!uav) now map tokind = 5(TextureCube,TYPE = 11indwords 1..=3), and per-slice refusals (such as an unread CBV or unsupported image slice inside a mergeds_load_dwordx16) mark only that slice's span asVal::Missingso sibling slices still reconstruct.dxil.dll-validated testsmerged_reload_slices_supply_all_record_counts_and_strides_on_all_gpusandmerged_cube_and_2d_slices_sample_and_read_dimensions_on_all_gpus.@Marvisak on GitHub · 2026-11-25 09:18 UTC · original · edited 2026-11-25 11:23 UTC
Automated triage for the maintainers.
Needs work. It is close now.
On your reply:
b329b1fdoes narrow the PR to the merged-load part.Val::Bits/bits_op, the 64-bit select merge, the readfirstlane flag and the buffer stride/NUM_RECORDSchanges are all gone from the diff, andcrates/victory-shader/src/emit/lower.rsnow differs from main only indescriptor_data. I read the rewrite:Role::Resourceleaf loaded atsite, or from asame_baseload whose dword offset falls inside the loaded range, gives a slice. Image beats buffer beats SMEM viarank.Val::Missing(why).What is still missing is the evidence the earlier review asked for: that the title reaches these paths. The only measurement in the thread (sinan-cmyk, on the earlier and larger head) shows no change in
translate --validatecounts, and a validation count would not show whether the output changed anyway. Please give counts only, no shader names or data:s_load_dwordx8/x16where a slice other than the first used one is now rebuilt,If those programs exist, this is a reasonable merge. The two descriptor tests do check rebuilt values against the host view's dimensions on GPU and WARP, not just against what the code emits. CI: passing (
check).Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 09:33 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head 51eecad4 onto
main940d32f(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).
@fuzeofficlal on GitHub · 2026-11-25 10:08 UTC · original
Updated in
b329b1f9per triage feedback:Lower::descriptor_datarebuilding all consumed slices of mergeds_load_dwordx8/s_load_dwordx16loads, including across same-base reloads and sampled/sizeddim == 3cube slices, with per-slice refusal isolation).Val::Bits/bits_op, thev_readfirstlane_b32wave-ops flag change, the merged 64-bit select changes, and all buffer dword-1 stride /NUM_RECORDSchanges (main's buffer record-count behaviour is preserved unchanged).descriptor_tests.rsto the two focused GPU + WARP (dxil.dllvalidated) tests covering merged buffer slices, split reloads, mixed cube + 2D image slices, and per-slice CBV refusal isolation.@fuzeofficlal on GitHub · 2026-11-25 17:20 UTC · original
Closing this PR: as noted in triage, confirming a measurable hit on real title shader corpora is needed before merging, and I only test with synthetic shaders locally.
Pull request closed