cpp-migration: lower DPP16 quad_perm in the direct C++ compute path #2936

Closed
opened 2026-11-26 22:06:30 +00:00 by Leyukaka · 1 comment
Leyukaka commented 2026-11-26 22:06:30 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-26T22:06:30Z.


Target branch cpp-migration. Part of #2935 (instruction coverage). I am taking this; please say if you already have it locally and I will drop it.

Gap: gfx1013_compute_native.cpp accepts DPP16 pattern values 0-255 (quad_perm) only for graphics, so the direct compute path keeps only the row mirrors and refuses every compute quad_perm with "unsupported DPP lane selection".

Measured on 7f951fd3 with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests over a local capture of 2,689 compute requests (counts and instruction shape only). The request reader was patched locally to main's 28cs revision; the reader revision is tracked in #2933.

  • Result: 243 compiled, 2,446 refused.
  • 705 refusals are "unsupported DPP lane selection". In 677 of them the refused instruction is a quad_perm form:
    Instruction Requests Permutation
    v_or_b32_dpp 494 quad_perm:[1,0,3,2]
    v_add_nc_u32_dpp 45 quad_perm:[1,0,3,2]
    v_min_f32_dpp 44 quad_perm:[1,0,3,2]
    v_subrev_f32_dpp 44 quad_perm:[0,0,0,0]
    v_add_f32_dpp 36 quad_perm:[1,0,3,2]
    v_max_u32_dpp 14 quad_perm:[1,0,3,2]

Plan:

  • Accept DPP16 patterns 0-255 in compute.
  • Lower them in gfx1013_direct_compute.inl the way mirror() lowers the row mirrors:
    • read the source with waveReadLaneAt from lane (lane & ~3) | ((pattern >> 2 * (lane & 3)) & 3);
    • keep mirror()'s handling of a disabled source lane (bound_ctrl zero, or the old destination, or fetch-inactive), its operand-modifier rules and its 2-source ALU limit;
    • refuse when the thread count is not a multiple of 4;
    • for guest wave64, a quad stays inside one wave32 half.
  • Row shifts, rotates, broadcasts and row_share/row_xmask stay refused.

Tests, in the style of native_dpp_mirror_check.py, run on hardware against a CPU reference, with a capability skip where 32-lane waves are unavailable:

  • source-built compute programs for quad_perm:[1,0,3,2], [0,0,0,0], the identity [0,1,2,3] and one non-involutive permutation;
  • one program with a disabled source lane, under each of bound_ctrl and fetch-inactive;
  • a mutant that reads the permutation in the wrong lane order.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6635864682 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2936). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-26T22:06:30Z. --- Target branch `cpp-migration`. Part of #2935 (instruction coverage). I am taking this; please say if you already have it locally and I will drop it. **Gap:** `gfx1013_compute_native.cpp` accepts DPP16 pattern values 0-255 (`quad_perm`) only for graphics, so the direct compute path keeps only the row mirrors and refuses every compute `quad_perm` with "unsupported DPP lane selection". **Measured** on `7f951fd3` with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests` over a local capture of 2,689 compute requests (counts and instruction shape only). The request reader was patched locally to main's `28cs` revision; the reader revision is tracked in #2933. - Result: 243 compiled, 2,446 refused. - 705 refusals are "unsupported DPP lane selection". In 677 of them the refused instruction is a `quad_perm` form: | Instruction | Requests | Permutation | |---|---|---| | `v_or_b32_dpp` | 494 | `quad_perm:[1,0,3,2]` | | `v_add_nc_u32_dpp` | 45 | `quad_perm:[1,0,3,2]` | | `v_min_f32_dpp` | 44 | `quad_perm:[1,0,3,2]` | | `v_subrev_f32_dpp` | 44 | `quad_perm:[0,0,0,0]` | | `v_add_f32_dpp` | 36 | `quad_perm:[1,0,3,2]` | | `v_max_u32_dpp` | 14 | `quad_perm:[1,0,3,2]` | **Plan:** - Accept DPP16 patterns 0-255 in compute. - Lower them in `gfx1013_direct_compute.inl` the way `mirror()` lowers the row mirrors: - read the source with `waveReadLaneAt` from lane `(lane & ~3) | ((pattern >> 2 * (lane & 3)) & 3)`; - keep `mirror()`'s handling of a disabled source lane (`bound_ctrl` zero, or the old destination, or fetch-inactive), its operand-modifier rules and its 2-source ALU limit; - refuse when the thread count is not a multiple of 4; - for guest wave64, a quad stays inside one wave32 half. - Row shifts, rotates, broadcasts and `row_share`/`row_xmask` stay refused. **Tests**, in the style of `native_dpp_mirror_check.py`, run on hardware against a CPU reference, with a capability skip where 32-lane waves are unavailable: - source-built compute programs for `quad_perm:[1,0,3,2]`, `[0,0,0,0]`, the identity `[0,1,2,3]` and one non-involutive permutation; - one program with a disabled source lane, under each of `bound_ctrl` and fetch-inactive; - a mutant that reads the permutation in the wrong lane order. AI-assisted.
MasterDomino commented 2026-11-26 22:40:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T22:40:15Z.


Closed by #2937, merged into cpp-migration as 1cd48bd0. native_dpp_quad_hardware passes on an RTX 5080 (author) and on an RX 9070 XT, and a reversed-lane-order mutation fails it. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7204883564 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2936#issuecomment-7204883564). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T22:40:15Z. --- Closed by #2937, merged into `cpp-migration` as `1cd48bd0`. `native_dpp_quad_hardware` passes on an RTX 5080 (author) and on an RX 9070 XT, and a reversed-lane-order mutation fails it. AI-assisted.
Sign in to join this conversation.
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#2936
No description provided.