shader: lower v_readfirstlane_b32 in pixel_aot #759

Merged
Holastor merged 1 commit from upstream-pr/765 into main 2026-11-23 10:00:23 +00:00
Holastor commented 2026-11-23 01:40:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T01:40:21Z.


This PR lowers v_readfirstlane_b32 in tools/pixel_aot.py to HLSL SM 6.0 WaveReadLaneFirst(), corrects SGPR destination decoding in tools/disasm_rdna2.py, and registers scanner support in tools/scan_unsupported_shaders.py.

Background and Lowering

In RDNA 2 VOP1 encoding (Table 12.11), V_READFIRSTLANE_B32 copies the value of VGPR vSrc from the first active lane in the wavefront into SGPR sDst. Unlike other VOP1 operations that write VGPRs, v_readfirstlane_b32 targets an SGPR destination (0 <= dst <= 105).

  1. Disassembly fix: tools/disasm_rdna2.py previously decoded VOP1 destinations unconditionally as VGPRs (f"v{vdst}"). For v_readfirstlane_b32, dst_str is now decoded with decode_s_reg(vdst) (s0, s44, etc.) in both VOP1 and VOP3 paths.
  2. HLSL Lowering: Emits uint salu{i} = WaveReadLaneFirst({arg}); and immediately tracks scalar[dst] = ("uint", f"salu{i}"), allowing downstream consumption by SALU arithmetic, VALU operands, and constant-buffer offset indexing.
  3. Scanner Recognition: Added v_readfirstlane_b32 pattern to SUPPORTED_INSTRUCTIONS_REGEX.
  4. Draw Fixture & Controls: Added check_readfirstlane_draw verifying zero, normal, and high integer broadcast readbacks across 64 pixels, with oracle mismatch rejection. Added negative controls in tests/pixel_aot_check.py rejecting VGPR destinations, out-of-range SGPRs, invalid modifiers, unresolved scalar dependencies, and un-waited vector sample registers.

Test Commands and Results

python -B tests/pixel_aot_check.py
# Return code: 0

python -B tests/rdna2_tools_check.py
# Ran 57 tests in 1.128s, OK (skipped=1)

python -B tests/docs_links_check.py
# Checked 11 Markdown files and 137 links: Self-test passed.

python -B tests/bidi_controls_check.py
# Checked 618 tracked source, script and build/CI files: no bidirectional controls.

python -B tests/pso_readiness_check.py
# PSO census, evidence states, and native hash control passed

python -B tests/form_coverage_check.py
# form coverage checks passed

A passing fixture supports the behavior under test; full-game startup and title execution remain unverified.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6550526287 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-23T01:40:21Z. --- This PR lowers `v_readfirstlane_b32` in `tools/pixel_aot.py` to HLSL SM 6.0 `WaveReadLaneFirst()`, corrects SGPR destination decoding in `tools/disasm_rdna2.py`, and registers scanner support in `tools/scan_unsupported_shaders.py`. ### Background and Lowering In RDNA 2 VOP1 encoding (Table 12.11), `V_READFIRSTLANE_B32` copies the value of VGPR `vSrc` from the first active lane in the wavefront into SGPR `sDst`. Unlike other VOP1 operations that write VGPRs, `v_readfirstlane_b32` targets an SGPR destination (`0 <= dst <= 105`). 1. **Disassembly fix**: `tools/disasm_rdna2.py` previously decoded VOP1 destinations unconditionally as VGPRs (`f"v{vdst}"`). For `v_readfirstlane_b32`, `dst_str` is now decoded with `decode_s_reg(vdst)` (`s0`, `s44`, etc.) in both VOP1 and VOP3 paths. 2. **HLSL Lowering**: Emits `uint salu{i} = WaveReadLaneFirst({arg});` and immediately tracks `scalar[dst] = ("uint", f"salu{i}")`, allowing downstream consumption by SALU arithmetic, VALU operands, and constant-buffer offset indexing. 3. **Scanner Recognition**: Added `v_readfirstlane_b32` pattern to `SUPPORTED_INSTRUCTIONS_REGEX`. 4. **Draw Fixture & Controls**: Added `check_readfirstlane_draw` verifying zero, normal, and high integer broadcast readbacks across 64 pixels, with oracle mismatch rejection. Added negative controls in `tests/pixel_aot_check.py` rejecting VGPR destinations, out-of-range SGPRs, invalid modifiers, unresolved scalar dependencies, and un-waited vector sample registers. ### Test Commands and Results ```powershell python -B tests/pixel_aot_check.py # Return code: 0 python -B tests/rdna2_tools_check.py # Ran 57 tests in 1.128s, OK (skipped=1) python -B tests/docs_links_check.py # Checked 11 Markdown files and 137 links: Self-test passed. python -B tests/bidi_controls_check.py # Checked 618 tracked source, script and build/CI files: no bidirectional controls. python -B tests/pso_readiness_check.py # PSO census, evidence states, and native hash control passed python -B tests/form_coverage_check.py # form coverage checks passed ``` A passing fixture supports the behavior under test; full-game startup and title execution remain unverified.
upstream-sync closed this pull request 2026-11-24 06:44:41 +00:00
FZNull commented 2026-11-24 06:48:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by FZNull on 2026-11-23T02:11:32Z.


The SGPR destination part matches what I measured, but the VOP3 path needs a second look before this lands, given the guidance on #746.

What I measured (LLVM 21.1.8 llvm-mc with the AMDGPU target, -triple=amdgcn--amdpal -mcpu=gfx1013), because the in-tree CI job uses LLVM 15 so treat this as strong evidence that still wants a CI-side confirmation:

$ echo 'v_readfirstlane_b32 s2, v0' | llvm-mc -triple=amdgcn--amdpal -mcpu=gfx1013 -show-encoding
	v_readfirstlane_b32 s2, v0              ; encoding: [0x00,0x05,0x04,0x7e]

That is the VOP1 word from #746 and the assembler prints an SGPR destination, so the decode_s_reg(vdst) change in the VOP1 path (tools/disasm_rdna2.py:1237) is confirmed. An alignment control stream (v_readfirstlane_b32 s2, v0 / v_mov_b32_e32 v0, v1 / s_endpgm) round-trips at +0/+4/+8 without shifting the stream.

The VOP3 side:

$ echo 'v_readfirstlane_b32_e64 s2, v0' | llvm-mc ... -mcpu=gfx1013 -show-encoding
error: e64 variant of this instruction is not supported

$ printf '\x02\x00\x82\xd5\x00\x01\x00\x00' | llvm-mc ... -mcpu=gfx1013 -disassemble
warning: invalid instruction encoding

So on gfx1013 the operation exists only as the 32-bit VOP1, and the VOP3A word quoted in #746 (020082d500010000) is not a valid gfx1013 encoding — which means the VOP3 formatting change may be formatting an instruction that cannot occur, or an invalid word as if it were this operation.

The maintainer asked on #746: "Only change the VOP3A form if that target actually assembles the same operation there." Could you confirm the VOP3 case against the LLVM 15 gfx1013 job before merging it, or drop the VOP3 half and keep the VOP1 plus the lowering? I have a narrower branch with VOP1 only, the alignment control and a VOP3A-unchanged regression test (with the reason recorded) that I can push as the VOP1 part if that is easier.

Neither of us should guess here: if LLVM 15 disagrees with LLVM 21 about the VOP3 form, that is worth pinning in the test.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7089737562 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7089737562). Originally posted by [FZNull](https://github.com/FZNull) on 2026-11-23T02:11:32Z. --- The SGPR destination part matches what I measured, but the VOP3 path needs a second look before this lands, given the guidance on #746. **What I measured** (LLVM 21.1.8 `llvm-mc` with the AMDGPU target, `-triple=amdgcn--amdpal -mcpu=gfx1013`), because the in-tree CI job uses LLVM 15 so treat this as strong evidence that still wants a CI-side confirmation: ```text $ echo 'v_readfirstlane_b32 s2, v0' | llvm-mc -triple=amdgcn--amdpal -mcpu=gfx1013 -show-encoding v_readfirstlane_b32 s2, v0 ; encoding: [0x00,0x05,0x04,0x7e] ``` That is the VOP1 word from #746 and the assembler prints an **SGPR** destination, so the `decode_s_reg(vdst)` change in the VOP1 path (`tools/disasm_rdna2.py:1237`) is confirmed. An alignment control stream (`v_readfirstlane_b32 s2, v0` / `v_mov_b32_e32 v0, v1` / `s_endpgm`) round-trips at +0/+4/+8 without shifting the stream. **The VOP3 side:** ```text $ echo 'v_readfirstlane_b32_e64 s2, v0' | llvm-mc ... -mcpu=gfx1013 -show-encoding error: e64 variant of this instruction is not supported $ printf '\x02\x00\x82\xd5\x00\x01\x00\x00' | llvm-mc ... -mcpu=gfx1013 -disassemble warning: invalid instruction encoding ``` So on `gfx1013` the operation exists only as the 32-bit VOP1, and the VOP3A word quoted in #746 (`020082d500010000`) is not a valid gfx1013 encoding — which means the VOP3 formatting change may be formatting an instruction that cannot occur, or an invalid word as if it were this operation. The maintainer asked on #746: *"Only change the VOP3A form if that target actually assembles the same operation there."* Could you confirm the VOP3 case against the LLVM 15 `gfx1013` job before merging it, or drop the VOP3 half and keep the VOP1 plus the lowering? I have a narrower branch with VOP1 only, the alignment control and a VOP3A-unchanged regression test (with the reason recorded) that I can push as the VOP1 part if that is easier. Neither of us should guess here: if LLVM 15 disagrees with LLVM 21 about the VOP3 form, that is worth pinning in the test.
R0Y00 commented 2026-11-24 06:48:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T02:20:14Z.


LLVM 15 on gfx1013 confirmed the VOP1 SGPR destination and rejected the _e64 spelling and the proposed VOP3A bytes. Please keep the VOP1 fix and make the invalid VOP3A record consume exactly eight bytes without handing an instruction to the lowerer. Keep a following s_endpgm in both controls. For the lowering, please make the active-lane claim match the fixture: use divergent per-lane source values and an independently checked first participating lane, or keep it scoped to the uniform-source case. LLVM 15 result and byte stream

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7089856761 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7089856761). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T02:20:14Z. --- LLVM 15 on `gfx1013` confirmed the VOP1 SGPR destination and rejected the `_e64` spelling and the proposed VOP3A bytes. Please keep the VOP1 fix and make the invalid VOP3A record consume exactly eight bytes without handing an instruction to the lowerer. Keep a following `s_endpgm` in both controls. For the lowering, please make the active-lane claim match the fixture: use divergent per-lane source values and an independently checked first participating lane, or keep it scoped to the uniform-source case. [LLVM 15 result and byte stream](https://github.com/R0Y00/Xbox2Windows/issues/746#issuecomment-7089676568)
FZNull commented 2026-11-24 06:48:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by FZNull on 2026-11-23T02:38:00Z.


Opened #778 with exactly the disassembler half you described, so the VOP1 SGPR fix and the invalid-VOP3A handling are not blocked on the lowering discussion:

  • VOP1 destination through decode_s_reg(vdst);
  • the VOP3A word returns a distinct unsupported-encoding record, consumes exactly 8 bytes, and is not recognized or supported, so nothing reaches a lowerer;
  • both controls keep a following s_endpgm, and the VOP3A control shows it at +8;
  • no pixel_aot change.

@Holastor, if you would rather land this inside #765, take the branch (FZNull:fix/readfirstlane-sgpr, commit 5d3a859) and I will close #778. Otherwise #765 only needs the lowering half plus the active-lane fixture question you raised.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7090090880 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7090090880). Originally posted by [FZNull](https://github.com/FZNull) on 2026-11-23T02:38:00Z. --- Opened #778 with exactly the disassembler half you described, so the VOP1 SGPR fix and the invalid-VOP3A handling are not blocked on the lowering discussion: - VOP1 destination through `decode_s_reg(vdst)`; - the VOP3A word returns a distinct unsupported-encoding record, consumes exactly 8 bytes, and is not recognized or supported, so nothing reaches a lowerer; - both controls keep a following `s_endpgm`, and the VOP3A control shows it at +8; - no `pixel_aot` change. @Holastor, if you would rather land this inside #765, take the branch (`FZNull:fix/readfirstlane-sgpr`, commit `5d3a859`) and I will close #778. Otherwise #765 only needs the lowering half plus the active-lane fixture question you raised.
R0Y00 commented 2026-11-24 06:48:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T03:21:57Z.


#778 landed the destination fix, invalid VOP3A diagnostic and stream-alignment tests, and closed #746. Please update this PR against main and retain the pixel lowering and its fixture. The remaining review question is the participating-lane behavior in the lowered shader, as noted above.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7090683980 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7090683980). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T03:21:57Z. --- #778 landed the destination fix, invalid VOP3A diagnostic and stream-alignment tests, and closed #746. Please update this PR against main and retain the pixel lowering and its fixture. The remaining review question is the participating-lane behavior in the lowered shader, as noted above.
Holastor commented 2026-11-24 06:49:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T09:04:51Z.


Rebased against main (325fe1e) with clean checks:

  • Dropped the disassembler changes from this PR since #778 already landed the VOP1 SGPR destination decoding, invalid VOP3A diagnostic, and stream-alignment controls in main.
  • Retained the pixel lowering (tools/pixel_aot.py), scanner regex (tools/scan_unsupported_shaders.py), negative controls, and draw fixture (tests/pixel_aot_check.py).
  • Scoped the documentation in docs/experiments.md to the uniform-source case as requested (where participating lanes hold the same value, e.g. broadcast or scalarized from SGPRs/CBs), noting that divergent per-lane source readback and non-zero first participating lane behavior remain unmeasured.

Verification

python -B tests/pixel_aot_check.py
# Return code: 0

python -B tests/rdna2_tools_check.py
# Ran 66 tests in 1.168s, OK (skipped=1)

python -B tests/docs_links_check.py
# Checked 13 Markdown files and 158 links: Self-test passed.

python -B tests/bidi_controls_check.py
# Checked 675 tracked source, script and build/CI files: no bidirectional controls.

python -B tests/pso_readiness_check.py
# PSO census, evidence states, and native hash control passed

python -B tests/form_coverage_check.py
# form coverage checks passed
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7096192592 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7096192592). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-23T09:04:51Z. --- Rebased against `main` (`325fe1e`) with clean checks: - Dropped the disassembler changes from this PR since #778 already landed the VOP1 SGPR destination decoding, invalid VOP3A diagnostic, and stream-alignment controls in `main`. - Retained the pixel lowering (`tools/pixel_aot.py`), scanner regex (`tools/scan_unsupported_shaders.py`), negative controls, and draw fixture (`tests/pixel_aot_check.py`). - Scoped the documentation in `docs/experiments.md` to the uniform-source case as requested (where participating lanes hold the same value, e.g. broadcast or scalarized from SGPRs/CBs), noting that divergent per-lane source readback and non-zero first participating lane behavior remain unmeasured. ### Verification ```powershell python -B tests/pixel_aot_check.py # Return code: 0 python -B tests/rdna2_tools_check.py # Ran 66 tests in 1.168s, OK (skipped=1) python -B tests/docs_links_check.py # Checked 13 Markdown files and 158 links: Self-test passed. python -B tests/bidi_controls_check.py # Checked 675 tracked source, script and build/CI files: no bidirectional controls. python -B tests/pso_readiness_check.py # PSO census, evidence states, and native hash control passed python -B tests/form_coverage_check.py # form coverage checks passed ```
R0Y00 commented 2026-11-24 06:49:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T09:11:06Z.


Thanks for separating the changes already in #778. On 1bbc606 the docs describe a uniform-source experiment, but the lowerer still accepts a varying VGPR such as v8 and emits WaveReadLaneFirst for it. The uniform-source draw would also pass if the broadcast were replaced by a per-lane read. Please either enforce the initial uniform-source restriction (and add a varying-VGPR rejection), or add a draw with distinct participating lane values and a per-lane-read negative control. Keep the non-entry EXEC rejection in either case.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7096322931 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7096322931). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T09:11:06Z. --- Thanks for separating the changes already in #778. On `1bbc606` the docs describe a uniform-source experiment, but the lowerer still accepts a varying VGPR such as `v8` and emits `WaveReadLaneFirst` for it. The uniform-source draw would also pass if the broadcast were replaced by a per-lane read. Please either enforce the initial uniform-source restriction (and add a varying-VGPR rejection), or add a draw with distinct participating lane values and a per-lane-read negative control. Keep the non-entry EXEC rejection in either case.
Holastor commented 2026-11-24 06:49:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T09:30:32Z.


Updated in ee32146:

  1. Enforced uniform-source restriction:

    • tools/pixel_aot.py tracks uniform provenance across vector registers via VectorRegisters. A vector register is tracked as uniform when moved from an SGPR, constant buffer, immediate literal, or another uniform vector register (v_mov_b32 / v_swap_b32). Any other vector write marks the destination non-uniform.
    • v_readfirstlane_b32 explicitly rejects non-uniform vector sources (ValueError: v_readfirstlane_b32 requires a uniform source register: ...).
  2. Added varying-VGPR and EXEC rejection controls:

    • Added controls in tests/pixel_aot_check.py asserting rejection when reading varying interpolated coordinates (v8) or barycentric inputs (v0, v1).
    • Retained and verified non-entry EXEC rejection during whole-quad mode (s_wqm_b64).
    • Rejection controls for invalid modifiers, out-of-range registers, and pending loads now test with an established uniform register.
  3. Documentation:

    • Updated docs/experiments.md detailing the uniform-source enforcement and the rejection controls for varying vector registers and non-entry execution masks.

Verification

python -B tests/pixel_aot_check.py
# Return code: 0

python -B tests/rdna2_tools_check.py
# Ran 66 tests in 1.162s, OK (skipped=1)

python -B tests/docs_links_check.py
# Checked 13 Markdown files and 158 links: Self-test passed.

python -B tests/bidi_controls_check.py
# Checked 675 tracked source, script and build/CI files: no bidirectional controls.

python -B tests/pso_readiness_check.py
# PSO census, evidence states, and native hash control passed

python -B tests/form_coverage_check.py
# form coverage checks passed
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7096739702 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7096739702). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-23T09:30:32Z. --- Updated in `ee32146`: 1. **Enforced uniform-source restriction**: - `tools/pixel_aot.py` tracks uniform provenance across vector registers via `VectorRegisters`. A vector register is tracked as uniform when moved from an SGPR, constant buffer, immediate literal, or another uniform vector register (`v_mov_b32` / `v_swap_b32`). Any other vector write marks the destination non-uniform. - `v_readfirstlane_b32` explicitly rejects non-uniform vector sources (`ValueError: v_readfirstlane_b32 requires a uniform source register: ...`). 2. **Added varying-VGPR and EXEC rejection controls**: - Added controls in `tests/pixel_aot_check.py` asserting rejection when reading varying interpolated coordinates (`v8`) or barycentric inputs (`v0`, `v1`). - Retained and verified non-entry EXEC rejection during whole-quad mode (`s_wqm_b64`). - Rejection controls for invalid modifiers, out-of-range registers, and pending loads now test with an established uniform register. 3. **Documentation**: - Updated `docs/experiments.md` detailing the uniform-source enforcement and the rejection controls for varying vector registers and non-entry execution masks. ### Verification ```powershell python -B tests/pixel_aot_check.py # Return code: 0 python -B tests/rdna2_tools_check.py # Ran 66 tests in 1.162s, OK (skipped=1) python -B tests/docs_links_check.py # Checked 13 Markdown files and 158 links: Self-test passed. python -B tests/bidi_controls_check.py # Checked 675 tracked source, script and build/CI files: no bidirectional controls. python -B tests/pso_readiness_check.py # PSO census, evidence states, and native hash control passed python -B tests/form_coverage_check.py # form coverage checks passed ```
R0Y00 commented 2026-11-24 06:49:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T09:41:57Z.


ee32146 now rejects the varying source, which addresses the previous scope issue. One small provenance case remains: v_mov_b32 assigns vector[dst] before querying vector.is_uniform(src). If src == dst, __setitem__ has already cleared the tag. Please read the source tag before assignment and add a positive control for v_mov_b32_e32 v18, v18 between the uniform load and v_readfirstlane_b32. Retain the varying-source rejection.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7096984783 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7096984783). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T09:41:57Z. --- `ee32146` now rejects the varying source, which addresses the previous scope issue. One small provenance case remains: `v_mov_b32` assigns `vector[dst]` before querying `vector.is_uniform(src)`. If `src == dst`, `__setitem__` has already cleared the tag. Please read the source tag before assignment and add a positive control for `v_mov_b32_e32 v18, v18` between the uniform load and `v_readfirstlane_b32`. Retain the varying-source rejection.
Holastor commented 2026-11-24 06:49:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T09:50:30Z.


Updated in bb578b1:

  1. Source tag checked before assignment:

    • In tools/pixel_aot.py, v_mov_b32 now queries the source uniform status (src.startswith("s") or bool(re.fullmatch(...)) or vector.is_uniform(src)) before assigning vector[dst] = f"alu{i}". This ensures that in a self-move (src == dst), __setitem__ clearing dst does not clobber the uniform tag before it is checked, preserving the uniform provenance of the register.
  2. Added positive and negative self-move controls:

    • In tests/pixel_aot_check.py:
      • Added a positive control in check_readfirstlane_controls() testing v_mov_b32_e32 v18, v18 between the uniform constant load (v_mov_b32_e32 v18, s44) and v_readfirstlane_b32 s48, v18, asserting that WaveReadLaneFirst is emitted and the shader lowers successfully.
      • Added a negative control asserting that self-moving a varying register (v_mov_b32_e32 v8, v8) followed by v_readfirstlane_b32 s48, v8 remains rejected (must_reject).
      • Retained all existing varying-source rejections (v8, v0, v1).
  3. Documentation:

    • Updated docs/experiments.md noting uniform self-move provenance retention.

Verification

python -B tests/pixel_aot_check.py
# Return code: 0

python -B tests/rdna2_tools_check.py
# Ran 66 tests in 1.167s, OK (skipped=1)

python -B tests/docs_links_check.py
# Checked 13 Markdown files and 158 links: Self-test passed.

python -B tests/bidi_controls_check.py
# Checked 675 tracked source, script and build/CI files: no bidirectional controls.

python -B tests/pso_readiness_check.py
# PSO census, evidence states, and native hash control passed

python -B tests/form_coverage_check.py
# form coverage checks passed
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7097160733 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/765#issuecomment-7097160733). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-23T09:50:30Z. --- Updated in `bb578b1`: 1. **Source tag checked before assignment**: - In `tools/pixel_aot.py`, `v_mov_b32` now queries the source uniform status (`src.startswith("s") or bool(re.fullmatch(...)) or vector.is_uniform(src)`) *before* assigning `vector[dst] = f"alu{i}"`. This ensures that in a self-move (`src == dst`), `__setitem__` clearing `dst` does not clobber the uniform tag before it is checked, preserving the uniform provenance of the register. 2. **Added positive and negative self-move controls**: - In `tests/pixel_aot_check.py`: - Added a positive control in `check_readfirstlane_controls()` testing `v_mov_b32_e32 v18, v18` between the uniform constant load (`v_mov_b32_e32 v18, s44`) and `v_readfirstlane_b32 s48, v18`, asserting that `WaveReadLaneFirst` is emitted and the shader lowers successfully. - Added a negative control asserting that self-moving a varying register (`v_mov_b32_e32 v8, v8`) followed by `v_readfirstlane_b32 s48, v8` remains rejected (`must_reject`). - Retained all existing varying-source rejections (`v8`, `v0`, `v1`). 3. **Documentation**: - Updated `docs/experiments.md` noting uniform self-move provenance retention. ### Verification ```powershell python -B tests/pixel_aot_check.py # Return code: 0 python -B tests/rdna2_tools_check.py # Ran 66 tests in 1.167s, OK (skipped=1) python -B tests/docs_links_check.py # Checked 13 Markdown files and 158 links: Self-test passed. python -B tests/bidi_controls_check.py # Checked 675 tracked source, script and build/CI files: no bidirectional controls. python -B tests/pso_readiness_check.py # PSO census, evidence states, and native hash control passed python -B tests/form_coverage_check.py # form coverage checks passed ```
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!759
No description provided.