shader: lower v_permlane16_b32 and v_permlanex16_b32 in direct compute #3022

Merged
Leyukaka merged 3 commits from upstream-pr/3022 into main 2026-11-27 22:30:04 +00:00
Leyukaka commented 2026-11-27 06:07:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T06:07:41Z.


Fixes #3021. Part of #2935. Target branch main. The measured requests reach these ops only once DPP16 row operations are lowered; that is #3010, now on main.

Change (src/gfx1013_compute_native.cpp, src/gfx1013_direct_compute.inl): direct compute now lowers v_permlane16_b32 and v_permlanex16_b32.

  • Lane i of a 16-lane row reads S0 from lane sel = ({S2, S1} >> (4 * (i & 15))) & 15. permlane16 reads from the same row. permlanex16 reads from the other row of the same 32-lane half.
  • S1 and S2 are uniform: SGPRs, inline constants, or the one trailing 32-bit literal, which both may reference. A literal in S0 is refused. Each lane picks its 4-bit field at run time.
  • op_sel[0] is FI and op_sel[1] is BOUND_CTRL.
  • For an inactive source lane, I assumed the DPP rule. Without FI, an inactive source gives 0 with BOUND_CTRL; otherwise D keeps its old value. The readback checks the lowering against that model, not RDNA2 itself.
  • A row and its pair stay inside one 32-lane half. On the wave64 path each half is one physical wave32, so the lowering uses the physical lane index and the matching EXEC half.
  • Refused:
    • other op_sel bits, abs, neg, clamp and omod;
    • a non-uniform or special selector (VGPR, vcc_lo, vcc_hi on the wave64 path, exec, m0, null), and an S0 that is not a VGPR. In wave32, vcc_hi is ordinary scalar data;
    • a thread count not divisible by 16 (permlane16) or 32 (permlanex16).

Tests. The setup was Windows 11 build 26300.9974 with an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and DXC from the Windows SDK 10.0.26100, on main 6057071b plus this branch. The D3D12 debug layer is not installed. Release and Debug (dev preset) builds both pass.

  • native_permlane_hardware passed. Seven wave32 programs ran in two 64-thread groups with sparse guest EXEC. All 2,064 output words matched a CPU reference, sentinels included. The programs are:

    • x16 with BOUND_CTRL and a literal-plus-SGPR selector;
    • x16 with FI and two SGPRs;
    • x16 with inline 0 selectors;
    • permlane16 with BOUND_CTRL and a literal-plus-SGPR selector;
    • permlane16 with two SGPRs;
    • x16 with an SGPR in S1 and a literal in S2;
    • x16 with the same literal in S1 and S2.

    The selectors differ per row lane, and S1 differs from S2.

  • native_permlane_controls passed. A wave32 request and a split-wave64 container compile. These are refused:

    • op_sel bit 2;
    • clamp;
    • a VGPR selector;
    • x16 with 16 threads, and permlane16 with 8;
    • an inline S0.
  • Wave64 is covered by that compile case only, not by a readback.

  • The 9 native_dpp*, native_lane*, native_wave*, native_readlane* and native_permlane* tests pass.

Mutation checks, run by hand; each fails the hardware check:

  • reading the same row for x16;
  • swapping S1 and S2;
  • ignoring BOUND_CTRL.

Measured on a local capture (counts and instruction shape only) with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests.

  • Of 2,689 compute requests, 47 stopped first at one of the two ops on #3010 (measured on cpp-migration 999e17cd plus #3010, before #3010 reached main).
  • With this change, 34 of them compile, and none that compiled before stops. The compiled count goes from 393 to 427. The requests of one start-up run go from 406 to 440.
  • The other 13 stop later, 7 of them at "direct scalar move destination".
  • All 47 have the wave32 bit of #2999 clear. Without #3006 they still compile on the wave32 model. With #3006 they take the wave64 path, where some may stop at its existing limits; I have not measured that combination yet.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5522098922 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T06:07:41Z. --- Fixes #3021. Part of #2935. Target branch `main`. The measured requests reach these ops only once DPP16 row operations are lowered; that is #3010, now on `main`. **Change** (`src/gfx1013_compute_native.cpp`, `src/gfx1013_direct_compute.inl`): direct compute now lowers `v_permlane16_b32` and `v_permlanex16_b32`. - Lane `i` of a 16-lane row reads `S0` from lane `sel = ({S2, S1} >> (4 * (i & 15))) & 15`. `permlane16` reads from the same row. `permlanex16` reads from the other row of the same 32-lane half. - S1 and S2 are uniform: SGPRs, inline constants, or the one trailing 32-bit literal, which both may reference. A literal in S0 is refused. Each lane picks its 4-bit field at run time. - `op_sel[0]` is FI and `op_sel[1]` is BOUND_CTRL. - For an inactive source lane, I assumed the DPP rule. Without FI, an inactive source gives 0 with BOUND_CTRL; otherwise D keeps its old value. The readback checks the lowering against that model, not RDNA2 itself. - A row and its pair stay inside one 32-lane half. On the wave64 path each half is one physical wave32, so the lowering uses the physical lane index and the matching EXEC half. - Refused: - other `op_sel` bits, abs, neg, clamp and omod; - a non-uniform or special selector (VGPR, `vcc_lo`, `vcc_hi` on the wave64 path, exec, m0, null), and an S0 that is not a VGPR. In wave32, `vcc_hi` is ordinary scalar data; - a thread count not divisible by 16 (`permlane16`) or 32 (`permlanex16`). **Tests.** The setup was Windows 11 build 26300.9974 with an NVIDIA GeForce RTX 5080 (driver 32.0.16.2101) and DXC from the Windows SDK 10.0.26100, on `main` `6057071b` plus this branch. The D3D12 debug layer is not installed. Release and Debug (`dev` preset) builds both pass. - `native_permlane_hardware` passed. Seven wave32 programs ran in two 64-thread groups with sparse guest EXEC. All 2,064 output words matched a CPU reference, sentinels included. The programs are: - `x16` with BOUND_CTRL and a literal-plus-SGPR selector; - `x16` with FI and two SGPRs; - `x16` with inline 0 selectors; - `permlane16` with BOUND_CTRL and a literal-plus-SGPR selector; - `permlane16` with two SGPRs; - `x16` with an SGPR in S1 and a literal in S2; - `x16` with the same literal in S1 and S2. The selectors differ per row lane, and S1 differs from S2. - `native_permlane_controls` passed. A wave32 request and a split-wave64 container compile. These are refused: - `op_sel` bit 2; - clamp; - a VGPR selector; - `x16` with 16 threads, and `permlane16` with 8; - an inline S0. - Wave64 is covered by that compile case only, not by a readback. - The 9 `native_dpp*`, `native_lane*`, `native_wave*`, `native_readlane*` and `native_permlane*` tests pass. **Mutation checks**, run by hand; each fails the hardware check: - reading the same row for `x16`; - swapping S1 and S2; - ignoring BOUND_CTRL. **Measured on a local capture** (counts and instruction shape only) with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests`. - Of 2,689 compute requests, 47 stopped first at one of the two ops on #3010 (measured on `cpp-migration` `999e17cd` plus #3010, before #3010 reached `main`). - With this change, 34 of them compile, and none that compiled before stops. The compiled count goes from 393 to 427. The requests of one start-up run go from 406 to 440. - The other 13 stop later, 7 of them at "direct scalar move destination". - All 47 have the wave32 bit of #2999 clear. Without #3006 they still compile on the wave32 model. With #3006 they take the wave64 path, where some may stop at its existing limits; I have not measured that combination yet. AI-assisted.
R0Y00 commented 2026-11-27 06:48:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T06:48:54Z.

Review: COMMENTED


Independent retest at 125f5313 stacked on #3010 (7325dd17). I rebuilt compile_dxil and native_store_replay and ran native_permlane_controls and native_permlane_hardware separately with ctest --preset <dev|release> --no-tests=error -V -R '^native_permlane_(controls|hardware)$'. Both passed in Debug and Release /O2 without skips. The hardware replay matched 128 result words plus all guards in each of six cases with the inbox D3D12 runtime (Windows 11 build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, replay debug layer off). No WARP test is registered.

The AMD RDNA 2 ISA guide, §12.12 confirms the selector packing, row pairing and FI/BOUND_CTRL bit positions. The desktop readback exercises the proposed inactive-source model. The exact preserve-versus-zero behavior still needs a native RDNA 2 result. All 47 measured requests are flagged wave64, while the current wave64 control only compiles. Please coordinate with #3006 on a split-wave64 bit-exact readback with different lower/upper EXEC masks, so selecting the wrong half fails at a known lane.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6084511164 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6084511164). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T06:48:54Z. **Review:** COMMENTED --- Independent retest at `125f5313` stacked on #3010 (`7325dd17`). I rebuilt `compile_dxil` and `native_store_replay` and ran `native_permlane_controls` and `native_permlane_hardware` separately with `ctest --preset <dev|release> --no-tests=error -V -R '^native_permlane_(controls|hardware)$'`. Both passed in Debug and Release `/O2` without skips. The hardware replay matched 128 result words plus all guards in each of six cases with the inbox D3D12 runtime (Windows 11 build 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, replay debug layer off). No WARP test is registered. The [AMD RDNA 2 ISA guide, §12.12](https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf) confirms the selector packing, row pairing and FI/BOUND_CTRL bit positions. The desktop readback exercises the proposed inactive-source model. The exact preserve-versus-zero behavior still needs a native RDNA 2 result. All 47 measured requests are flagged wave64, while the current wave64 control only compiles. Please coordinate with #3006 on a split-wave64 bit-exact readback with different lower/upper EXEC masks, so selecting the wrong half fails at a known lane.
R0Y00 commented 2026-11-27 15:50:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T15:50:51Z.


#3010 is now on main as 1ec2c938. I checked 125f5313 against main 354c6870: an immediate base change still shows the pre-squash #3010 commit and conflicts in docs/experiments.md. Please rebuild this PR branch from current main with only the permlane change, then change this existing PR’s base to main. Keep the prior review and the inactive-source scope note linked. I’ll recheck against the new head with native_permlane_(controls|hardware) and the DPP16 row regressions.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7222552974 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#issuecomment-7222552974). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T15:50:51Z. --- #3010 is now on `main` as `1ec2c938`. I checked `125f5313` against `main` `354c6870`: an immediate base change still shows the pre-squash #3010 commit and conflicts in `docs/experiments.md`. Please rebuild this PR branch from current `main` with only the permlane change, then change this existing PR’s base to `main`. Keep the prior review and the inactive-source scope note linked. I’ll recheck against the new head with `native_permlane_(controls|hardware)` and the DPP16 row regressions.
Leyukaka commented 2026-11-27 17:41:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T17:41:43Z.


Rebuilt from current main (63a30dc1) with only the permlane change (b99a223f); the base is now main, and the description is updated.

  • Your review at 125f5313 and the scope note on the inactive-source rule still apply: https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6084511164
  • A second commit sets the wave32 bit (#2999) in this fixture's .sa, so its 32-lane requests stay on the wave32 model if #3006 lands; without #3006 the bit is ignored.
  • On this head (RTX 5080, Release), native_permlane_controls, native_permlane_hardware, native_dpp_row_controls, native_dpp_row_hardware, native_dpp_quad_controls and native_dpp_quad_hardware pass.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7224686509 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#issuecomment-7224686509). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T17:41:43Z. --- Rebuilt from current `main` (`63a30dc1`) with only the permlane change (`b99a223f`); the base is now `main`, and the description is updated. - Your review at `125f5313` and the scope note on the inactive-source rule still apply: https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6084511164 - A second commit sets the wave32 bit (#2999) in this fixture's `.sa`, so its 32-lane requests stay on the wave32 model if #3006 lands; without #3006 the bit is ignored. - On this head (RTX 5080, Release), `native_permlane_controls`, `native_permlane_hardware`, `native_dpp_row_controls`, `native_dpp_row_hardware`, `native_dpp_quad_controls` and `native_dpp_quad_hardware` pass. AI-assisted.
JohnConnorNPC commented 2026-11-27 18:21:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-27T18:21:28Z.


Thank you for the rebuild onto main and for the careful write-up. I reviewed 042cb0b8 and its merge onto current main (80668b97). The wave32 lowering matches the RDNA2 pseudocode as I read it: selector packing, row pairing, and FI/BOUND_CTRL handled like the existing DPP lowering. native_permlane_controls passes on both trees in a Release cross build. A few requests before merge:

  1. Split wave64 (from the earlier review). On main, requests always use the wave32 model, so the wave64 branch of lower_permlane is only compiled, never read back. As a check, I changed auto exec = wave64 ? select(upper_half, read(127), read(126)) : read(126); to auto exec = read(126);. Both native_permlane_controls and native_permlane_hardware still pass. Since all 47 measured requests are flagged wave64, could you either add a split-wave64 readback with different lower/upper EXEC masks (with #3006 or through a container replay), or refuse the two ops on the wave64 path until that readback exists, and open a linked follow-up issue? If the maintainer prefers to track it in #3006, a link to that decision is enough.
  2. CI coverage. The pull-request CI job runs the pr test preset, which selects neither native_permlane_controls nor native_permlane_hardware. The 69 tests in the Windows job don't include them, so your RTX 5080 Release run is the only Windows evidence at this head. Could you add the exact command, the driver version, Windows build and debug-layer status, and a Debug run (e.g. ctest --preset dev --no-tests=error -V -R '^native_permlane_(controls|hardware)$')? A manual "Windows checks → Run workflow" run of the branch would also do for the controls.
  3. Doc base. docs/experiments/native-permlane.md still says "on #3010 (7325dd17) plus this change". That commit is #3010's pre-squash head and isn't in main's history. Could you copy the two bases from the PR body into the doc: the tested commit (main 63a30dc1 plus this branch), and the base of the 2,689-request count (cpp-migration 999e17cd plus #3010)?

Smaller points, take or leave:

  • LLVM accepts v_permlanex16_b32 v1, v2, 0x492f0381, 0x492f0381 for gfx1013. It encodes word 1 as 0x03FDFF02, the same as the "two literals" control, and only rejects two different literals. Either accept S1 = S2 = the same literal (operand32 already returns i.literal for both) and make that control a compiled case, or reword the refusal message as a deliberate scope limit.
  • The abs/neg/clamp/omod refusal has no control. Removing || i.neg || i.abs || i.clamp || i.scale keeps the suite green. One row (e.g. clamp, word 0 0xD7788001) would pin it.
  • In wave32, vcc_hi (s107) is accepted as a selector, which matches initialize()'s treatment of s107 as ordinary scalar data. The body's "vcc" in the refused list could say "vcc_lo (and vcc_hi in wave64)".
  • With the decoder's i.src[0] == 255 clause removed, an S0 literal is still refused by the lowering ("S0 must be a VGPR"). The clause is redundant; keep or drop as you prefer.

For the record, on a different stack (RTX 4070 Ti SUPER, Linux driver 550.163.01, vkd3d-proton under Proton experimental-11.0, debug layer off), native_permlane_hardware passed all six readbacks at 042cb0b8 and on its merge with main 80668b97. Your three manual mutants (same row for x16, swapped S1/S2, ignored BOUND_CTRL) each failed it, as did ignoring FI and testing the destination lane's EXEC bit instead of the source's. Only the wave64 EXEC-half change above stayed green.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7225403502 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#issuecomment-7225403502). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-27T18:21:28Z. --- Thank you for the rebuild onto `main` and for the careful write-up. I reviewed `042cb0b8` and its merge onto current `main` (`80668b97`). The wave32 lowering matches the RDNA2 pseudocode as I read it: selector packing, row pairing, and FI/BOUND_CTRL handled like the existing DPP lowering. `native_permlane_controls` passes on both trees in a Release cross build. A few requests before merge: 1. **Split wave64 (from the earlier review).** On `main`, requests always use the wave32 model, so the wave64 branch of `lower_permlane` is only compiled, never read back. As a check, I changed `auto exec = wave64 ? select(upper_half, read(127), read(126)) : read(126);` to `auto exec = read(126);`. Both `native_permlane_controls` and `native_permlane_hardware` still pass. Since all 47 measured requests are flagged wave64, could you either add a split-wave64 readback with different lower/upper EXEC masks (with #3006 or through a container replay), or refuse the two ops on the wave64 path until that readback exists, and open a linked follow-up issue? If the maintainer prefers to track it in #3006, a link to that decision is enough. 2. **CI coverage.** The pull-request CI job runs the `pr` test preset, which selects neither `native_permlane_controls` nor `native_permlane_hardware`. The 69 tests in the Windows job don't include them, so your RTX 5080 Release run is the only Windows evidence at this head. Could you add the exact command, the driver version, Windows build and debug-layer status, and a Debug run (e.g. `ctest --preset dev --no-tests=error -V -R '^native_permlane_(controls|hardware)$'`)? A manual "Windows checks → Run workflow" run of the branch would also do for the controls. 3. **Doc base.** `docs/experiments/native-permlane.md` still says "on #3010 (`7325dd17`) plus this change". That commit is #3010's pre-squash head and isn't in `main`'s history. Could you copy the two bases from the PR body into the doc: the tested commit (`main` `63a30dc1` plus this branch), and the base of the 2,689-request count (`cpp-migration` `999e17cd` plus #3010)? Smaller points, take or leave: - LLVM accepts `v_permlanex16_b32 v1, v2, 0x492f0381, 0x492f0381` for gfx1013. It encodes word 1 as `0x03FDFF02`, the same as the "two literals" control, and only rejects two *different* literals. Either accept S1 = S2 = the same literal (`operand32` already returns `i.literal` for both) and make that control a compiled case, or reword the refusal message as a deliberate scope limit. - The abs/neg/clamp/omod refusal has no control. Removing `|| i.neg || i.abs || i.clamp || i.scale` keeps the suite green. One row (e.g. clamp, word 0 `0xD7788001`) would pin it. - In wave32, `vcc_hi` (s107) is accepted as a selector, which matches `initialize()`'s treatment of s107 as ordinary scalar data. The body's "vcc" in the refused list could say "vcc_lo (and vcc_hi in wave64)". - With the decoder's `i.src[0] == 255` clause removed, an S0 literal is still refused by the lowering ("S0 must be a VGPR"). The clause is redundant; keep or drop as you prefer. For the record, on a different stack (RTX 4070 Ti SUPER, Linux driver 550.163.01, vkd3d-proton under Proton experimental-11.0, debug layer off), `native_permlane_hardware` passed all six readbacks at `042cb0b8` and on its merge with `main` `80668b97`. Your three manual mutants (same row for `x16`, swapped S1/S2, ignored BOUND_CTRL) each failed it, as did ignoring FI and testing the destination lane's EXEC bit instead of the source's. Only the wave64 EXEC-half change above stayed green. This comment was AI-assisted.
Leyukaka commented 2026-11-27 19:43:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T19:43:04Z.


Thank you for the review and for the second-stack run. Rebased on main 6057071b; the new commit is b912ad58. The description is updated to match.

  1. Split wave64: agreed. On main the wave64 branch of lower_permlane is only compiled by the container control, never read back, so your read(126) mutant survives. The experiment note now says so. The wave64 path is not refused here: the maintainer asked to coordinate the split-wave64 readback with #3006 (https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6084511164).
  2. Windows evidence at this head:
    • Setup: Windows 11 build 26300.9974, NVIDIA GeForce RTX 5080, driver 32.0.16.2101 (NVIDIA 621.01), DXC from the Windows SDK 10.0.26100.
    • Debug layer: unavailable. The D3D12 SDK layers (Graphics Tools) are not installed on this machine.
    • Release: ctest --test-dir out/build/release -R "native_permlane|native_dpp|native_lane|native_direct_container", 9 of 9 passed.
    • Debug: cmake --preset dev, cmake --build --preset dev --target compile_dxil native_store_replay, then ctest --preset dev --no-tests=error -R '^native_permlane_(controls|hardware)$'. Both passed.
  3. Doc base: the note now gives both bases. The tests ran on main 6057071b plus this branch. The 2,689-request count comes from cpp-migration 999e17cd plus #3010.

Smaller points:

  • Same literal in S1 and S2: now accepted. The "two literals" control became a compiled and read-back case, cross-shared-literal. Its words are 0xD7780001 0x03FDFF02 0x492F0381, with eight different selectors, the same for row lanes 0-7 and 8-15. A literal in S0 is still refused, and the message now says exactly that: "permlane S0 cannot be a literal".
  • Modifier refusal: a clamp control (0xD7788001 0x00341902) now pins it. Removing i.clamp from that check fails native_permlane_controls.
  • vcc_hi: the note now says that selectors refuse vcc_lo, and vcc_hi on the wave64 path. In wave32, vcc_hi is ordinary scalar data.
  • The i.src[0] == 255 clause: I kept it as the decoder-level refusal for a literal S0.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7226801849 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#issuecomment-7226801849). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T19:43:04Z. --- Thank you for the review and for the second-stack run. Rebased on `main` `6057071b`; the new commit is `b912ad58`. The description is updated to match. 1. **Split wave64:** agreed. On `main` the wave64 branch of `lower_permlane` is only compiled by the container control, never read back, so your `read(126)` mutant survives. The experiment note now says so. The wave64 path is not refused here: the maintainer asked to coordinate the split-wave64 readback with #3006 (https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6084511164). 2. **Windows evidence at this head:** - Setup: Windows 11 build 26300.9974, NVIDIA GeForce RTX 5080, driver 32.0.16.2101 (NVIDIA 621.01), DXC from the Windows SDK 10.0.26100. - Debug layer: unavailable. The D3D12 SDK layers (Graphics Tools) are not installed on this machine. - Release: `ctest --test-dir out/build/release -R "native_permlane|native_dpp|native_lane|native_direct_container"`, 9 of 9 passed. - Debug: `cmake --preset dev`, `cmake --build --preset dev --target compile_dxil native_store_replay`, then `ctest --preset dev --no-tests=error -R '^native_permlane_(controls|hardware)$'`. Both passed. 3. **Doc base:** the note now gives both bases. The tests ran on `main` `6057071b` plus this branch. The 2,689-request count comes from `cpp-migration` `999e17cd` plus #3010. Smaller points: - **Same literal in S1 and S2:** now accepted. The "two literals" control became a compiled and read-back case, `cross-shared-literal`. Its words are `0xD7780001 0x03FDFF02 0x492F0381`, with eight different selectors, the same for row lanes 0-7 and 8-15. A literal in S0 is still refused, and the message now says exactly that: "permlane S0 cannot be a literal". - **Modifier refusal:** a clamp control (`0xD7788001 0x00341902`) now pins it. Removing `i.clamp` from that check fails `native_permlane_controls`. - **`vcc_hi`:** the note now says that selectors refuse `vcc_lo`, and `vcc_hi` on the wave64 path. In wave32, `vcc_hi` is ordinary scalar data. - **The `i.src[0] == 255` clause:** I kept it as the decoder-level refusal for a literal S0. AI-assisted.
pigalot commented 2026-11-27 22:29:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:29:35Z.

Review: APPROVED


I reviewed b912ad58 merged over main f6206217. The merge is clean (tree 03bd58f5) and git diff --cached --check is clean.

What I traced.

  • Against the RDNA2 definition:

    • the selector for row lane L is nibble L & 7 of S1 for lanes 0..7 and of S2 for lanes 8..15;
    • v_permlane16_b32 reads lane row_base | sel of the current row;
    • v_permlanex16_b32 flips row bit 4, so each row reads the other row of its pair.
  • op_sel: bit 0 is FI and bit 1 is BOUND_CTRL. Without FI, an inactive source lane gives 0 under BOUND_CTRL and keeps D otherwise. Guest EXEC still predicates the write.

  • Refusals: S0 must be a VGPR, and a literal S0 is refused in the decoder. Modifiers and the other op_sel bits are refused.

  • Earlier requests: R0Y00's rebuild from main and the base change are done. JohnConnorNPC's points are each answered at this head:

    • the doc bases are corrected;
    • a shared S1/S2 literal is accepted, with a read-back case;
    • a clamp control is added;
    • the vcc_hi wording is fixed.

    The split-wave64 readback is deferred to #3006, as the maintainer asked.

What I ran. I built compile_dxil native_store_replay native_compute_ir_dump offscreen_check in dev and release, then ran

python .agentic\scripts\with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(native_permlane_(controls|hardware)|native_dpp[a-z0-9_]*_hardware|native_direct_container|native_lane[a-z0-9_]*)$'
  • Results: 8 of 9 pass in Debug and Release /O2. native_lane_spill_descriptor_warp reports a 77 skip in both builds; it is an existing WARP test that this PR doesn't touch.
  • Hardware coverage: native_permlane_hardware matched 128 results and all guards in each of its seven cases, including cross-shared-literal.
  • Negative control: on main d6912f58, the PR's native_permlane_check.py fails in both modes. controls gets requests=7 compiled=0 refused=7 ("direct DXIL lowering for v_permlanex16_b32"), and the hardware replay compile fails.

Mutants in src/gfx1013_direct_compute.inl. For each, I rebuilt in dev and ran native_permlane_(controls|hardware):

Mutant Result
x16 keeps its own row killed (cross-literal-bound word 8: 0x0 vs 0x25)
S1/S2 swapped killed (word 8: 0x2c vs 0x25)
BOUND_CTRL ignored killed (word 24: 0x21 vs 0x0)
FI ignored killed (cross-sgprs-fi word 24: 0x21 vs 0x15)
the destination lane's EXEC bit tested instead of the source's killed (word 24)
nibble index from lane bits 0..1 only killed (word 12)
modifier refusal removed killed (controls)
special-SGPR selector refusal reduced to "not a VGPR" survives

Restored and rebuilt afterwards; git diff --quiet is clean.

Non-blocking.

  • Selector refusal: the selector refusal is pinned only by the VGPR case (v2/v3/s13). No control uses vcc_lo, m0 or exec as a selector. The refusal is a scope limit, not a correctness need, since operand32 can read those numerically. One control row would pin it.
  • Wave64: the wave64 EXEC-half path is still unread, as you noted. #3006 is still open.
  • CI: the pr CI preset doesn't select native_permlane_*, so this run and yours are the Windows evidence at this head.

Verdict: approve on b912ad58.

Environment: NVIDIA GeForce RTX 5090 driver 610.88, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Windows SDK 10.0.28000.0 DXC, Python 3.12.10, wave32, debug layer off.
CI: Build and test on Windows passes on b912ad58.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093961362 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6093961362). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:29:35Z. **Review:** APPROVED --- I reviewed `b912ad58` merged over `main` `f6206217`. The merge is clean (tree `03bd58f5`) and `git diff --cached --check` is clean. **What I traced.** - **Against the RDNA2 definition:** - the selector for row lane `L` is nibble `L & 7` of S1 for lanes 0..7 and of S2 for lanes 8..15; - `v_permlane16_b32` reads lane `row_base | sel` of the current row; - `v_permlanex16_b32` flips row bit 4, so each row reads the other row of its pair. - **op_sel:** bit 0 is FI and bit 1 is BOUND_CTRL. Without FI, an inactive source lane gives 0 under BOUND_CTRL and keeps D otherwise. Guest EXEC still predicates the write. - **Refusals:** S0 must be a VGPR, and a literal S0 is refused in the decoder. Modifiers and the other op_sel bits are refused. - **Earlier requests:** R0Y00's rebuild from `main` and the base change are done. JohnConnorNPC's points are each answered at this head: - the doc bases are corrected; - a shared S1/S2 literal is accepted, with a read-back case; - a clamp control is added; - the `vcc_hi` wording is fixed. The split-wave64 readback is deferred to #3006, as the maintainer asked. **What I ran.** I built `compile_dxil native_store_replay native_compute_ir_dump offscreen_check` in `dev` and `release`, then ran ```powershell python .agentic\scripts\with_gpu_lock.py ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(native_permlane_(controls|hardware)|native_dpp[a-z0-9_]*_hardware|native_direct_container|native_lane[a-z0-9_]*)$' ``` - **Results:** 8 of 9 pass in Debug and Release `/O2`. `native_lane_spill_descriptor_warp` reports a 77 skip in both builds; it is an existing WARP test that this PR doesn't touch. - **Hardware coverage:** `native_permlane_hardware` matched 128 results and all guards in each of its seven cases, including `cross-shared-literal`. - **Negative control:** on `main` `d6912f58`, the PR's `native_permlane_check.py` fails in both modes. `controls` gets `requests=7 compiled=0 refused=7` ("direct DXIL lowering for v_permlanex16_b32"), and the `hardware` replay compile fails. **Mutants** in `src/gfx1013_direct_compute.inl`. For each, I rebuilt in `dev` and ran `native_permlane_(controls|hardware)`: | Mutant | Result | |---|---| | `x16` keeps its own row | killed (`cross-literal-bound` word 8: `0x0` vs `0x25`) | | S1/S2 swapped | killed (word 8: `0x2c` vs `0x25`) | | BOUND_CTRL ignored | killed (word 24: `0x21` vs `0x0`) | | FI ignored | killed (`cross-sgprs-fi` word 24: `0x21` vs `0x15`) | | the destination lane's EXEC bit tested instead of the source's | killed (word 24) | | nibble index from lane bits 0..1 only | killed (word 12) | | modifier refusal removed | killed (controls) | | special-SGPR selector refusal reduced to "not a VGPR" | survives | Restored and rebuilt afterwards; `git diff --quiet` is clean. **Non-blocking.** - **Selector refusal:** the selector refusal is pinned only by the VGPR case (`v2/v3/s13`). No control uses `vcc_lo`, `m0` or `exec` as a selector. The refusal is a scope limit, not a correctness need, since `operand32` can read those numerically. One control row would pin it. - **Wave64:** the wave64 EXEC-half path is still unread, as you noted. #3006 is still open. - **CI:** the `pr` CI preset doesn't select `native_permlane_*`, so this run and yours are the Windows evidence at this head. **Verdict:** approve on `b912ad58`. Environment: NVIDIA GeForce RTX 5090 driver 610.88, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Windows SDK 10.0.28000.0 DXC, Python 3.12.10, wave32, debug layer off. CI: `Build and test on Windows` passes on `b912ad58`. This reply was AI-assisted.
KelboLive commented 2026-11-28 19:09:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T19:09:19Z.

Review: COMMENTED


LGTM — approved, no blocking issues.

Lowers v_permlane16_b32 and v_permlanex16_b32 in direct compute. Permlane unpacks uniform selectors from S1/S2, picks from same row (x16) or paired row (x16_b32), handles FI/BOUND_CTRL correctly. DPP row ops added with correct lane shifting. Wave64 handled correctly with s126/s127 EXEC halves, physical lane indices correct. Inactive-source semantics match DPP rules. Test suite comprehensive with mutation coverage.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6099689730 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6099689730). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T19:09:19Z. **Review:** COMMENTED --- LGTM — approved, no blocking issues. Lowers `v_permlane16_b32` and `v_permlanex16_b32` in direct compute. Permlane unpacks uniform selectors from S1/S2, picks from same row (x16) or paired row (x16_b32), handles FI/BOUND_CTRL correctly. DPP row ops added with correct lane shifting. Wave64 handled correctly with s126/s127 EXEC halves, physical lane indices correct. Inactive-source semantics match DPP rules. Test suite comprehensive with mutation coverage.
KelboLive commented 2026-11-28 20:29:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:29:35Z.

Review: APPROVED


LGTM — approved, no blocking issues.

Lowers v_permlane16_b32 and v_permlanex16_b32 in direct compute. Permlane unpacks uniform selectors from S1/S2, picks from same row (x16) or paired row (x16_b32), handles FI/BOUND_CTRL correctly. DPP row ops added with correct lane shifting. Wave64 handled correctly with s126/s127 EXEC halves, physical lane indices correct. Inactive-source semantics match DPP rules. Test suite comprehensive with mutation coverage.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6099962622 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3022#pullrequestreview-6099962622). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T20:29:35Z. **Review:** APPROVED --- LGTM — approved, no blocking issues. Lowers `v_permlane16_b32` and `v_permlanex16_b32` in direct compute. Permlane unpacks uniform selectors from S1/S2, picks from same row (x16) or paired row (x16_b32), handles FI/BOUND_CTRL correctly. DPP row ops added with correct lane shifting. Wave64 handled correctly with s126/s127 EXEC halves, physical lane indices correct. Inactive-source semantics match DPP rules. Test suite comprehensive with mutation coverage.
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!3022
No description provided.