Skip to content

Shaders: follow paired dword mask copies - #702

Open
Flyander wants to merge 1 commit into
fxceless:mainfrom
Flyander:fix/paired-dword-mask-provenance
Open

Flyander wants to merge 1 commit into
fxceless:mainfrom
Flyander:fix/paired-dword-mask-provenance

Conversation

@Flyander

@Flyander Flyander commented Nov 25, 2026 •

Copy link
Copy Markdown

Summary

Track lane-mask provenance when two adjacent s_mov_b32 instructions copy the low and high dwords into an adjacent SGPR pair in the same block. The source pair is reused only when its symbolic mask contains no opaque atoms, so unknown values remain conservative.

Adds a positive regression test and a negative test for unknown source values.

Retail shader pack results

Windows 11, RTX 5070 Ti, VICTORY_HOST_WAVE=32, victory translate --validate --pipelines --list --jobs 8:

  • “lane mask holding lanes elsewhere read as data”: 2 failures → 0
  • “opaque lane mask”: 1 failure → 0
  • validated programs: 25,383 → 25,386
  • pipelines created: 25,571 → 25,572

The previously failing PS_VoxelizeVisiblity variant now emits, validates, and creates a host pipeline. Two volumetric water shaders now emit and validate too. Their default D3D12 pipeline creation is still refused on this 32-lane host.

Targeted integration with #695

I stacked this commit locally on #695's e5b43c4 head. With global VICTORY_WAVE_WIDE unset and VICTORY_WAVE_WIDE_ONLY=6871d6e4b3ac9a10,926c46bab3b86bd6, both newly unblocked water shaders create pipelines and validate.

Negative control: the unlisted CS_TransmissionVolumetrics_Tiled shader (5dc3b25986622949) validates but its pipeline remains refused. This confirms the per-hash setting does not enable the wide form for unlisted programs. These are targeted offline checks; no in-game visual comparison was made.

Checks

(cherry picked from commit d1c54f25c6ef75285450bffb4a7f8215754697c7)
@JRamos1993

Copy link
Copy Markdown

Offline check on the retail shader pack: your result reproduces.

victory translate --validate --list over the title's full shader pack on an RTX 5090, main 310c6eb against this head merged onto it, default settings:

  • 25,382 → 25,385 validated (the 2 "lane mask holding lanes elsewhere read as data" programs and the 1 "opaque lane mask"). None lost.
  • With a local DXIL hash on each validated line, 2 other programs' DXIL changes; both still validate.

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

@Dathinel

Copy link
Copy Markdown
Contributor

Synthetic numerical A/B on RTX 3050 Laptop, native wave32. On the local Series S base with the allocator from #561 and the backward permute path from #1166 held fixed, adding only this PR's structure.rs change fixes 18 wrong output words in a wave64 group of 64 threads. Both variants emitted DXIL.

Reproducer: initialize v1 to 42, save EXEC, narrow EXEC to thread IDs below 47, save that mask in s[20:21], restore full EXEC, copy s20 and s21 into s22 and s23 with separate s_mov_b32 instructions, then restore EXEC from s[22:23]. Run ds_bpermute_b32 with address 4*(tid+33) and source tid, restore full EXEC, and store v1 by thread ID. Before: lane 46 reads 47 from an inactive source instead of 0, and lanes 47–63 overwrite the sentinel. After: all 160 words across 16/33/47/64-thread groups match the expected values. The smaller groups also pass before the change.

Run 278 in the public diagnostics records hash 926c46bab3b86bd6 failing mask translation; this test exercises the paired-copy behavior independently. No visual or performance measurement. AI-assisted.

Luigilt20 commented Nov 26, 2026 •

Copy link
Copy Markdown

I also tested this change in the Neptune tree at LooperSalty/AnyXboxX@c4c93bd. The structure.rs change applies cleanly. I built the original and patched translation tools and ran the same compute programs through both on Windows 11 using the Windows SDK DXIL validator (dxil.dll 1.9.2602.17).

Selected programs Original, emitted and validated Patched, emitted and validated
Two transmission-volumetrics compute variants 0/2 2/2
Vertex control 1/1 1/1
Five shadow compute variants with a separate descriptor diagnostic 0/5 0/5

Both focused Rust tests for paired DWORD mask provenance also passed on the isolated Neptune test build. This is an offline compiler result. GPU pipeline creation, water appearance and frame rate were outside this measurement. AI-assisted testing and reporting with Codex.

Full-pack follow-up on the same Neptune build and validator, six CPU threads. Of 26,084 programs, 25,687 → 25,689 emitted and 25,616 → 25,618 validated. The two water compute variants were the only gains. Across the 25,889 individually listed programs, none lost either emission or validation. Another 195 export-stage programs had no individual result in either run. No GPU pipelines were created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants