shader: lower ds_nop in pixel_aot #847

Merged
stan495 merged 2 commits from upstream-pr/853 into main 2026-11-23 13:46:17 +00:00
stan495 commented 2026-11-23 13:23:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T13:23:37Z.


Change

Lower operandless ds_nop in the straight-line pixel profile. Keep the program-end, color-export and immediate DS swizzle wait guards ahead of the new handling. Reuse the gfx1030 wave64 swizzle fixture to exercise the instruction at entry and under whole-quad EXEC.

Verification

Tested 3d84719 based on 34d03c7. With LLVM 15.0.7, the source-built round trip verified the leading eight-byte encoding and decoded both ds_nop instructions. The Python controls matched the HLSL generated with s_nop 0 at the same positions and rejected operands, GDS, an offset, post-export and post-end placements, and a ds_nop inserted before a required wait. Before the change, the new positive control raised Unsupported instruction 0: ds_nop.

On Windows 11 25H2 build 26200.9974 and DXC 1.8.2502.11, both program variants matched all 256 UINT channel words against the CPU oracle on WARP (10.0.26100.9818) and Radeon RX 7900 XTX (32.0.32029.2010). The D3D12 debug layer reported zero errors and warnings. Both backends caught the existing blue-channel mutation at (0, 0), with 0x3e400000 expected and 0x3d800000 observed. CTest passed 3/3 with zero skips. The targeted coverage report recorded 2/123 gfx1030 DS forms, including ds_nop.

.\tools\dev.ps1
$env:XBOX2WINDOWS_ADAPTER = '7900 XTX'
cmake --preset dev
cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^(pixel_aot_ds_swizzle_(warp|hardware)|pixel_aot_warp)$' --output-junit "$PWD/out/results.xml" -V
python -B tests/pixel_aot_check.py
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py
python -B tools/form_coverage.py out/results.xml --json out/coverage.json
git diff --check origin/main...HEAD
python3 -B tests/pixel_aot_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1
LLVM_LIB=libLLVM-15.so.1 LLVM_MC=llvm-mc-15 LLVM_OBJCOPY=llvm-objcopy-15 python3 -B tests/rdna2_tools_check.py

The LLVM-enabled disassembler suite passed 72/72. The tests use source-built fixtures and measure desktop translation.

AI-assisted (Codex and DeepSeek Harness).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6560301788 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/853). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T13:23:37Z. --- ## Change Lower operandless `ds_nop` in the straight-line pixel profile. Keep the program-end, color-export and immediate DS swizzle wait guards ahead of the new handling. Reuse the gfx1030 wave64 swizzle fixture to exercise the instruction at entry and under whole-quad EXEC. ## Verification Tested `3d84719` based on `34d03c7`. With LLVM 15.0.7, the source-built round trip verified the leading eight-byte encoding and decoded both `ds_nop` instructions. The Python controls matched the HLSL generated with `s_nop 0` at the same positions and rejected operands, GDS, an offset, post-export and post-end placements, and a `ds_nop` inserted before a required wait. Before the change, the new positive control raised `Unsupported instruction 0: ds_nop`. On Windows 11 25H2 build 26200.9974 and DXC 1.8.2502.11, both program variants matched all 256 UINT channel words against the CPU oracle on WARP (10.0.26100.9818) and Radeon RX 7900 XTX (32.0.32029.2010). The D3D12 debug layer reported zero errors and warnings. Both backends caught the existing blue-channel mutation at (0, 0), with `0x3e400000` expected and `0x3d800000` observed. CTest passed 3/3 with zero skips. The targeted coverage report recorded 2/123 gfx1030 DS forms, including `ds_nop`. ```powershell .\tools\dev.ps1 $env:XBOX2WINDOWS_ADAPTER = '7900 XTX' cmake --preset dev cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^(pixel_aot_ds_swizzle_(warp|hardware)|pixel_aot_warp)$' --output-junit "$PWD/out/results.xml" -V python -B tests/pixel_aot_check.py python -B tests/form_coverage_check.py python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py python -B tools/form_coverage.py out/results.xml --json out/coverage.json git diff --check origin/main...HEAD ``` ```sh python3 -B tests/pixel_aot_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 LLVM_LIB=libLLVM-15.so.1 LLVM_MC=llvm-mc-15 LLVM_OBJCOPY=llvm-objcopy-15 python3 -B tests/rdna2_tools_check.py ``` The LLVM-enabled disassembler suite passed 72/72. The tests use source-built fixtures and measure desktop translation. AI-assisted (Codex and DeepSeek Harness).
upstream-sync closed this pull request 2026-11-24 06:45:05 +00:00
R0Y00 commented 2026-11-24 06:49:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T13:34:25Z.


I refreshed the branch in b99e8b5 after #651 changed the shared LLVM round-trip assertions. The test preserves both the branch offsets and the DS NOP encoding/count checks. On Windows 26200.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656 each matched both 256-word variants and caught the blue-channel mutation. The debug layer reported zero errors and warnings. LLVM 15 and form coverage passed. GitHub CI is running.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7102727869 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/853#issuecomment-7102727869). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T13:34:25Z. --- I refreshed the branch in b99e8b5 after #651 changed the shared LLVM round-trip assertions. The test preserves both the branch offsets and the DS NOP encoding/count checks. On Windows 26200.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656 each matched both 256-word variants and caught the blue-channel mutation. The debug layer reported zero errors and warnings. LLVM 15 and form coverage passed. GitHub CI is running.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!847
No description provided.