Shader tests: WARP 1.0.22 Wave32 lane permutation returns seven incorrect lanes #2949

Open
opened 2026-11-26 05:18:17 +00:00 by github-bot · 2 comments
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 01:21 UTC · original

On main at 63bcca43c6a00a758510398fa43096ce7e4f7df0, the stock ds_bpermute_b32 test dispatches successfully on Microsoft Direct3D WARP 1.0.22 and returns seven incorrect Wave32 lanes. An independent DXC-compiled HLSL shader using a dynamic WaveReadLaneAt returns the same seven incorrect values. I reproduced this while following up on the request in #1752.

Windows 11 adapter Stock shader Native HLSL, dynamic source
RTX 5080, driver 621.40 32/32 matched 32/32 matched
Built-in WARP, lane range 4–4 Wave32 pipeline skipped, zero readbacks —
App-local WARP 1.0.22, lane range 4–128 25/32 matched 25/32 matched
Destination lane 5 6 12 13 18 21 22
Expected 1006 1019 1001 1014 1015 1022 1003
Observed 1022 1003 1017 1030 1031 1006 1019

Reproduction in VIctory. Build the stock shader library tests with cargo test --locked -p victory-shader --lib --no-run. From a separate directory containing the resulting test executable and the x64 d3d10warp.dll from the Microsoft.Direct3D.WARP 1.0.22 NuGet package, run the executable with these arguments:

emit::synthetic_tests::permutes_read_the_lane_named_and_zero_from_lanes_left_out --exact --nocapture --test-threads=1

In the default system environment the stock test passed, including an explicit skip for built-in WARP. With app-local WARP the same test binary failed its warp assertion. An adapter-isolated diagnostic confirmed the DLL was loaded from the executable directory and captured all 32 words.

Native control. The relevant shader from a separate run, compiled with Windows SDK DXC 1.9.2602.17 (-T cs_6_6 -E main -O3), is below. Dispatch one group with a raw UAV of 32 dwords at heap index 2. All 32 lanes reach the wave intrinsic and every named source belongs to the wave. The selects implement the guest EXEC rule after the read.

[WaveSize(32)]
[numthreads(32, 1, 1)]
void main(uint id : SV_GroupIndex) {
    uint lane = WaveGetLaneIndex();
    uint source = (13 * lane + 5) & 31;
    uint sample = WaveReadLaneAt(1000 + lane, source);
    RWByteAddressBuffer output = ResourceDescriptorHeap[2];
    output.Store(id * 4, lane >= 24 ? 0xDEAD : (source < 24 ? sample : 0));
}

A control using 32 unrolled fixed-source reads followed by selection returned 32/32 on both the RTX and WARP 1.0.22. The native reproduction isolates the discrepancy from VIctory’s guest-shader decoder. The existing test correctly keeps its assertion when WARP supports the requested width. The separate short-wave case is covered by #1858.

AI-assisted with Codex. Synthetic shaders only.

**@⁠steven-seagull27** on GitHub · 2026-11-26 01:21 UTC · [original](https://github.com/Marvisak/VIctory/issues/2949) On `main` at `63bcca43c6a00a758510398fa43096ce7e4f7df0`, the stock `ds_bpermute_b32` test dispatches successfully on Microsoft **Direct3D WARP 1.0.22** and returns seven incorrect Wave32 lanes. An independent DXC-compiled HLSL shader using a dynamic `WaveReadLaneAt` returns the **same seven incorrect values**. I reproduced this while following up on [the request in #1752](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1752). | Windows 11 adapter | Stock shader | Native HLSL, dynamic source | |---|---:|---:| | RTX 5080, driver 621.40 | 32/32 matched | 32/32 matched | | Built-in WARP, lane range 4–4 | Wave32 pipeline skipped, zero readbacks | — | | App-local WARP 1.0.22, lane range 4–128 | 25/32 matched | 25/32 matched | | Destination lane | 5 | 6 | 12 | 13 | 18 | 21 | 22 | |---|---:|---:|---:|---:|---:|---:|---:| | Expected | 1006 | 1019 | 1001 | 1014 | 1015 | 1022 | 1003 | | Observed | 1022 | 1003 | 1017 | 1030 | 1031 | 1006 | 1019 | **Reproduction in VIctory.** Build the stock shader library tests with `cargo test --locked -p victory-shader --lib --no-run`. From a separate directory containing the resulting test executable and the x64 `d3d10warp.dll` from the [Microsoft.Direct3D.WARP 1.0.22 NuGet package](https://www.nuget.org/packages/Microsoft.Direct3D.WARP/1.0.22), run the executable with these arguments: ```text emit::synthetic_tests::permutes_read_the_lane_named_and_zero_from_lanes_left_out --exact --nocapture --test-threads=1 ``` In the default system environment the stock test passed, including an explicit skip for built-in WARP. With app-local WARP the same test binary failed its `warp` assertion. An adapter-isolated diagnostic confirmed the DLL was loaded from the executable directory and captured all 32 words. **Native control.** The relevant shader from a separate run, compiled with Windows SDK DXC 1.9.2602.17 (`-T cs_6_6 -E main -O3`), is below. Dispatch one group with a raw UAV of 32 dwords at heap index 2. All 32 lanes reach the wave intrinsic and every named source belongs to the wave. The selects implement the guest EXEC rule after the read. ```hlsl [WaveSize(32)] [numthreads(32, 1, 1)] void main(uint id : SV_GroupIndex) { uint lane = WaveGetLaneIndex(); uint source = (13 * lane + 5) & 31; uint sample = WaveReadLaneAt(1000 + lane, source); RWByteAddressBuffer output = ResourceDescriptorHeap[2]; output.Store(id * 4, lane >= 24 ? 0xDEAD : (source < 24 ? sample : 0)); } ``` A control using 32 unrolled fixed-source reads followed by selection returned 32/32 on both the RTX and WARP 1.0.22. The native reproduction isolates the discrepancy from VIctory’s guest-shader decoder. The existing test correctly keeps its assertion when WARP supports the requested width. The separate short-wave case is covered by [#1858](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1858). AI-assisted with Codex. Synthetic shaders only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:18:17 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 03:45 UTC · original · edited 2026-11-26 06:49 UTC

Automated triage for the maintainers.

The native HLSL control (DXC-compiled WaveReadLaneAt with a varying source) returns the same seven wrong lanes, so this reads as a defect in WARP 1.0.22 rather than in VIctory's translation of ds_bpermute_b32. On main the test permutes_read_the_lane_named_and_zero_from_lanes_left_out (crates/victory-shader/src/emit/synthetic_tests.rs) runs a warp arm whenever the WARP device accepts a 32-lane pipeline; the built-in WARP refuses it and the arm is skipped.

Open PR #2997 works around it by reading within four-lane groups on a software adapter only, with separate shader-cache keys for software and hardware DXIL. New since the last triage: the WARP 1.0.22 run that was missing has been done on #2997's head: the original case goes from 7/32 wrong lanes to 0/32, and five dispatches including wave64 and partial-EXEC cases from 82/224 to 0/224 in three fresh processes, with an RTX 5080 matching on both builds (details on #2997). Whether to carry a WARP-only workaround or to skip the warp arm on that WARP version is the maintainers' call in review.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 03:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/2949#issuecomment-7182000682) · edited 2026-11-26 06:49 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-26T03:49:40Z at=2026-11-26T07:25:00Z --> Automated triage for the maintainers. The native HLSL control (DXC-compiled `WaveReadLaneAt` with a varying source) returns the same seven wrong lanes, so this reads as a defect in WARP 1.0.22 rather than in VIctory's translation of `ds_bpermute_b32`. On `main` the test `permutes_read_the_lane_named_and_zero_from_lanes_left_out` (`crates/victory-shader/src/emit/synthetic_tests.rs`) runs a `warp` arm whenever the WARP device accepts a 32-lane pipeline; the built-in WARP refuses it and the arm is skipped. Open PR #2997 works around it by reading within four-lane groups on a software adapter only, with separate shader-cache keys for software and hardware DXIL. **New since the last triage:** the WARP 1.0.22 run that was missing has been done on #2997's head: the original case goes from 7/32 wrong lanes to 0/32, and five dispatches including wave64 and partial-EXEC cases from 82/224 to 0/224 in three fresh processes, with an RTX 5080 matching on both builds (details on #2997). Whether to carry a WARP-only workaround or to skip the `warp` arm on that WARP version is the maintainers' call in review. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 03:49 UTC · original

The requested WARP 1.0.22 check is complete. On the exact #2997 head the original case went from 7/32 wrong to 0/32. Across five dispatches including the Wave64 and partial-EXEC cases, it went from 82/224 wrong to 0/224 in each of three fresh processes. RTX 5080 matched all 96 Wave32 values on both builds. Windows’ built-in WARP skipped both widths. Results by case and adapter

**@⁠steven-seagull27** on GitHub · 2026-11-26 03:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/2949#issuecomment-7182057615) The requested WARP 1.0.22 check is complete. On the exact #2997 head the original case went from **7/32 wrong to 0/32**. Across five dispatches including the Wave64 and partial-EXEC cases, it went from **82/224 wrong to 0/224** in each of three fresh processes. RTX 5080 matched all 96 Wave32 values on both builds. Windows’ built-in WARP skipped both widths. [Results by case and adapter](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2997)
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#2949
No description provided.