Skip to content

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

Done

Description

@Leyukaka

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.

Activity

  1. added a commit that references this issue on Nov 27, 2026
    9a8c347
  2. added a commit that references this issue on Nov 27, 2026
    c45bf9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions