Shaders: keep per-lane descriptors across redundant masked moves #2078
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!2078
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2078/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:24 UTC · original
fuzeofficlal:fix/shader-joined-descriptor-redundant-write-750→main· +530 −21 · 3 files · 1 commits · closed without mergingCloses #750.
Summary
v_mov_b32step-back (Tracer::lane_value/redundant_vmov/same_in_lanes): when a plainv_mov_b32executes under a narrowedEXECmask (runsfails because inactive lanes retain the previous value), step back toTerm::Value(old)only if every feasible path inactive = known ∧ reach ∧ guardalready holds the replacement dwordwantedacross priorv_mov_b32,v_cndmask_b32, and acyclicphijoins.Tracer::feasible/cmp_atom): on top ofmeetandfew_atoms, group up to 4 pure 32-bit integerv_cmp_*/v_cmpx_*relations (_u32/_i32eq/ne/lt/gt/ge/le, never float compares) so repeated or complemented guards after a control-flow join prune unreachable predecessor arms.Testing
joined_descriptor_redundant_partial_write(repeatedv_cmp_gt_u32and complementedv_cmp_le_u32),joined_buffer_and_sampler_redundant_partial_writes(nested buffer and sampler joins), and the three negative conflict checks injoined_descriptor_conflicting_partial_writes_fail(other arm word,constant overwrite,wider mask).dxil.dll-validated waterfall readbackslanes_sample_after_redundant_masked_image_descriptor_writeandlanes_sample_with_joined_sampler_after_redundant_masked_write(verified across NVIDIA RTX 5090, AMD Radeon RDNA2, and D3D12 WARP), pluscargo clippyandcargo xtask policy.@YouKnowWh on GitHub · 2026-11-25 05:19 UTC · original
Independent check for #750 at PR head
b404d60cfb8a1f0d9e275a0c24f349587e3f5468against main940d32f69b22265690a0b5a15d6ded572ba33baf.victory-shader --libsuite passed 147, failed 0, ignored 2. On Windows I also ran the new image and joined-sampler end-to-end cases with WARP only, making validator availability mandatory (dxil.dll 1.8.2502.11). The per-lane expected-value checks passed, including swapped samplers. The test adapter selection and validation diagnostics were local harness changes only.victory translate shaders.rpf --validate --list --jobs 8. Both revisions scanned 26,503 containers. Comparing the 25,694 listed stage outcomes by original DXIL-part hash and stage, including repeated outcomes and refusal offsets, found zero differences. This compares translator/validator outcomes, not the generated instructions, visual output or hardware PSOs. The positive evidence for new coverage is the synthetic regression test.A performance caveat for review: an earlier wall-clock comparison of a different local port of #1182 against main is not evidence of a slowdown in #2078. I selected three slow pixel containers from that local profile and ran them individually on stock main and this PR (fresh process, one worker, same CPU and validator, both orders). For example
6f06d377496b2eb7validated in both processes on each revision: main 10.56 and 57.33 s; PR 20.40 and 0.82 s. A separate coarse tracing run on the PR spent ~3.5 ms in the initial resource tracking pass, ~201.0 s between enteringemit_withand returning to validation, and ~39 ms validating. Another run spent <1 s in emission. An additional instrumented run spent 19.93 s in the first call to lower::lower, which returned successfully without the discard fallback. This locates the long interval on that input, not its underlying cause or a general speed change. No title launch or hardware GPU run; no game files attached.AI-assisted local validation. Thanks for taking on the current-main PR.
@Marvisak on GitHub · 2026-11-25 10:30 UTC · original
Automated triage for the maintainers.
The change looks careful.
Tracer::lane_valuesteps back over a maskedv_mov_b32whenredundant_vmovandsame_in_lanesshow that active lanes already hold the written dword.Tracer::feasibleandcmp_atomlink repeated or complemented 32-bit integer compares, which is sound becauseAtom::Laneis the compare bit before EXEC masking. The positive and negative tests, including the GPU/WARP readbacks, are good, and CI passes. The concern is value against cost. It adds about 450 lines toresource.rs, andfeasiblenow replacesmeetinrunsand in the join path for every program. Yet the retail census in the comments found zero differences. When #1182 was closed, this refusal class was already at zero for the title's shaders in main.What would change the verdict: a title shader (identified by hash, with no shader data) that this change lets translate, and a before/after translation-time comparison across the archive. The single-container timings in the comments are too noisy to rule out a slowdown.
Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-25 15:40 UTC · original
Closing:
main(da82e44) now lands nested/joined descriptor handling (59c78bb,ff47463,850b66f), and this branch showed no corpus delta againstmain.Pull request closed