direct compute: carry descriptor spills through v_writelane_b32 / v_readlane_b32 #3150

Closed
opened 2026-11-27 18:31:38 +00:00 by Leyukaka · 0 comments
Leyukaka commented 2026-11-27 18:31:38 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T18:31:38Z.


Next instruction-coverage item, following #2940 (numeric SGPR spills through v_writelane_b32 / v_readlane_b32 in the direct compute path, #2950). I am taking it: descriptor spills through VGPR lanes.

Gap. The direct path refuses v_writelane_b32 when its scalar source is not numeric, with "unbound numeric SGPR sN". #2759 handles the same pattern in the Python compute translator.

Measured on a local capture of 2,689 compute requests (counts and instruction shape only), with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests on main 80668b97:

  • 41 requests stop first at a v_writelane_b32 with that refusal, 34 of them wave32.
  • In 35 of them, the spilled SGPR was last written by s_load_dwordx4, a buffer descriptor. In 5 it was last written by s_mov_b32, and in 1 it is an entry SGPR.
  • All 41 read the spilled value back later with v_readlane_b32, from the same VGPR and the same constant lane.

Plan:

  • Track a non-numeric scalar symbol (descriptor dword, table or root address) through v_writelane_b32 to a constant lane of a VGPR, and back through v_readlane_b32 of the same constant lane.
  • The state is per VGPR and lane, and a control-flow join with differing symbols makes it unbound, as for SGPRs.
  • A v_writelane_b32 to another constant lane keeps the other lanes' symbols, and a write to the same lane replaces it. A v_writelane_b32 with an SGPR lane index, or any other write to that VGPR, clears them all.
  • A symbolic lane read through an SGPR lane index, or by any other VGPR read, stays refused.
  • No DXIL is emitted for a symbolic spill or refill: the symbol moves at compile time only.

Tests: a hardware readback where a buffer descriptor is spilled to lanes 0..3 of a VGPR, numeric values are spilled to other lanes, then both are read back and the descriptor is used for a load, against a CPU reference.

Refused controls:

  • a VGPR lane index;
  • a spilled lane overwritten by a VALU write;
  • a join with a different descriptor in the same lane.

Mutants: refilling the wrong lane, and not clearing on a VALU write.

Measurement: the census and the run's requests, before and after, with the next refusal of the requests that move. The 6 spills that are not descriptor loads may not move.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6652444136 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3150). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T18:31:38Z. --- Next instruction-coverage item, following #2940 (numeric SGPR spills through `v_writelane_b32` / `v_readlane_b32` in the direct compute path, #2950). I am taking it: **descriptor spills through VGPR lanes**. **Gap.** The direct path refuses `v_writelane_b32` when its scalar source is not numeric, with "unbound numeric SGPR sN". #2759 handles the same pattern in the Python compute translator. **Measured** on a local capture of 2,689 compute requests (counts and instruction shape only), with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests` on `main` `80668b97`: - 41 requests stop first at a `v_writelane_b32` with that refusal, 34 of them wave32. - In 35 of them, the spilled SGPR was last written by `s_load_dwordx4`, a buffer descriptor. In 5 it was last written by `s_mov_b32`, and in 1 it is an entry SGPR. - All 41 read the spilled value back later with `v_readlane_b32`, from the same VGPR and the same constant lane. **Plan:** - Track a non-numeric scalar symbol (descriptor dword, table or root address) through `v_writelane_b32` to a constant lane of a VGPR, and back through `v_readlane_b32` of the same constant lane. - The state is per VGPR and lane, and a control-flow join with differing symbols makes it unbound, as for SGPRs. - A `v_writelane_b32` to another constant lane keeps the other lanes' symbols, and a write to the same lane replaces it. A `v_writelane_b32` with an SGPR lane index, or any other write to that VGPR, clears them all. - A symbolic lane read through an SGPR lane index, or by any other VGPR read, stays refused. - No DXIL is emitted for a symbolic spill or refill: the symbol moves at compile time only. **Tests:** a hardware readback where a buffer descriptor is spilled to lanes 0..3 of a VGPR, numeric values are spilled to other lanes, then both are read back and the descriptor is used for a load, against a CPU reference. Refused controls: - a VGPR lane index; - a spilled lane overwritten by a VALU write; - a join with a different descriptor in the same lane. Mutants: refilling the wrong lane, and not clearing on a VALU write. **Measurement:** the census and the run's requests, before and after, with the next refusal of the requests that move. The 6 spills that are not descriptor loads may not move. 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#3150
No description provided.