startup: gfx2hlsl refusals across an offline shader archive census (846 of 1,171 pairs are NGG vertex programs) #1716

Open
opened 2026-11-24 17:49:44 +00:00 by NiiRoZz · 54 comments
NiiRoZz commented 2026-11-24 17:49:44 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T17:49:44Z.


Found while translating every pixel/vertex program pair that an offline pass could carve from a package shader archive, not only the pipelines a startup run happens to create. The census below is what tools/startup/gfx2hlsl.py --pending refuses on that population.

Population

  • 1,171 adjacent pixel → vertex program pairs carved from the archive's zlib streams, each written once per recorded root signature (3), so 3,513 requests.
  • 132 requests translated and compiled with FXC; 3,381 were refused.
  • Counts below are distinct program pairs per refusal. A pair can be refused for a different reason under each root signature, so the column sums to more than 1,171.

Refusals

Pairs Refusal Existing work
846 ds_write_b32 (NGG vertex programs, see below) none for gfx2hlsl; #1541 / #1566 cover compute LDS only
215 s_load through sN holding None none found
136 s_load through sN holding ('ptrhi', ('root', N)) none found
118 descriptor operand s[N:N] holds None none found
59 v_lshrrev_b64 lowered in pixel_aot (#964), not in gfx2hlsl; #1703 tests only the 32-bit shifts
9 v_cvt_f32_i32 with ['mul:2'] #1705 / #1707
3 operand 'off' #1674 / #1676
2 numeric use of sN holding descnum none found
2 v_swap_b32 lowered in pixel_aot (#771)
1 each image_gather4_lz, s_bfm_b64, buffer_load_format_x, buffer format BUF_FMT_2_10_10_10_UNORM, buffer format BUF_FMT_8_8_8_8_UINT, buffer format BUF_FMT_16_16_SNORM, operand '|vN|', s_load through sN holding ('ud', N), v_cmp_class_f16, export target mrtz, numeric use of sN holding ptr s_bfm_b32 and v_cmp_class_f16 are lowered in pixel_aot (#601, #612)

The largest group: NGG vertex programs

Every ds_write_b32 refusal is in a vertex program (2,538 of 2,538 refused requests), and every one of those programs has the same shape:

  • s_sendmsg 0x9 (GS_ALLOC_REQ) once;
  • exp target_20 (primitive export) and exp pos0, plus param0… exports;
  • LDS traffic between barriers: 7,617 ds_write_b32 and 7,617 ds_read_b32, 12,693 s_barrier, and a few ds_read_b64, ds_read2_b32, ds_write_b128, ds_write2_b32, ds_write2st64_b32, ds_write2_b64.

That is the RDNA 2 NGG (primitive shader) form: the wave allocates vertex and primitive export space, exchanges per-vertex values through LDS and exports the primitive itself. A desktop vertex shader has no LDS, no barrier and no primitive export, so this cannot be lowered instruction by instruction. Options to evaluate:

  1. Recognise the common NGG pass-through pattern (the LDS round trip only moves a lane's own vertex values and the primitive export is the identity triangle list) and drop it, keeping the pos/param exports.
  2. Lower NGG programs to a mesh shader, where group-shared memory, barriers and primitive output exist (SetMeshOutputCounts for the GS_ALLOC_REQ counts).

Done when

  • The NGG group has a decided lowering, with a source-built fixture assembled from documented encodings (not archive bytes) and a negative control, split into its own issue if it is larger than one PR.
  • Each "none found" row above has an issue or is explained (for the three provenance refusals: which loads the tracker cannot resolve, and whether a root-constant pointer high word can be resolved from the root signature).
  • The rows already lowered in pixel_aot are either shared with gfx2hlsl or have a reason to stay separate.

Not in this issue: pipelines whose programs are DXBC containers in the executable, and pairings that are not adjacent in the archive.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6587984489 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-24T17:49:44Z. --- Found while translating every pixel/vertex program pair that an offline pass could carve from a package shader archive, not only the pipelines a startup run happens to create. The census below is what `tools/startup/gfx2hlsl.py --pending` refuses on that population. ## Population - 1,171 adjacent pixel → vertex program pairs carved from the archive's zlib streams, each written once per recorded root signature (3), so 3,513 requests. - 132 requests translated and compiled with FXC; 3,381 were refused. - Counts below are **distinct program pairs** per refusal. A pair can be refused for a different reason under each root signature, so the column sums to more than 1,171. ## Refusals | Pairs | Refusal | Existing work | |---:|---|---| | 846 | `ds_write_b32` (NGG vertex programs, see below) | none for `gfx2hlsl`; #1541 / #1566 cover compute LDS only | | 215 | `s_load through sN holding None` | none found | | 136 | `s_load through sN holding ('ptrhi', ('root', N))` | none found | | 118 | `descriptor operand s[N:N] holds None` | none found | | 59 | `v_lshrrev_b64` | lowered in `pixel_aot` (#964), not in `gfx2hlsl`; #1703 tests only the 32-bit shifts | | 9 | `v_cvt_f32_i32 with ['mul:2']` | #1705 / #1707 | | 3 | `operand 'off'` | #1674 / #1676 | | 2 | `numeric use of sN holding descnum` | none found | | 2 | `v_swap_b32` | lowered in `pixel_aot` (#771) | | 1 each | `image_gather4_lz`, `s_bfm_b64`, `buffer_load_format_x`, `buffer format BUF_FMT_2_10_10_10_UNORM`, `buffer format BUF_FMT_8_8_8_8_UINT`, `buffer format BUF_FMT_16_16_SNORM`, `operand '\|vN\|'`, `s_load through sN holding ('ud', N)`, `v_cmp_class_f16`, `export target mrtz`, `numeric use of sN holding ptr` | `s_bfm_b32` and `v_cmp_class_f16` are lowered in `pixel_aot` (#601, #612) | ## The largest group: NGG vertex programs Every `ds_write_b32` refusal is in a vertex program (2,538 of 2,538 refused requests), and every one of those programs has the same shape: - `s_sendmsg 0x9` (`GS_ALLOC_REQ`) once; - `exp target_20` (primitive export) and `exp pos0`, plus `param0`… exports; - LDS traffic between barriers: 7,617 `ds_write_b32` and 7,617 `ds_read_b32`, 12,693 `s_barrier`, and a few `ds_read_b64`, `ds_read2_b32`, `ds_write_b128`, `ds_write2_b32`, `ds_write2st64_b32`, `ds_write2_b64`. That is the RDNA 2 NGG (primitive shader) form: the wave allocates vertex and primitive export space, exchanges per-vertex values through LDS and exports the primitive itself. A desktop vertex shader has no LDS, no barrier and no primitive export, so this cannot be lowered instruction by instruction. Options to evaluate: 1. Recognise the common NGG pass-through pattern (the LDS round trip only moves a lane's own vertex values and the primitive export is the identity triangle list) and drop it, keeping the `pos`/`param` exports. 2. Lower NGG programs to a mesh shader, where group-shared memory, barriers and primitive output exist (`SetMeshOutputCounts` for the `GS_ALLOC_REQ` counts). ## Done when - The NGG group has a decided lowering, with a source-built fixture assembled from documented encodings (not archive bytes) and a negative control, split into its own issue if it is larger than one PR. - Each "none found" row above has an issue or is explained (for the three provenance refusals: which loads the tracker cannot resolve, and whether a root-constant pointer high word can be resolved from the root signature). - The rows already lowered in `pixel_aot` are either shared with `gfx2hlsl` or have a reason to stay separate. Not in this issue: pipelines whose programs are DXBC containers in the executable, and pairings that are not adjacent in the archive. AI-assisted (Claude Code).
NiiRoZz commented 2026-11-24 18:03:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T17:55:33Z.


Correction: per-pair recount

The table above counts refusals per request, and every pair was written once per recorded root signature (3). A pair bound with a root signature it does not use can be refused for that reason alone, so the per-request counts mix translator gaps with combinations the title never creates. Recounted per pair:

  • 1,171 pairs; 104 translate under at least one root signature (27 under more than one).
  • Refused under all three root signatures with the same reason (translator gaps, independent of the root):
Pairs Refusal
846 ds_write_b32 (NGG vertex programs, unchanged)
56 v_lshrrev_b64
9 v_cvt_f32_i32 with ['mul:2'] (#1705 / #1707)
2 operand 'off' (#1674 / #1676)
1 each image_gather4_lz, s_bfm_b64, operand '|vN|'
  • Refusal varies with the root signature (no root translates them, but the reason depends on the root): s_load through sN holding None (138 pairs), s_load through sN holding ('ptrhi', ('root', N)) (136), descriptor operand s[N:N] holds None (15), and single pairs for v_swap_b32, v_cmp_class_f16, buffer_load_format_x, three buffer formats, export target mrtz and the numeric use refusals. Because these depend on which root is supplied, the provenance rows are most likely root mismatches, not tracker gaps. They should be re-measured with the root each pipeline actually uses before they are treated as translator work.

The NGG group and the root-independent rows stand. The "Done when" item about the three provenance refusals becomes: measure them per pipeline with its own root signature first.

Reproduction: the offline request writer and the parallel --pending scan used for this census are in the pull requests linked from this issue.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7139902625 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7139902625). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-24T17:55:33Z. --- ## Correction: per-pair recount The table above counts refusals per request, and every pair was written once per recorded root signature (3). A pair bound with a root signature it does not use can be refused for that reason alone, so the per-request counts mix translator gaps with combinations the title never creates. Recounted per pair: - 1,171 pairs; **104** translate under at least one root signature (27 under more than one). - **Refused under all three root signatures with the same reason** (translator gaps, independent of the root): | Pairs | Refusal | |---:|---| | 846 | `ds_write_b32` (NGG vertex programs, unchanged) | | 56 | `v_lshrrev_b64` | | 9 | `v_cvt_f32_i32 with ['mul:2']` (#1705 / #1707) | | 2 | `operand 'off'` (#1674 / #1676) | | 1 each | `image_gather4_lz`, `s_bfm_b64`, `operand '\|vN\|'` | - **Refusal varies with the root signature** (no root translates them, but the reason depends on the root): `s_load through sN holding None` (138 pairs), `s_load through sN holding ('ptrhi', ('root', N))` (136), `descriptor operand s[N:N] holds None` (15), and single pairs for `v_swap_b32`, `v_cmp_class_f16`, `buffer_load_format_x`, three buffer formats, `export target mrtz` and the `numeric use` refusals. Because these depend on which root is supplied, the provenance rows are most likely root mismatches, not tracker gaps. They should be re-measured with the root each pipeline actually uses before they are treated as translator work. The NGG group and the root-independent rows stand. The "Done when" item about the three provenance refusals becomes: measure them per pipeline with its own root signature first. Reproduction: the offline request writer and the parallel `--pending` scan used for this census are in the pull requests linked from this issue. AI-assisted (Claude Code).
R0Y00 commented 2026-11-24 19:01:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T18:04:18Z.


Use the corrected per-pair census. Please measure the descriptor/provenance refusals again with each pipeline's observed root signature before assigning them as translator bugs. For NGG, the LDS/barrier/primitive-export pattern is a classification, not proof it is an identity pass-through. A useful first slice would be a source-built identity triangle and a contrasting case with a cross-lane dependency or non-identity primitive, comparing positions, parameters and primitive indices. Keep production lowering open until those cases separate cleanly. Smaller root-independent instruction gaps can proceed separately.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7140113918 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7140113918). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T18:04:18Z. --- Use the corrected per-pair census. Please measure the descriptor/provenance refusals again with each pipeline's observed root signature before assigning them as translator bugs. For NGG, the LDS/barrier/primitive-export pattern is a classification, not proof it is an identity pass-through. A useful first slice would be a source-built identity triangle and a contrasting case with a cross-lane dependency or non-identity primitive, comparing positions, parameters and primitive indices. Keep production lowering open until those cases separate cleanly. Smaller root-independent instruction gaps can proceed separately.
NiiRoZz commented 2026-11-24 19:01:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T18:41:37Z.


Agreed on all points. The plan:

  1. Provenance refusals. I'll re-measure the s_load … holding None, ptrhi and descriptor operand groups per pipeline with the root signature that pipeline was observed with, from run captures. I won't treat them as translator gaps until then. The offline request writer (#1750) currently writes each pair once per recorded root, which is exactly the confound you point out.
  2. NGG, first slice. A source-built pair, compared on positions, parameters and primitive indices, with production lowering held back until the two cases separate cleanly:
    • an identity NGG vertex program: own-lane LDS round trip, identity triangle-list primitive export;
    • a contrasting program with a cross-lane LDS dependency or a non-identity primitive.
  3. Root-independent gaps go in separate PRs: v_lshrrev_b64 (56 pairs), the image_gather4_lz, s_bfm_b64 and |vN| singletons. v_cvt_f32_i32 mul:2 and operand 'off' stay with #1707 and #1676.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141013105 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7141013105). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-24T18:41:37Z. --- Agreed on all points. The plan: 1. **Provenance refusals.** I'll re-measure the `s_load … holding None`, `ptrhi` and `descriptor operand` groups per pipeline with the root signature that pipeline was observed with, from run captures. I won't treat them as translator gaps until then. The offline request writer (#1750) currently writes each pair once per recorded root, which is exactly the confound you point out. 2. **NGG, first slice.** A source-built pair, compared on positions, parameters and primitive indices, with production lowering held back until the two cases separate cleanly: - an identity NGG vertex program: own-lane LDS round trip, identity triangle-list primitive export; - a contrasting program with a cross-lane LDS dependency or a non-identity primitive. 3. **Root-independent gaps** go in separate PRs: `v_lshrrev_b64` (56 pairs), the `image_gather4_lz`, `s_bfm_b64` and `|vN|` singletons. `v_cvt_f32_i32 mul:2` and `operand 'off'` stay with #1707 and #1676. AI-assisted (Claude Code).
NiiRoZz commented 2026-11-24 19:01:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T18:45:14Z.


Results for items 1 to 3 of the plan above, re-measured pair by pair on main at 67319a17 (all 1,171 pairs under every recorded root; nothing from an older translator commit is mixed in).

1. Per pair. 1,171 pairs are 964 distinct code pairs (they differ only in the program header). 104 translate and compile under the census's three roots, as before. 846 have an NGG vertex program, classified from the instruction stream rather than from the first refusal.

2. Provenance refusals with observed root signatures.

  • 140 non-NGG pairs refuse only for provenance reasons under all three census roots.
  • 7 of those have a root observed in a startup run: 2 translate, 5 refuse for ordinary instruction reasons. No provenance refusal survives its own observed root among census pairs.
  • Across 59 pipelines observed in startup runs (distinct code pair and root), exactly one provenance refusal survives: an s_load with a register offset through the resource heap. That one is a real tracker gap.
  • The other 133 provenance pairs have no observed root. They are unknown, not translator bugs.

3. NGG, classification only. 602 distinct programs, 324 distinct LDS/barrier/message/primitive-export shapes. In a linear slice of each program: the primitive payload depends on loaded memory in 602 of 602, LDS addresses are lane-invariant in 602 of 602, and 31 pairs also use readlane/writelane/permlane. None fits "own-lane values plus identity primitive". This comes from slices that ignore branches (one program read by hand), so culling, compaction and primitive count versus allocation are still open. Proposed first slice, as specified in the comment above:

  • Identity: one wave, three lanes; GS_ALLOC_REQ with constant counts; each lane exports a position and one parameter computed from its own lane index; lane 0 exports the primitive (0, 1, 2); optional LDS write and read-back at a lane-dependent address.
  • Contrast, one change each: (i) lane 0 writes a lane-invariant LDS address, a barrier, then every lane adds that value to its parameter; (ii) the primitive is (2, 1, 0) or loaded from memory; (iii) two primitives allocated, one exported as null.
  • Compared: positions, parameters, primitive indices, winding and count. The classes separate cleanly if the identity case is identical under pass-through and per-lane lowering and every contrast case differs in exactly the field its change predicts.

4. Root-independent instruction gaps, with ownership checked today. For rows with an open PR, that PR's head was run on the affected pairs: it removes its own refusal everywhere, but most pairs then stop at the next gap.

Pairs Gap Existing work
88 v_lshrrev_b64 #1783 — 1 pair then translates; 84 stop next at buffer_store_dwordx3
84 buffer_store_dwordx3 (behind the row above) none found
38 v_readfirstlane_b32 without a proven uniform source none (#1780 pins the refusal)
8 s_bfm_b64 planned in the comment above
7 v_subrev_f32_dpp none found
6 v_cndmask with NEG on an immediate none (new refusal since #1710)
5 v_mul_hi_u32 #1747
5 export pos1 none found
3 BUF_FMT_16_16_16_16_FLOAT #1699
2 1D image sample #1722

The v_cvt_f32_i32 mul:2 row is fixed by merged #1707. A tail of one to four pairs each remains (class compares, bit tests, a few buffer formats and export targets). The translator stops at the first refusal, so gaps behind it are undercounted.

Not in the original census: translations that compile but cannot draw correctly.

  • A vertex program that begins with a call into a separate vertex-fetch routine: the call is dropped and the fetched registers stay zero, so the draw is degenerate. Seen in one pipeline of a startup run; never in archive-stream programs. A fix with a source-built fixture is in review locally.
  • A pixel program reading the packed pixel position gets zero: 10 census pairs and one observed pipeline.
  • a16 image addressing is ignored by image_load/image_sample: 3 translating pairs.
  • Instance ID is not modelled: no translating pair reads it yet.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141103403 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7141103403). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-24T18:45:14Z. --- Results for items 1 to 3 of the plan above, re-measured pair by pair on `main` at `67319a17` (all 1,171 pairs under every recorded root; nothing from an older translator commit is mixed in). **1. Per pair.** 1,171 pairs are 964 distinct code pairs (they differ only in the program header). 104 translate and compile under the census's three roots, as before. 846 have an NGG vertex program, classified from the instruction stream rather than from the first refusal. **2. Provenance refusals with observed root signatures.** - 140 non-NGG pairs refuse only for provenance reasons under all three census roots. - 7 of those have a root observed in a startup run: 2 translate, 5 refuse for ordinary instruction reasons. **No provenance refusal survives its own observed root** among census pairs. - Across 59 pipelines observed in startup runs (distinct code pair and root), exactly one provenance refusal survives: an `s_load` with a register offset through the resource heap. That one is a real tracker gap. - The other 133 provenance pairs have no observed root. They are unknown, not translator bugs. **3. NGG, classification only.** 602 distinct programs, 324 distinct LDS/barrier/message/primitive-export shapes. In a linear slice of each program: the primitive payload depends on loaded memory in 602 of 602, LDS addresses are lane-invariant in 602 of 602, and 31 pairs also use readlane/writelane/permlane. **None fits "own-lane values plus identity primitive".** This comes from slices that ignore branches (one program read by hand), so culling, compaction and primitive count versus allocation are still open. Proposed first slice, as specified in the comment above: - *Identity:* one wave, three lanes; `GS_ALLOC_REQ` with constant counts; each lane exports a position and one parameter computed from its own lane index; lane 0 exports the primitive (0, 1, 2); optional LDS write and read-back at a lane-dependent address. - *Contrast, one change each:* (i) lane 0 writes a lane-invariant LDS address, a barrier, then every lane adds that value to its parameter; (ii) the primitive is (2, 1, 0) or loaded from memory; (iii) two primitives allocated, one exported as null. - *Compared:* positions, parameters, primitive indices, winding and count. The classes separate cleanly if the identity case is identical under pass-through and per-lane lowering and every contrast case differs in exactly the field its change predicts. **4. Root-independent instruction gaps**, with ownership checked today. For rows with an open PR, that PR's head was run on the affected pairs: it removes its own refusal everywhere, but most pairs then stop at the next gap. | Pairs | Gap | Existing work | |---:|---|---| | 88 | `v_lshrrev_b64` | #1783 — 1 pair then translates; 84 stop next at `buffer_store_dwordx3` | | 84 | `buffer_store_dwordx3` (behind the row above) | none found | | 38 | `v_readfirstlane_b32` without a proven uniform source | none (#1780 pins the refusal) | | 8 | `s_bfm_b64` | planned in the comment above | | 7 | `v_subrev_f32_dpp` | none found | | 6 | `v_cndmask` with NEG on an immediate | none (new refusal since #1710) | | 5 | `v_mul_hi_u32` | #1747 | | 5 | export `pos1` | none found | | 3 | `BUF_FMT_16_16_16_16_FLOAT` | #1699 | | 2 | 1D image sample | #1722 | The `v_cvt_f32_i32 mul:2` row is fixed by merged #1707. A tail of one to four pairs each remains (class compares, bit tests, a few buffer formats and export targets). The translator stops at the first refusal, so gaps behind it are undercounted. **Not in the original census: translations that compile but cannot draw correctly.** - A vertex program that begins with a call into a separate vertex-fetch routine: the call is dropped and the fetched registers stay zero, so the draw is degenerate. Seen in one pipeline of a startup run; never in archive-stream programs. A fix with a source-built fixture is in review locally. - A pixel program reading the packed pixel position gets zero: 10 census pairs and one observed pipeline. - `a16` image addressing is ignored by `image_load`/`image_sample`: 3 translating pairs. - Instance ID is not modelled: no translating pair reads it yet. AI-assisted (Claude Code).
Leyukaka commented 2026-11-24 22:01:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-24T21:40:17Z.


Claiming three of the root-independent rows from the table above.

1. v_readfirstlane_b32 without a proven uniform source, straight-line slice: #1931.

  • Today: only v_cvt_i32_f32 of a fixed buffer word marks a VGPR uniform.
  • The slice: propagates that mark through lane-pure VALU results (v_cvt_u32_f32, v_cvt_i32_f32, v_cvt_f32_ubyte0, v_mul_f32, v_fma_f32, v_fmaak_f32, v_rcp_f32, v_mov_b32). Every source must be a constant, user data, a fixed buffer word, a scalar value not derived from a lane mask, or an already-uniform VGPR.
  • Unchanged: the existing preconditions stay (no modifiers on the read, no branches, known exec, a single SGPR destination), and #1780's refusal cases keep refusing.

2. v_cndmask with NEG on an immediate: #1932.

  • What it does: the decoder computes the exact word from the encoding (the integer or float inline constant, or the literal dword, with bit 31 flipped). The handler gets an unambiguous hex literal instead of the ambiguous -1.
  • What stays: this lifts the refusal kept in #1710. Plain immediates keep their values, and ABS on an immediate stays refused.
  • Not measured: the flipped value is derived from the encoding, not measured on hardware.

3. buffer_store_dwordx3: design first.

gfx2hlsl has no store handler, and srv is the manifest's only resource-view line, so a store needs both halves. Whether the 84 pairs in the table use the form below is not measured yet. Proposed first slice, for review before any code:

  • Translator: vertex-stage buffer_store_dword to _dwordx4 in the off form (scalar byte offset plus immediate), through a fixed root-table descriptor, as RWByteAddressBuffer Store*. These stay refused:
    • glc, slc and dlc;
    • offen and idxen;
    • pixel-stage stores;
    • a descriptor used for both a load and a store.
  • Manifest: a uav <slot> table <param> <byte offset> line under an x2w-manifest 2 header. The runtime reader does not check the version line today and ignores lines it does not know. So the same change makes it read the version and reject an unknown version or line. It also bumps the shader cache revision (x2w-startup-shader-5), so an older runtime never loads a store translation.
  • Runtime (d3d12_draw.inl):
    • an appended vertex-visible UAV table in the translated root signature;
    • a raw CreateUnorderedAccessView over the resolved backing buffer, only when that buffer is UAV-capable and authoritative for later accesses;
    • transitions through the existing state tracking;
    • anything else rejects the draw.
  • Evidence: a source-built WARP fixture that draws through a translated vertex program with that store form. It then copies the backing buffer to readback and compares the written words and the neighbouring sentinels, with the debug layer on. A load-only version 1 draw is the control.
  • Shared interfaces: the x2w-manifest format and the translated root signature (create_translated_root). This overlaps #1641 and #1567 in d3d12_draw.inl; the merge order is to agree.

Does this split, translator and runtime landing together behind version 2, match what you want?

Environment: Windows 11 build 26300, Python 3.14.10, MSVC 14.44.35207.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7145236204 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7145236204). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-24T21:40:17Z. --- Claiming three of the root-independent rows from the table above. **1. `v_readfirstlane_b32` without a proven uniform source, straight-line slice: #1931.** - **Today:** only `v_cvt_i32_f32` of a fixed buffer word marks a VGPR uniform. - **The slice:** propagates that mark through lane-pure VALU results (`v_cvt_u32_f32`, `v_cvt_i32_f32`, `v_cvt_f32_ubyte0`, `v_mul_f32`, `v_fma_f32`, `v_fmaak_f32`, `v_rcp_f32`, `v_mov_b32`). Every source must be a constant, user data, a fixed buffer word, a scalar value not derived from a lane mask, or an already-uniform VGPR. - **Unchanged:** the existing preconditions stay (no modifiers on the read, no branches, known `exec`, a single SGPR destination), and #1780's refusal cases keep refusing. **2. `v_cndmask` with NEG on an immediate: #1932.** - **What it does:** the decoder computes the exact word from the encoding (the integer or float inline constant, or the literal dword, with bit 31 flipped). The handler gets an unambiguous hex literal instead of the ambiguous `-1`. - **What stays:** this lifts the refusal kept in #1710. Plain immediates keep their values, and ABS on an immediate stays refused. - **Not measured:** the flipped value is derived from the encoding, not measured on hardware. **3. `buffer_store_dwordx3`: design first.** `gfx2hlsl` has no store handler, and `srv` is the manifest's only resource-view line, so a store needs both halves. Whether the 84 pairs in the table use the form below is not measured yet. Proposed first slice, for review before any code: - **Translator:** vertex-stage `buffer_store_dword` to `_dwordx4` in the `off` form (scalar byte offset plus immediate), through a fixed root-table descriptor, as `RWByteAddressBuffer` `Store*`. These stay refused: - `glc`, `slc` and `dlc`; - `offen` and `idxen`; - pixel-stage stores; - a descriptor used for both a load and a store. - **Manifest:** a `uav <slot> table <param> <byte offset>` line under an `x2w-manifest 2` header. The runtime reader does not check the version line today and ignores lines it does not know. So the same change makes it read the version and reject an unknown version or line. It also bumps the shader cache revision (`x2w-startup-shader-5`), so an older runtime never loads a store translation. - **Runtime (`d3d12_draw.inl`):** - an appended vertex-visible UAV table in the translated root signature; - a raw `CreateUnorderedAccessView` over the resolved backing buffer, only when that buffer is UAV-capable and authoritative for later accesses; - transitions through the existing state tracking; - anything else rejects the draw. - **Evidence:** a source-built WARP fixture that draws through a translated vertex program with that store form. It then copies the backing buffer to readback and compares the written words and the neighbouring sentinels, with the debug layer on. A load-only version 1 draw is the control. - **Shared interfaces:** the `x2w-manifest` format and the translated root signature (`create_translated_root`). This overlaps #1641 and #1567 in `d3d12_draw.inl`; the merge order is to agree. Does this split, translator and runtime landing together behind version 2, match what you want? Environment: Windows 11 build 26300, Python 3.14.10, MSVC 14.44.35207. AI-assisted.
NiiRoZz commented 2026-11-24 22:01:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T21:56:58Z.


Correction to the NGG figures in my earlier comment here. They came from a register-sensitive hash and from slices that ignored branches. A control-flow-aware re-analysis of the same 602 programs (846 pairs), with 13 programs re-read by hand in an independent review, changes three statements:

  • "324 distinct shapes" was wrong: there are 2 skeletons, 601 programs and 1.
  • "LDS addresses lane-invariant in 602 of 602" was wrong: it is 601, plus 1 program with lane-dependent addresses.
  • The cross-lane set is unchanged at 31 pairs (30 programs), but it splits into 28 that use readlane/writelane only as SGPR spill slots and 2 with a DPP/permlane reduction.

Confirmed

  • 601 programs share one 13-event LDS/barrier/message sequence. Lane 0 of wave 0 publishes three wave-uniform scalars (the vertex count, the primitive count and what looks like a group index) through constant LDS addresses, then s_barrier; other waves read them back with v_readfirstlane. The wave-0 guard is resolved in 593 of them (591 automatically, 2 by hand) and inferred in the other 8. So the LDS traffic is a group-wide broadcast of scalars, not per-vertex data.
  • GS_ALLOC_REQ is sent with m0 = P<<12 | V, both counts loaded from memory (601).
  • Vertex exports are masked to tid < V and primitive exports to tid < P (602).
  • The primitive word is three packed slots of min(V-1, idx) with no flag bit ORed in (602).

Inferred only

  • No culling or compaction.
  • No edge flags outside the 423 programs of the plainest form.
  • That these began as mesh shaders.
  • That the 2 reduction programs are equivalent to per-lane code.
  • The split of the remaining 176 programs (261 pairs), by automatic matching, into the plain form under register renaming (61) and a form whose index is a field plus a per-lane base (115).

The 1 program with lane-dependent LDS addresses is different in kind: it reads LDS at addresses other lanes wrote, after a barrier, which looks like a real cross-lane exchange.

By pairs: 582 plain, 261 in the group of 176, 2 reduction, 1 lane-dependent.

First slice. A source-built check is ready locally: six cases (identity, LDS broadcast, reversed primitive, null primitive, two waves, masked ALU) assembled from documented encodings, anchored to literal values from the public LLVM and Mesa sources, run by a reference model in both wave orders and compared under three interpretations. Group-shared LDS matches every case. Lane-private LDS with counts honoured differs only where LDS carries data. Lane-private LDS with counts ignored differs in every contrast case except the masked-ALU one. It covers these three interpretations only and says nothing about a production lowering. I can open it as a PR if that is useful.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7145602644 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7145602644). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-24T21:56:58Z. --- Correction to the NGG figures in my earlier comment here. They came from a register-sensitive hash and from slices that ignored branches. A control-flow-aware re-analysis of the same 602 programs (846 pairs), with 13 programs re-read by hand in an independent review, changes three statements: - "324 distinct shapes" was wrong: there are 2 skeletons, 601 programs and 1. - "LDS addresses lane-invariant in 602 of 602" was wrong: it is 601, plus 1 program with lane-dependent addresses. - The cross-lane set is unchanged at 31 pairs (30 programs), but it splits into 28 that use readlane/writelane only as SGPR spill slots and 2 with a DPP/permlane reduction. **Confirmed** - 601 programs share one 13-event LDS/barrier/message sequence. Lane 0 of wave 0 publishes three wave-uniform scalars (the vertex count, the primitive count and what looks like a group index) through constant LDS addresses, then `s_barrier`; other waves read them back with `v_readfirstlane`. The wave-0 guard is resolved in 593 of them (591 automatically, 2 by hand) and inferred in the other 8. So the LDS traffic is a group-wide broadcast of scalars, not per-vertex data. - `GS_ALLOC_REQ` is sent with `m0 = P<<12 | V`, both counts loaded from memory (601). - Vertex exports are masked to `tid < V` and primitive exports to `tid < P` (602). - The primitive word is three packed slots of `min(V-1, idx)` with no flag bit ORed in (602). **Inferred only** - No culling or compaction. - No edge flags outside the 423 programs of the plainest form. - That these began as mesh shaders. - That the 2 reduction programs are equivalent to per-lane code. - The split of the remaining 176 programs (261 pairs), by automatic matching, into the plain form under register renaming (61) and a form whose index is a field plus a per-lane base (115). The 1 program with lane-dependent LDS addresses is different in kind: it reads LDS at addresses other lanes wrote, after a barrier, which looks like a real cross-lane exchange. By pairs: 582 plain, 261 in the group of 176, 2 reduction, 1 lane-dependent. **First slice.** A source-built check is ready locally: six cases (identity, LDS broadcast, reversed primitive, null primitive, two waves, masked ALU) assembled from documented encodings, anchored to literal values from the public LLVM and Mesa sources, run by a reference model in both wave orders and compared under three interpretations. Group-shared LDS matches every case. Lane-private LDS with counts honoured differs only where LDS carries data. Lane-private LDS with counts ignored differs in every contrast case except the masked-ALU one. It covers these three interpretations only and says nothing about a production lowering. I can open it as a PR if that is useful. AI-assisted (Claude Code).
JB2WIN commented 2026-11-24 23:03:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-24T22:22:13Z.


Taking the v_swap_b32 row (2 pairs) for tools/startup/gfx2hlsl.py. It is already lowered in pixel_aot (#771), where both destinations take the old value of the other register: read both sources first, then write both. Evidence: a device-free tests/startup_gfx2hlsl_* check in the style of the existing ones, with a self-swap, a swap whose destination is read again later, and refusal controls for modifiers and DPP/SDWA spellings. I'll leave s_bfm_b64 and v_cmp_class_f16 for a separate PR each, if no one else wants them.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146144942 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7146144942). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-24T22:22:13Z. --- Taking the `v_swap_b32` row (2 pairs) for `tools/startup/gfx2hlsl.py`. It is already lowered in `pixel_aot` (#771), where both destinations take the old value of the other register: read both sources first, then write both. Evidence: a device-free `tests/startup_gfx2hlsl_*` check in the style of the existing ones, with a self-swap, a swap whose destination is read again later, and refusal controls for modifiers and DPP/SDWA spellings. I'll leave `s_bfm_b64` and `v_cmp_class_f16` for a separate PR each, if no one else wants them. AI-assisted (Claude Code).
Leyukaka commented 2026-11-24 23:03:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-24T22:40:41Z.


Dated snapshot (2026-11-24) of every refusal site, not only the first, from the --refusals diagnostic in #1978, run on main at 889cd3f4 plus that PR.

Input.

  • A local cache recorded during startup runs: 222 request keys, which are 170 code pairs. 123 pairs record at least one refusal and 47 record none. Each pair was seen under one root signature, the one it was created with.
  • No request data in this comment; register numbers and immediates are normalised.

Caveats.

  • One recording, one adapter.
  • These are counts of refusal sites reached. Behind the first refusal a skipped instruction leaves later state unmodelled, so some rows are follow-on effects (the descriptor and holding desc/ptr rows likely are).
  • "Pairs" means code pairs containing the reason; a pair appears in several rows.
  • Existing work was checked against the open PRs, the open issues and this thread just before posting.
Code pairs Reason (scope ps unless noted) Existing work
62 s_load with a register offset through ('resheap',) #1143 (resource-heap half, claimed there, no PR found); the re-measure above found this one surviving an observed root
60 descriptor operand s[N:N] holds None likely follow-on; the re-measure above found none surviving an observed root
58 s_bfm_b64 planned above; JB2WIN mentions it as a possible follow-up
58 v_fma_mix_f32 none found
56 operand 'src_scc' #1820, PR #1821
56 operand '|vN|' planned above (root-independent gaps); #1778 refuses it on the interpolation sources
55 / 49 s_bitcmp1_b32 / s_bitcmp0_b32 none found
51 v_readfirstlane_b32 requires a proven uniform source #1931 (straight-line slice; branches stay refused)
50 / 31 numeric use of sN holding desc / holding ptr likely follow-on
39 / 38 s_addk_i32 / s_mulk_i32 none found for gfx2hlsl
36 / 31 / 30 v_add_f32_dpp / v_add_nc_u32_dpp / v_sub_f32_dpp none found for gfx2hlsl; compute DPP is #1543 (#1884)
36 / 35 / 35 v_cube{ma,sc,tc}_f32 / v_cubeid_f32 / image dimension SQ_RSRC_IMG_CUBE none found for gfx2hlsl
35 s_bitset1_b32 compute only (#1579)
34 / 31 s_nor_b32 / s_nand_b32 on a lane mask refused on purpose since #1925
33 export target null none found
33 image_sample_c_lz sampler: unsupported mip filter none found
33 v_med3_i32 lowering ready on my side, PR to follow
30 s_lshl1_add_u32 none found

What the counts show.

  • Of the 123 refused pairs, 21 have a single distinct reason, the median is 12 distinct reasons, and 53 have 15 or more. On this cache a single lowering makes few pairs translate by itself. The follow-on caveat applies to these per-pair counts too.
  • The largest row is the register-offset resource-heap load, the one provenance refusal the re-measure above reported as a real tracker gap.

#1978 produces the same table for any cache, and with #1750 for an archive-written one.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146514924 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7146514924). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-24T22:40:41Z. --- **Dated snapshot (2026-11-24)** of every refusal site, not only the first, from the `--refusals` diagnostic in #1978, run on `main` at `889cd3f4` plus that PR. **Input.** - A local cache recorded during startup runs: 222 request keys, which are 170 code pairs. 123 pairs record at least one refusal and 47 record none. Each pair was seen under one root signature, the one it was created with. - No request data in this comment; register numbers and immediates are normalised. **Caveats.** - One recording, one adapter. - These are counts of refusal sites reached. Behind the first refusal a skipped instruction leaves later state unmodelled, so some rows are follow-on effects (the descriptor and `holding desc/ptr` rows likely are). - "Pairs" means code pairs containing the reason; a pair appears in several rows. - Existing work was checked against the open PRs, the open issues and this thread just before posting. | Code pairs | Reason (scope `ps` unless noted) | Existing work | |---:|---|---| | 62 | `s_load with a register offset through ('resheap',)` | #1143 (resource-heap half, claimed there, no PR found); the re-measure above found this one surviving an observed root | | 60 | `descriptor operand s[N:N] holds None` | likely follow-on; the re-measure above found none surviving an observed root | | 58 | `s_bfm_b64` | planned above; JB2WIN mentions it as a possible follow-up | | 58 | `v_fma_mix_f32` | none found | | 56 | `operand 'src_scc'` | #1820, PR #1821 | | 56 | `operand '\|vN\|'` | planned above (root-independent gaps); #1778 refuses it on the interpolation sources | | 55 / 49 | `s_bitcmp1_b32` / `s_bitcmp0_b32` | none found | | 51 | `v_readfirstlane_b32 requires a proven uniform source` | #1931 (straight-line slice; branches stay refused) | | 50 / 31 | `numeric use of sN holding desc` / `holding ptr` | likely follow-on | | 39 / 38 | `s_addk_i32` / `s_mulk_i32` | none found for gfx2hlsl | | 36 / 31 / 30 | `v_add_f32_dpp` / `v_add_nc_u32_dpp` / `v_sub_f32_dpp` | none found for gfx2hlsl; compute DPP is #1543 (#1884) | | 36 / 35 / 35 | `v_cube{ma,sc,tc}_f32` / `v_cubeid_f32` / `image dimension SQ_RSRC_IMG_CUBE` | none found for gfx2hlsl | | 35 | `s_bitset1_b32` | compute only (#1579) | | 34 / 31 | `s_nor_b32` / `s_nand_b32` on a lane mask | refused on purpose since #1925 | | 33 | `export target null` | none found | | 33 | `image_sample_c_lz` sampler: unsupported mip filter | none found | | 33 | `v_med3_i32` | lowering ready on my side, PR to follow | | 30 | `s_lshl1_add_u32` | none found | **What the counts show.** - Of the 123 refused pairs, 21 have a single distinct reason, the median is 12 distinct reasons, and 53 have 15 or more. On this cache a single lowering makes few pairs translate by itself. The follow-on caveat applies to these per-pair counts too. - The largest row is the register-offset resource-heap load, the one provenance refusal the re-measure above reported as a real tracker gap. #1978 produces the same table for any cache, and with #1750 for an archive-written one. AI-assisted.
R0Y00 commented 2026-11-24 23:03:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:43:12Z.


#1978 is on main at 2deaa030. The source-built check confirms that the census leaves the cache untouched and preserves the default first refusal. The later sites are approximate because each skipped instruction can change downstream state. Use the first-site rows to choose isolated follow-ups and the later rows to locate candidates. A no-refusal row means the translation emitted text, without asserting that a desktop compiler or GPU accepted it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146564118 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7146564118). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:43:12Z. --- #1978 is on main at 2deaa030. The source-built check confirms that the census leaves the cache untouched and preserves the default first refusal. The later sites are approximate because each skipped instruction can change downstream state. Use the first-site rows to choose isolated follow-ups and the later rows to locate candidates. A no-refusal row means the translation emitted text, without asserting that a desktop compiler or GPU accepted it.
JB2WIN commented 2026-11-24 23:03:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-24T22:45:01Z.


Also taking the s_bfm_b64 row (1 pair) for tools/startup/gfx2hlsl.py, as its own PR next to the v_swap_b32 one. RDNA 2 ISA (SOP2): D.u64 = ((1ULL << S0[5:0]) - 1) << S1[5:0], SCC unchanged, the 64-bit counterpart of the s_bfm_b32 entry already in the scalar table. Evidence: a device-free check with field widths 0, 1, 32, 63 and offsets that cross the 32-bit boundary, plus refusal controls.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146599759 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7146599759). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-24T22:45:01Z. --- Also taking the `s_bfm_b64` row (1 pair) for `tools/startup/gfx2hlsl.py`, as its own PR next to the `v_swap_b32` one. RDNA 2 ISA (SOP2): `D.u64 = ((1ULL << S0[5:0]) - 1) << S1[5:0]`, SCC unchanged, the 64-bit counterpart of the `s_bfm_b32` entry already in the scalar table. Evidence: a device-free check with field widths 0, 1, 32, 63 and offsets that cross the 32-bit boundary, plus refusal controls. AI-assisted (Claude Code).
JB2WIN commented 2026-11-24 23:03:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-24T22:58:40Z.


Status for my rows: v_swap_b32 is #1995 and s_bfm_b64 is #2007. I'm taking v_cmp_class_f16 (1 pair) next, as a separate PR next to the existing v_cmp_class_f32 handling. It tests the binary16 class of S0[15:0] against the mask bits in S1, and refuses use of the high half and modifiers.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146867050 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7146867050). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-24T22:58:40Z. --- Status for my rows: `v_swap_b32` is #1995 and `s_bfm_b64` is #2007. I'm taking `v_cmp_class_f16` (1 pair) next, as a separate PR next to the existing `v_cmp_class_f32` handling. It tests the binary16 class of S0[15:0] against the mask bits in S1, and refuses use of the high half and modifiers. AI-assisted (Claude Code).
ChazY11 commented 2026-11-25 01:01:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:27:33Z.


40 of 40 open PRs carry other people's work in their git diff — a reading problem, not 40 mistakes

I quantified something that has bitten three reviews this week. For each open PR I compared two diffs:

  • own: git diff $(git merge-base origin/main HEAD) HEAD — what the PR actually changes
  • vs main: git diff origin/main HEAD — what GitHub shows, and what a reviewer reads

The ratio between them is how much of the visible diff is other people's merged work being reverted by a stale base.

PR      author     behind  own    vs main   factor
#2001   JB2WIN       39       7     2000     285.7
#2002   tedin7       60      26     3487     134.1
#1923   KomaGuy     713     378    50195     132.8
#1952   tedin7      131     110    12337     112.2
#1951   tedin7      131     151    12378      82.0
#1918   henriazz   219     284    20729      73.0
#1946   tedin7      133     190    12647      66.6
#1956   henriazz   128     199    12096      60.8
#1975   tedin7      109     147     8719      59.3
#2012   tedin7      133     222    12619      56.8
… 30 more, all >= 2.0

Every one of the 40 open PRs has a factor ≥ 2.0, and the median is north of 20. That is not 40 careless authors; it is a repository where main moves 20–180 commits while a PR is open, and the default diff view then shows the branch undoing weeks of other work.

Why this matters concretely

Three examples from this week, each verified line by line:

  • #2002 would restore InterlockedIncrement(&counter) <= N at two sites in d3d12_draw.inl — the 2^31 overflow that #1987 fixed, described there as "millions of lines a minute and stalled the process". Counted on both refs: first_calls uses 2 on main, 0 on the branch.
  • #2014 would revert ed7d09a4's SMEM guard shape (merged with #1984), comment and all.
  • #2012 now conflicts with #1995, which merged, and its diff vs main is 56× its own content.

None of these are wrong on purpose, and each is invisible unless you read the merge base instead of main.

What would fix it cheaply

  1. A rebase-before-review rule. Not "rebase before merge" — before review, because a reviewer reading a 12,000-line diff for a 26-line change will either miss the revert or spend an hour finding it.
  2. A CI check that fails when git diff --numstat $(git merge-base origin/main HEAD) HEAD differs from git diff --numstat origin/main HEAD by more than, say, 2×. It cannot be a hard failure for every drift, but it can surface as a label: needs-rebase.
  3. In review instructions: "read git diff $(git merge-base origin/main HEAD)", which is one line and removes the whole class of confusion.

The same 20-line script that produced the table would produce the label; the numbers above were computed with git merge-base, git rev-list --count, and git diff --numstat.

What this is not

It is not a claim that any of these 40 PRs is wrong, and not a request to close any of them. Three of them I have reviewed at behaviour level this week (#2002, #2005, #2003, #2007, #2014 among others) and their content is sound; the problem is purely how the diff reads.

Notes

  • AI-assisted analysis, computed on main 481a1c62.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147423209 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7147423209). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T23:27:33Z. --- ## 40 of 40 open PRs carry other people's work in their `git diff` — a reading problem, not 40 mistakes I quantified something that has bitten three reviews this week. For each open PR I compared two diffs: - **own**: `git diff $(git merge-base origin/main HEAD) HEAD` — what the PR actually changes - **vs main**: `git diff origin/main HEAD` — what GitHub shows, and what a reviewer reads The ratio between them is how much of the visible diff is *other people's merged work being reverted* by a stale base. ```text PR author behind own vs main factor #2001 JB2WIN 39 7 2000 285.7 #2002 tedin7 60 26 3487 134.1 #1923 KomaGuy 713 378 50195 132.8 #1952 tedin7 131 110 12337 112.2 #1951 tedin7 131 151 12378 82.0 #1918 henriazz 219 284 20729 73.0 #1946 tedin7 133 190 12647 66.6 #1956 henriazz 128 199 12096 60.8 #1975 tedin7 109 147 8719 59.3 #2012 tedin7 133 222 12619 56.8 … 30 more, all >= 2.0 ``` **Every one of the 40 open PRs has a factor ≥ 2.0**, and the median is north of 20. That is not 40 careless authors; it is a repository where `main` moves 20–180 commits while a PR is open, and the default diff view then shows the branch undoing weeks of other work. ## Why this matters concretely Three examples from this week, each verified line by line: - **#2002** would restore `InterlockedIncrement(&counter) <= N` at two sites in `d3d12_draw.inl` — the 2^31 overflow that #1987 fixed, described there as "millions of lines a minute and stalled the process". Counted on both refs: `first_calls` uses 2 on `main`, 0 on the branch. - **#2014** would revert `ed7d09a4`'s SMEM guard shape (merged with #1984), comment and all. - **#2012** now conflicts with #1995, which merged, and its diff vs `main` is 56× its own content. None of these are wrong on purpose, and each is invisible unless you read the merge base instead of `main`. ## What would fix it cheaply 1. **A rebase-before-review rule.** Not "rebase before merge" — before *review*, because a reviewer reading a 12,000-line diff for a 26-line change will either miss the revert or spend an hour finding it. 2. **A CI check that fails when `git diff --numstat $(git merge-base origin/main HEAD) HEAD` differs from `git diff --numstat origin/main HEAD` by more than, say, 2×.** It cannot be a hard failure for every drift, but it can surface as a label: `needs-rebase`. 3. **In review instructions:** "read `git diff $(git merge-base origin/main HEAD)`", which is one line and removes the whole class of confusion. The same 20-line script that produced the table would produce the label; the numbers above were computed with `git merge-base`, `git rev-list --count`, and `git diff --numstat`. ## What this is not It is not a claim that any of these 40 PRs is wrong, and not a request to close any of them. Three of them I have reviewed at behaviour level this week (#2002, #2005, #2003, #2007, #2014 among others) and their content is sound; the problem is purely how the diff reads. ## Notes - AI-assisted analysis, computed on `main` `481a1c62`.
ChazY11 commented 2026-11-25 01:01:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:48:20Z.


260 handler exceptions that are not Unsupported, from malformed operand shapes — measured, with the reachability stated honestly

I swept every op_* handler on main (489d5797) with seven operand shapes: none, one, two, three, a truncated register (v[0), an attribute token
(attr0), and four scalars. 76 handlers, 532 calls.

IndexError: 236 occurrences
TypeError:   24 occurrences

Samples of each class:

IndexError  buffer_load_dword            (no operands)
IndexError  image_load v0 / v0 v1 / v0 v1 v2
TypeError   s_bfm_b32 v[0 v1              'NoneType' object is not subscriptable
TypeError   v_cndmask_b32 v[0 v1          'NoneType' object is not subscriptable
TypeError   v_fma_mixhi_f16               not enough arguments for format string
TypeError   v_fma_mixhi_f16 v0            not enough arguments for format string

What this is, and what it is not

The handlers index ops[0]/ops[1] before checking len(ops), and a few pass a variable number of operands into a fixed format string. Under the
decoder this cannot happen: Stage.translate iterates self.ins, whose asm comes from D.decode_instruction, which always produces the operand
shape of the encoding. So these are not live bugs on the decode path.

They are reachable from anywhere that feeds assembly text to Stage.one, which is what the unit fixtures in tests/ do — and there the failure mode
is worse than a refusal:

path behaviour
refusals is None (Stage.translate single-shader, or a direct one() call) raises the IndexError/TypeError
refusals list (census) recorded as internal error in <op>: <Type>

handler_error labels those internal error, which is the project's own marker for a translator defect — so a malformed fixture would put an
unactionable entry into the #1723 census rather than an unsupported one.

The sub-class I would actually fix

v_fma_mixhi_f16 raising TypeError: not enough arguments for format string is different from the missing-length checks: it is a format-string
arity
bug. A handler that formats ops without confirming the count will raise this for any short form the decoder might legitimately produce for a
mixed-operand encoding — and unlike ops[0], it cannot be caught by a single len(ops) == N guard, because the count varies by modifier.

The other 259 are one-liners: if len(ops) != N: raise Unsupported(...) at the top of each handler, which most handlers already do. The ones that do
not are visible in the list above.

How I would find out whether any of this matters in practice

Feed the encoder a word for each of the 76 mnemonics and compare len(ops) from D.decode_instruction against the handler's requirement. If the
decoder ever yields fewer, that handler is reachable; if not, this whole class is test-harness robustness. I did not do that here because it needs
llvm-mc to assemble 76 fixtures, which is the LLVM-dependent path.

Why I am posting a negative-severity finding at all

Because it is the answer to a question the census cannot answer itself: #1723 counts refusals, and an internal error entry looks like a missing
lowering until someone reads the label. The sweep is 40 lines and reruns in a second, so it is cheap to keep as a check that asserts every handler
answers malformed input with Unsupported — that would convert 260 latent internal error labels into one CI line.

Notes

  • AI-assisted; measured on Windows 11 build 26300.9974, device-free.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147813858 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7147813858). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T23:48:20Z. --- ## 260 handler exceptions that are not `Unsupported`, from malformed operand shapes — measured, with the reachability stated honestly I swept every `op_*` handler on `main` (`489d5797`) with seven operand shapes: none, one, two, three, a truncated register (`v[0`), an attribute token (`attr0`), and four scalars. 76 handlers, 532 calls. ```text IndexError: 236 occurrences TypeError: 24 occurrences ``` Samples of each class: ```text IndexError buffer_load_dword (no operands) IndexError image_load v0 / v0 v1 / v0 v1 v2 TypeError s_bfm_b32 v[0 v1 'NoneType' object is not subscriptable TypeError v_cndmask_b32 v[0 v1 'NoneType' object is not subscriptable TypeError v_fma_mixhi_f16 not enough arguments for format string TypeError v_fma_mixhi_f16 v0 not enough arguments for format string ``` ## What this is, and what it is not The handlers index `ops[0]`/`ops[1]` before checking `len(ops)`, and a few pass a variable number of operands into a fixed format string. Under the decoder this cannot happen: `Stage.translate` iterates `self.ins`, whose `asm` comes from `D.decode_instruction`, which always produces the operand shape of the encoding. So these are **not live bugs on the decode path**. They *are* reachable from anywhere that feeds assembly text to `Stage.one`, which is what the unit fixtures in `tests/` do — and there the failure mode is worse than a refusal: | path | behaviour | |---|---| | `refusals is None` (`Stage.translate` single-shader, or a direct `one()` call) | **raises** the `IndexError`/`TypeError` | | `refusals` list (census) | recorded as `internal error in <op>: <Type>` | `handler_error` labels those `internal error`, which is the project's own marker for a translator defect — so a malformed fixture would put an unactionable entry into the `#1723` census rather than an `unsupported` one. ## The sub-class I would actually fix `v_fma_mixhi_f16` raising `TypeError: not enough arguments for format string` is different from the missing-length checks: it is a **format-string arity** bug. A handler that formats `ops` without confirming the count will raise this for any short form the decoder might legitimately produce for a mixed-operand encoding — and unlike `ops[0]`, it cannot be caught by a single `len(ops) == N` guard, because the count varies by modifier. The other 259 are one-liners: `if len(ops) != N: raise Unsupported(...)` at the top of each handler, which most handlers already do. The ones that do not are visible in the list above. ## How I would find out whether any of this matters in practice Feed the encoder a word for each of the 76 mnemonics and compare `len(ops)` from `D.decode_instruction` against the handler's requirement. If the decoder ever yields fewer, that handler is reachable; if not, this whole class is test-harness robustness. I did not do that here because it needs `llvm-mc` to assemble 76 fixtures, which is the LLVM-dependent path. ## Why I am posting a negative-severity finding at all Because it is the answer to a question the census cannot answer itself: `#1723` counts refusals, and an `internal error` entry looks like a missing lowering until someone reads the label. The sweep is 40 lines and reruns in a second, so it is cheap to keep as a check that asserts every handler answers malformed input with `Unsupported` — that would convert 260 latent `internal error` labels into one CI line. ## Notes - AI-assisted; measured on Windows 11 build 26300.9974, device-free.
JB2WIN commented 2026-11-25 01:02:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T00:08:15Z.


Taking s_addk_i32 and s_mulk_i32 for tools/startup/gfx2hlsl.py, as one PR since both are the same SOPK accumulate shape. A newer local census counts them in 77 and 79 refused pairs, and I found no open PR for either. The semantics come from the RDNA 2 ISA SOPK table: D = D + signext(SIMM16) with SCC set to the signed overflow for addk, and D = D * signext(SIMM16) with SCC unchanged for mulk. pixel_aot already lowers both. Evidence: a device-free check with sign-extension boundaries (0x7fff, 0x8000, 0xffff), signed overflow into SCC, a later SCC consumer, and refusals for mask or descriptor-tracked destinations.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7148186930 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7148186930). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T00:08:15Z. --- Taking `s_addk_i32` and `s_mulk_i32` for `tools/startup/gfx2hlsl.py`, as one PR since both are the same SOPK accumulate shape. A newer local census counts them in 77 and 79 refused pairs, and I found no open PR for either. The semantics come from the RDNA 2 ISA SOPK table: `D = D + signext(SIMM16)` with SCC set to the signed overflow for addk, and `D = D * signext(SIMM16)` with SCC unchanged for mulk. `pixel_aot` already lowers both. Evidence: a device-free check with sign-extension boundaries (0x7fff, 0x8000, 0xffff), signed overflow into SCC, a later SCC consumer, and refusals for mask or descriptor-tracked destinations. AI-assisted (Claude Code).
cobrajet302gt commented 2026-11-25 12:01:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by cobrajet302gt on 2026-11-25T11:33:36Z.


Census-side cross-link from an independent corpus pass on Linux: we publish row-level labels for every program in one Scarlett-format package at cobrajet302gt/gta6-shader-census (public domain; producer in `tools/`, stdlib only).

Relevance to this census, precisely: our pass labels the same archive family but measures a different class — ours are program-property labels (wave size, user SGPRs, stage, occurrences, keyed by FSSM DXBC header digest; 25,889 unique programs, 1,151 of them wave64 compute), while this issue counts `gfx2hlsl` pair refusals per root signature. The two ceilings therefore do not bound each other: 846 NGG-vertex pairs here live in the control-flow/instruction class, which our label set carries no bits for (same boundary we noted under VIctory #841 for the emulate-path classes).

Two rows from your table intersect our data in a way that may save someone time:

  • `s_load through sN holding (ptrhi, (root, N))` (136 pairs) and the `descriptor operand … holds None` class (118): these are addressing-shape refusals; our corpus can at least rank which stages and wave classes they cannot be attributed away from, since every refused pair here is vertex/mesh (NGG) or compute, and the corpus says wave64 compute programs number 1,151 with user-SGPR ≤ 15 — if your root-signature carve pins SGPR budgets below that, some pairs may be mis-bucketed between classes.
  • If a name↔digest bridge is useful here: ours (engine entry point ↔ digest) is pending from a translate-list pass and will land in the repo README when it does.

Disclosure: our runtime posts from this account come from locally patched builds; everything in the published corpus is patch-independent (archive-only extraction, no boot).

Written with an AI assistant.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161204406 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7161204406). Originally posted by [cobrajet302gt](https://github.com/cobrajet302gt) on 2026-11-25T11:33:36Z. --- Census-side cross-link from an independent corpus pass on Linux: we publish row-level labels for every program in one Scarlett-format package at cobrajet302gt/gta6-shader-census (public domain; producer in \`tools/\`, stdlib only). Relevance to this census, precisely: our pass labels the **same archive family** but measures a **different class** — ours are program-property labels (wave size, user SGPRs, stage, occurrences, keyed by FSSM DXBC header digest; 25,889 unique programs, 1,151 of them wave64 compute), while this issue counts \`gfx2hlsl\` **pair refusals per root signature**. The two ceilings therefore do not bound each other: 846 NGG-vertex pairs here live in the control-flow/instruction class, which our label set carries no bits for (same boundary we noted under VIctory #841 for the emulate-path classes). Two rows from your table intersect our data in a way that may save someone time: - \`s_load through sN holding (ptrhi, (root, N))\` (136 pairs) and the \`descriptor operand … holds None\` class (118): these are addressing-shape refusals; our corpus can at least rank which **stages and wave classes** they cannot be attributed away from, since every refused pair here is vertex/mesh (NGG) or compute, and the corpus says wave64 compute programs number 1,151 with user-SGPR ≤ 15 — if your root-signature carve pins SGPR budgets below that, some pairs may be mis-bucketed between classes. - If a name↔digest bridge is useful here: ours (engine entry point ↔ digest) is pending from a translate-list pass and will land in the repo README when it does. Disclosure: our runtime posts from this account come from locally patched builds; everything in the published corpus is patch-independent (archive-only extraction, no boot). Written with an AI assistant.
legacy-code-archaeologist commented 2026-11-25 13:00:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T12:05:20Z.


Claiming the 16-bit integer VOPC compares in gfx2hlsl.py compare(): v_cmp_*_i16/_u16 and v_cmpx_*_i16/_u16 (e32 and e64), reading the low 16 bits (zero- or sign-extended), with SDWA, op_sel and float-printed operands refused. No open PR diff touching gfx2hlsl.py contains these mnemonics as of today. PR with device-free controls and an FXC/DXC draw to follow. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161903409 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7161903409). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-25T12:05:20Z. --- Claiming the 16-bit integer VOPC compares in `gfx2hlsl.py` `compare()`: `v_cmp_*_i16/_u16` and `v_cmpx_*_i16/_u16` (e32 and e64), reading the low 16 bits (zero- or sign-extended), with SDWA, op_sel and float-printed operands refused. No open PR diff touching `gfx2hlsl.py` contains these mnemonics as of today. PR with device-free controls and an FXC/DXC draw to follow. AI-assisted.
legacy-code-archaeologist commented 2026-11-25 14:05:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T14:02:42Z.


I'm now working through the remaining gfx2hlsl refusal reasons from a local start-up census (graphics: 585 pipeline requests, 520 refused at 09551998). I'll do this locally and not open one PR per item for now; the 16-bit integer compares are already up as #2369.

To avoid duplicate work I skip anything with an open PR, a paused PR (the ones closed to keep the Windows queue short) or a claim in this thread. Checked by the + lines of the PR diffs, not by titles. Items I'm taking, all without a PR or claim as of now:

  • DPP forms with fi:1, row_mirror and row_half_mirror (v_min_u32, v_max_u32, v_or_b32, v_add_f32, v_mul_f32, v_mov_b32; not v_subrev_f32_dpp, which is #1996)
  • v_permlanex16_b32
  • v_readlane_b32 / v_writelane_b32 with lanes 32-63 and the write-before-read proof outside straight-line code
  • smaller ones: v_pack_b32_f16, v_mad_u32_u16, v_mbcnt_lo/hi_u32_b32, s_round_mode, image_atomic_or/umin/umax/add, v_cvt_pknorm_i16_f32, s_abs_i32, and the internal TypeErrors in v_cmp_*_e64, s_sub_i32 and s_bfe_u32

If you're already on one of these, say so here and I'll drop it. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164671887 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7164671887). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-25T14:02:42Z. --- I'm now working through the remaining gfx2hlsl refusal reasons from a local start-up census (graphics: 585 pipeline requests, 520 refused at `09551998`). I'll do this locally and not open one PR per item for now; the 16-bit integer compares are already up as #2369. To avoid duplicate work I skip anything with an open PR, a paused PR (the ones closed to keep the Windows queue short) or a claim in this thread. Checked by the `+` lines of the PR diffs, not by titles. Items I'm taking, all without a PR or claim as of now: - DPP forms with `fi:1`, `row_mirror` and `row_half_mirror` (`v_min_u32`, `v_max_u32`, `v_or_b32`, `v_add_f32`, `v_mul_f32`, `v_mov_b32`; not `v_subrev_f32_dpp`, which is #1996) - `v_permlanex16_b32` - `v_readlane_b32` / `v_writelane_b32` with lanes 32-63 and the write-before-read proof outside straight-line code - smaller ones: `v_pack_b32_f16`, `v_mad_u32_u16`, `v_mbcnt_lo/hi_u32_b32`, `s_round_mode`, `image_atomic_or/umin/umax/add`, `v_cvt_pknorm_i16_f32`, `s_abs_i32`, and the internal `TypeError`s in `v_cmp_*_e64`, `s_sub_i32` and `s_bfe_u32` If you're already on one of these, say so here and I'll drop it. AI-assisted.
legacy-code-archaeologist commented 2026-11-25 15:01:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T14:06:20Z.


Correction to my comment above: my check only read open PRs. The paused ones already cover part of my list, so I'm dropping these:

  • the DPP forms (fi:1, row_mirror, row_half_mirror): #2038 (tedin7). The ops it doesn't name, like v_min/max_u32_dpp, would build on the same DPP path, so I'm leaving those to that PR as well.
  • v_readlane_b32 and v_permlanex16_b32: #2032 (tedin7)
  • v_writelane_b32: touched in #2314, so I'm leaving it alone
  • the s_sub_i32 internal error: in the area of #2046 (tedin7)

What I'm still taking: v_pack_b32_f16, v_mad_u32_u16, v_mbcnt_lo/hi_u32_b32, s_round_mode, image_atomic_or/umin/umax/add, v_cvt_pknorm_i16_f32, s_abs_i32, and the internal TypeErrors in v_cmp_*_e64 and s_bfe_u32. Sorry for the noise. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164764053 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7164764053). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-25T14:06:20Z. --- Correction to my comment above: my check only read open PRs. The paused ones already cover part of my list, so I'm dropping these: - the DPP forms (`fi:1`, `row_mirror`, `row_half_mirror`): #2038 (tedin7). The ops it doesn't name, like `v_min/max_u32_dpp`, would build on the same DPP path, so I'm leaving those to that PR as well. - `v_readlane_b32` and `v_permlanex16_b32`: #2032 (tedin7) - `v_writelane_b32`: touched in #2314, so I'm leaving it alone - the `s_sub_i32` internal error: in the area of #2046 (tedin7) What I'm still taking: `v_pack_b32_f16`, `v_mad_u32_u16`, `v_mbcnt_lo/hi_u32_b32`, `s_round_mode`, `image_atomic_or/umin/umax/add`, `v_cvt_pknorm_i16_f32`, `s_abs_i32`, and the internal `TypeError`s in `v_cmp_*_e64` and `s_bfe_u32`. Sorry for the noise. AI-assisted.
Leyukaka commented 2026-11-25 21:01:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T20:50:37Z.


I'd like to take the follow-up to #2529: translating NEG on an inline-integer or literal source of a float VOP3 instruction, instead of refusing it.

In a local first-refusal census of captured start-up requests at main 780f3c0 (counts only), the #2529 refusal is now the most common first refusal. These sources were silently mistranslated before, so the refusal is correct. By opcode, as first refusals: v_fma_f32 978, v_cmp_class_f32_e64 233, v_mul_f32_e64 114, v_med3_f32 98.

Scope:

  • Float-typed VOP3 source slots only. Model: NEG flips bit 31 of the 32-bit source word, as LLVM's assembler does when it folds neg into an immediate (inline 1 -> 0x80000001, literal 0x5 -> 0x80000005, inline 0 -> 0x80000000, i.e. -0.0). Read from the encoding bits as #2529 does, not from the printed text. Hardware behaviour for these sources is not measured; the readback checks the HLSL against that model. I'll cite the LLVM source and the ISA text in the PR.
  • The v_cmp_class_f32 mask slot (src1), integer-typed operands, unused slots carrying NEG, and anything refused for another reason stay refused.
  • Subnormal inputs (inline 1..64 with NEG are negative subnormals) follow whatever the existing non-NEG inline-integer path does. The readback uses bit-exact controls only where the result does not depend on denormal flushing.
  • A WARP/hardware readback comparing each translated form with a CPU reference built from the encoded words (inline 0, inline 1..64, a literal, and the printed -1 ambiguity #2529 describes), plus negative controls.

Adjacent open PRs I checked: #1778 (modifier refusals), #2055 (v_fma_mix_f32), #2439/#2449 (abs on v_cndmask), #2475.

@Makto94, if you already have this in progress, say so and I'll step back and review instead.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174262692 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7174262692). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-25T20:50:37Z. --- I'd like to take the follow-up to #2529: translating NEG on an inline-integer or literal source of a float VOP3 instruction, instead of refusing it. In a local first-refusal census of captured start-up requests at main `780f3c0` (counts only), the #2529 refusal is now the most common first refusal. These sources were silently mistranslated before, so the refusal is correct. By opcode, as first refusals: `v_fma_f32` 978, `v_cmp_class_f32_e64` 233, `v_mul_f32_e64` 114, `v_med3_f32` 98. Scope: - Float-typed VOP3 source slots only. Model: NEG flips bit 31 of the 32-bit source word, as LLVM's assembler does when it folds `neg` into an immediate (inline 1 -> `0x80000001`, literal `0x5` -> `0x80000005`, inline 0 -> `0x80000000`, i.e. -0.0). Read from the encoding bits as #2529 does, not from the printed text. Hardware behaviour for these sources is not measured; the readback checks the HLSL against that model. I'll cite the LLVM source and the ISA text in the PR. - The `v_cmp_class_f32` mask slot (src1), integer-typed operands, unused slots carrying NEG, and anything refused for another reason stay refused. - Subnormal inputs (inline 1..64 with NEG are negative subnormals) follow whatever the existing non-NEG inline-integer path does. The readback uses bit-exact controls only where the result does not depend on denormal flushing. - A WARP/hardware readback comparing each translated form with a CPU reference built from the encoded words (inline 0, inline 1..64, a literal, and the printed `-1` ambiguity #2529 describes), plus negative controls. Adjacent open PRs I checked: #1778 (modifier refusals), #2055 (`v_fma_mix_f32`), #2439/#2449 (abs on `v_cndmask`), #2475. @Makto94, if you already have this in progress, say so and I'll step back and review instead. AI-assisted.
consolelogkyo commented 2026-11-25 22:02:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by consolelogkyo on 2026-11-25T21:56:03Z.


I'll take v_cvt_pk_u16_u32 and v_cvt_pk_i16_i32 in tools/startup/gfx2hlsl.py (sharing the VOP3-only saturating 16-bit integer pack pair already lowered in pixel_aot via #779). Scope: saturate src0 into bits 15:0 and src1 into bits 31:16 ([0, 65535] unsigned, [-32768, 32767] signed), refuse neg/abs in check_encoding(), modifiers (clamp, omod, op_sel), and non-VOP3 spellings (_e32, _sdwa, _dpp), and verify with llvm-mc / disasm_rdna2 controls plus DXC ps_6_0 and FXC ps_5_1 D3D12 draws and negative controls on WARP and Radeon RX 9070 XT.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7175725753 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7175725753). Originally posted by [consolelogkyo](https://github.com/consolelogkyo) on 2026-11-25T21:56:03Z. --- I'll take `v_cvt_pk_u16_u32` and `v_cvt_pk_i16_i32` in `tools/startup/gfx2hlsl.py` (sharing the VOP3-only saturating 16-bit integer pack pair already lowered in `pixel_aot` via #779). Scope: saturate `src0` into bits `15:0` and `src1` into bits `31:16` (`[0, 65535]` unsigned, `[-32768, 32767]` signed), refuse `neg`/`abs` in `check_encoding()`, modifiers (`clamp`, `omod`, `op_sel`), and non-VOP3 spellings (`_e32`, `_sdwa`, `_dpp`), and verify with `llvm-mc` / `disasm_rdna2` controls plus DXC `ps_6_0` and FXC `ps_5_1` D3D12 draws and negative controls on WARP and Radeon RX 9070 XT. AI-assisted.
consolelogkyo commented 2026-11-25 23:02:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by consolelogkyo on 2026-11-25T22:13:11Z.


Opened #2589 lowering v_cvt_pk_u16_u32 (0x36a) and v_cvt_pk_i16_i32 (0x36b) in tools/startup/gfx2hlsl.py with LLVM 15 round-trip checks, boundary/refusal controls, and WARP + Radeon RX 9070 XT D3D12 verification (FXC ps_5_1 + DXC ps_6_0).

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7176086625 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7176086625). Originally posted by [consolelogkyo](https://github.com/consolelogkyo) on 2026-11-25T22:13:11Z. --- Opened #2589 lowering `v_cvt_pk_u16_u32` (`0x36a`) and `v_cvt_pk_i16_i32` (`0x36b`) in `tools/startup/gfx2hlsl.py` with LLVM 15 round-trip checks, boundary/refusal controls, and WARP + Radeon RX 9070 XT D3D12 verification (`FXC ps_5_1` + `DXC ps_6_0`). AI-assisted.
R0Y00 commented 2026-11-25 23:02:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T22:58:45Z.


Two previously blocked slices are now on main. #2057 (e0da6b39) covers the descriptor load into s[104:107]. The Release controls and real WARP/RTX draws passed 3/3. The controls still refuse a VCC read or descriptor use when its required definition is bypassed or clobbered. #2073 (f03cf16f) covers the binary16 ALU and integer FMA rounding correction; the Release host and FXC/DXC draw checks passed 4/4 on WARP and RTX 4060 Laptop. These are source-built results. Any change in the offline refusal census needs a fresh run at the landed revision.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177005891 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7177005891). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T22:58:45Z. --- Two previously blocked slices are now on main. #2057 (`e0da6b39`) covers the descriptor load into s[104:107]. The Release controls and real WARP/RTX draws passed 3/3. The controls still refuse a VCC read or descriptor use when its required definition is bypassed or clobbered. #2073 (`f03cf16f`) covers the binary16 ALU and integer FMA rounding correction; the Release host and FXC/DXC draw checks passed 4/4 on WARP and RTX 4060 Laptop. These are source-built results. Any change in the offline refusal census needs a fresh run at the landed revision.
Leyukaka commented 2026-11-26 00:01:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T23:05:46Z.


Claiming a refusal for lane masks used as data words in gfx2hlsl.py, found while reviewing #2439 and #2449.

A compare into an SGPR pair (v_cmp_eq_u32_e64 s[30:31], 0, v0) keeps only the current lane's bit in s30 and marks it a lane mask. On main, op_v_cndmask_b32 reads its data operands through u_src with no lane-mask check, and v_mov_b32 has no check either (plain form, and the SDWA form with src0_sel:DWORD). So v_cndmask_b32_e64 v1, 0, s30, s[30:31] emits the lane's bit (1) where RDNA 2 reads the whole mask word (0xffffffff when all 32 lanes are active and pass the compare), and |s30| in #2439/#2449 inherits the same result. Other handlers already refuse a mask as data (s_bfe_i32, s_bfe_u64, s_bfe_i64 and the 64-bit shifts, the SOP2 word complements, s_cmov, s_bitcmp0/1_b32, v_writelane_b32, the buffer soffset).

Plan: refuse a lane-mask register as a data source of v_cndmask_b32 (e32 and e64) and of v_mov_b32 (plain and SDWA DWORD), after stripping -, |..| and the other source modifiers, keeping the lane-select operand of v_cndmask as it is. PR with refusal controls, the updated expected messages in startup_gfx2hlsl_readfirstlane_uniform_check.py (several of its refused cases move a mask with v_mov_b32 first), and the census count of what it newly refuses.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177140738 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7177140738). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-25T23:05:46Z. --- Claiming a refusal for lane masks used as data words in `gfx2hlsl.py`, found while reviewing #2439 and #2449. A compare into an SGPR pair (`v_cmp_eq_u32_e64 s[30:31], 0, v0`) keeps only the current lane's bit in `s30` and marks it a lane mask. On main, `op_v_cndmask_b32` reads its data operands through `u_src` with no lane-mask check, and `v_mov_b32` has no check either (plain form, and the SDWA form with `src0_sel:DWORD`). So `v_cndmask_b32_e64 v1, 0, s30, s[30:31]` emits the lane's bit (1) where RDNA 2 reads the whole mask word (`0xffffffff` when all 32 lanes are active and pass the compare), and `|s30|` in #2439/#2449 inherits the same result. Other handlers already refuse a mask as data (`s_bfe_i32`, `s_bfe_u64`, `s_bfe_i64` and the 64-bit shifts, the SOP2 word complements, `s_cmov`, `s_bitcmp0/1_b32`, `v_writelane_b32`, the buffer `soffset`). Plan: refuse a lane-mask register as a data source of `v_cndmask_b32` (e32 and e64) and of `v_mov_b32` (plain and SDWA DWORD), after stripping `-`, `|..|` and the other source modifiers, keeping the lane-select operand of `v_cndmask` as it is. PR with refusal controls, the updated expected messages in `startup_gfx2hlsl_readfirstlane_uniform_check.py` (several of its refused cases move a mask with `v_mov_b32` first), and the census count of what it newly refuses. AI-assisted.
SimSalabimse commented 2026-11-26 00:01:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T00:01:02Z.


Claiming three small gfx2hlsl ALU ports that are already lowered in pixel_aot but still refuse in tools/startup/gfx2hlsl.py, one PR each:

  1. s_abs_i32 — D = asint(S0) < 0 ? (0u - S0) : S0, SCC = result != 0.
  2. s_flbit_i32_b32 — D = S0 == 0 ? 0xffffffff : 31 - firstbithigh(S0), SCC unchanged.
  3. s_quadmask_b32 — each nibble of S0 collapses to one bit of D (8-bit result), SCC = result != 0 (same helper shape as pixel_aot).

Each PR: hand-assembled SOP1 fixture, CPU evaluation of the translated text, lane-mask / descriptor refusals, and a mutation negative control. No retail bytes. Not touching NGG / provenance rows.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178303087 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7178303087). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T00:01:02Z. --- Claiming three small **gfx2hlsl** ALU ports that are already lowered in `pixel_aot` but still refuse in `tools/startup/gfx2hlsl.py`, one PR each: 1. **`s_abs_i32`** — `D = asint(S0) < 0 ? (0u - S0) : S0`, SCC = result != 0. 2. **`s_flbit_i32_b32`** — `D = S0 == 0 ? 0xffffffff : 31 - firstbithigh(S0)`, SCC unchanged. 3. **`s_quadmask_b32`** — each nibble of S0 collapses to one bit of D (8-bit result), SCC = result != 0 (same helper shape as `pixel_aot`). Each PR: hand-assembled SOP1 fixture, CPU evaluation of the translated text, lane-mask / descriptor refusals, and a mutation negative control. No retail bytes. Not touching NGG / provenance rows. AI-assisted.
tedin7 commented 2026-11-26 01:02:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:21:06Z.


Claiming the follow-up to #2082 (image_sample_d LLVM 15 tuple spelling in the fixture test); Draft PR to follow.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178664095 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7178664095). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:21:06Z. --- Claiming the follow-up to #2082 (image_sample_d LLVM 15 tuple spelling in the fixture test); Draft PR to follow. AI-assisted; commands listed were executed locally.
SimSalabimse commented 2026-11-26 02:05:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-26T01:36:31Z.


Claiming s_ff0_i32_b32 in tools/startup/gfx2hlsl.py (Part of #1723): port the pixel_aot / ff0_i32_b32 form firstbitlow(~S0) (0xffffffff when every bit is set). SCC unchanged. Lane masks and descriptor-bearing SGPRs refused. Source-built CPU fixture with a negative control; one PR.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179943649 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7179943649). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-26T01:36:31Z. --- Claiming `s_ff0_i32_b32` in `tools/startup/gfx2hlsl.py` (Part of #1723): port the `pixel_aot` / `ff0_i32_b32` form `firstbitlow(~S0)` (0xffffffff when every bit is set). SCC unchanged. Lane masks and descriptor-bearing SGPRs refused. Source-built CPU fixture with a negative control; one PR. AI-assisted.
consolelogkyo commented 2026-11-26 02:05:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by consolelogkyo on 2026-11-26T02:03:32Z.


Claiming the RDNA 2 null scalar operand (code 125) and Stage.scalar / op_s_bfm_b32 non-SGPR destination TypeError fix in tools/startup/gfx2hlsl.py (also declared as a FIX on #2618 for the E translator-exception rows, refs #2463):

  • Read null (125) as 0x00000000u (wave-uniform constant 0) in scalar/vector 32-bit operand readers.
  • Lower 32-bit SALU writes to null on plain numeric/constant operands (discarding the register write while emitting modeled SCC updates such as s_and_b32 null, s0, mask and s_lshl*_add_u32 null, ..., and keeping scc_uniform intact).
  • Replace reg_range(...)[1] TypeError crashes with explicit Unsupported refusals for _b64 / lane-mask / descriptor / SCC_UNMODELLED writes to null and unmodelled destinations (vcc_hi, exec_hi, ttmp*).
  • Verify with LLVM 15 llvm-mc / libLLVM round-trips, refusal controls, and WARP + Radeon RX 9070 XT D3D12 draws.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180417003 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7180417003). Originally posted by [consolelogkyo](https://github.com/consolelogkyo) on 2026-11-26T02:03:32Z. --- Claiming the RDNA 2 `null` scalar operand (`code 125`) and `Stage.scalar` / `op_s_bfm_b32` non-SGPR destination `TypeError` fix in `tools/startup/gfx2hlsl.py` (also declared as a `FIX` on #2618 for the `E` translator-exception rows, refs #2463): - Read `null` (`125`) as `0x00000000u` (wave-uniform constant `0`) in scalar/vector 32-bit operand readers. - Lower 32-bit SALU writes to `null` on plain numeric/constant operands (discarding the register write while emitting modeled `SCC` updates such as `s_and_b32 null, s0, mask` and `s_lshl*_add_u32 null, ...`, and keeping `scc_uniform` intact). - Replace `reg_range(...)[1]` `TypeError` crashes with explicit `Unsupported` refusals for `_b64` / lane-mask / descriptor / `SCC_UNMODELLED` writes to `null` and unmodelled destinations (`vcc_hi`, `exec_hi`, `ttmp*`). - Verify with LLVM 15 `llvm-mc` / `libLLVM` round-trips, refusal controls, and WARP + Radeon RX 9070 XT D3D12 draws. AI-assisted.
tedin7 commented 2026-11-26 03:03:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:28:36Z.


Claiming: refuse a wave lane mask (and the high word of a wave64 mask pair) read as numeric data by the remaining vector ALU forms in gfx2hlsl, beyond the v_mov_b32/v_cndmask_b32 case of #2623 (Draft PR soon).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180838967 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7180838967). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:28:36Z. --- Claiming: refuse a wave lane mask (and the high word of a wave64 mask pair) read as numeric data by the remaining vector ALU forms in gfx2hlsl, beyond the v_mov_b32/v_cndmask_b32 case of #2623 (Draft PR soon).
tedin7 commented 2026-11-26 03:03:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:30:05Z.


@consolelogkyo about your claim on the scalar destination TypeError crashes (vcc_hi, exec_hi, ttmp*): we already have a finished fix for the vcc_hi / exec_hi part. It turns the crash into explicit refusals, and in wave32 it also lowers the cases where that is exact (a compare or carry destination, a mask, a scalar operand), while a program that may be wave64 keeps vcc_hi refused. It comes with a fixture and a D3D12 draw check that compares against a CPU reference, with translations that drop the compare bit or the carry as failing controls.

We will not open it while your claim stands. Which do you prefer: you open yours and we share our test words, or we open ours as a Draft with a credit line to you for the null operand and the other destinations, which stay yours? Either is fine with us.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180861160 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7180861160). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:30:05Z. --- @consolelogkyo about your claim on the scalar destination `TypeError` crashes (`vcc_hi`, `exec_hi`, `ttmp*`): we already have a finished fix for the `vcc_hi` / `exec_hi` part. It turns the crash into explicit refusals, and in wave32 it also lowers the cases where that is exact (a compare or carry destination, a mask, a scalar operand), while a program that may be wave64 keeps `vcc_hi` refused. It comes with a fixture and a D3D12 draw check that compares against a CPU reference, with translations that drop the compare bit or the carry as failing controls. We will not open it while your claim stands. Which do you prefer: you open yours and we share our test words, or we open ours as a Draft with a credit line to you for the `null` operand and the other destinations, which stay yours? Either is fine with us. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 03:03:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:30:18Z.


Claiming: plain image_sample in a pixel stage keeps the implicit LOD (Sample) where the existing sample_b / get_lod derivative rule already holds, instead of level 0 (Draft PR to follow).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180864783 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7180864783). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:30:18Z. --- Claiming: plain `image_sample` in a pixel stage keeps the implicit LOD (`Sample`) where the existing sample_b / get_lod derivative rule already holds, instead of level 0 (Draft PR to follow). AI-assisted; commands listed were executed locally.
consolelogkyo commented 2026-11-26 03:03:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by consolelogkyo on 2026-11-26T02:32:37Z.


Opened #2698 (https://github.com/R0Y00/Xbox2Windows/pull/2698) for the scalar null (code 125) operand lowering and Stage.scalar / op_s_bfm_b32 non-SGPR destination refusal guards claimed above (verified on WARP + Radeon RX 9070 XT with pixel draws, runtime root-constant SALU+branch buffer readbacks, and negative controls).

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7180899829 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7180899829). Originally posted by [consolelogkyo](https://github.com/consolelogkyo) on 2026-11-26T02:32:37Z. --- Opened #2698 (https://github.com/R0Y00/Xbox2Windows/pull/2698) for the scalar `null` (`code 125`) operand lowering and `Stage.scalar` / `op_s_bfm_b32` non-SGPR destination refusal guards claimed above (verified on WARP + Radeon RX 9070 XT with pixel draws, runtime root-constant SALU+branch buffer readbacks, and negative controls). AI-assisted.
tedin7 commented 2026-11-26 03:03:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:43:41Z.


Claiming: wave32 vcc_hi as an ordinary scalar register in gfx2hlsl, with the wave64 case kept refused (Draft PR soon; builds on #2698).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181065000 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181065000). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:43:41Z. --- Claiming: wave32 vcc_hi as an ordinary scalar register in gfx2hlsl, with the wave64 case kept refused (Draft PR soon; builds on #2698).
tedin7 commented 2026-11-26 03:03:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:49:24Z.


Claiming: DPP quad reads in pixel programs with uniform branches and loops in gfx2hlsl, proving wave-uniform control flow over the whole program (Draft PR soon; extends #2657 and #2483).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181150198 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181150198). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:49:24Z. --- Claiming: DPP quad reads in pixel programs with uniform branches and loops in gfx2hlsl, proving wave-uniform control flow over the whole program (Draft PR soon; extends #2657 and #2483).
tedin7 commented 2026-11-26 03:03:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T02:55:10Z.


Claiming: fold an s_mov_b32 copy of a known-constant SGPR in gfx2hlsl, so inline sampler words built by copying a zero translate (small follow-up to #2319).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181233868 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181233868). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T02:55:10Z. --- Claiming: fold an s_mov_b32 copy of a known-constant SGPR in gfx2hlsl, so inline sampler words built by copying a zero translate (small follow-up to #2319).
tedin7 commented 2026-11-26 03:03:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:00:34Z.


Claiming: constant-lane SGPR spills on wave64 lanes 32..63 and in vertex stages in gfx2hlsl (v_writelane_b32 / v_readlane_b32), extending #2637 (Draft PR soon).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181313169 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181313169). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:00:34Z. --- Claiming: constant-lane SGPR spills on wave64 lanes 32..63 and in vertex stages in gfx2hlsl (v_writelane_b32 / v_readlane_b32), extending #2637 (Draft PR soon).
tedin7 commented 2026-11-26 04:04:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:08:08Z.


Claiming: keep a descriptor loaded in an s_cbranch_execz arm for reads before the exec restore in gfx2hlsl (Draft PR soon).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181426414 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181426414). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:08:08Z. --- Claiming: keep a descriptor loaded in an s_cbranch_execz arm for reads before the exec restore in gfx2hlsl (Draft PR soon).
tedin7 commented 2026-11-26 04:04:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:26:25Z.


Claiming: keep wave-uniformity through lane-independent integer VALU ops (add/sub/shift/and/or/xor/min/max/mul) in gfx2hlsl, so v_readfirstlane of such a value is proven (Draft PR soon). The uniform buffer load past the entry block is #2607.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181720798 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181720798). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:26:25Z. --- Claiming: keep wave-uniformity through lane-independent integer VALU ops (add/sub/shift/and/or/xor/min/max/mul) in gfx2hlsl, so v_readfirstlane of such a value is proven (Draft PR soon). The uniform buffer load past the entry block is #2607.
tedin7 commented 2026-11-26 04:04:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:39:26Z.


Claiming: compute s_cbranch_execz blocks that leave a lane mask's bit unchanged for the lanes they skip (the compiler's i1-phi blend s_andn2 / s_and exec / s_or, v_cmp into a zeroed mask, s_orn2 into an all-ones mask) in gfx2hlsl.py (Draft PR to follow; it extends phi_mask_ok and does not touch #2557's two rules).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181909535 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7181909535). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:39:26Z. --- Claiming: compute `s_cbranch_execz` blocks that leave a lane mask's bit unchanged for the lanes they skip (the compiler's i1-phi blend `s_andn2` / `s_and exec` / `s_or`, `v_cmp` into a zeroed mask, `s_orn2` into an all-ones mask) in `gfx2hlsl.py` (Draft PR to follow; it extends `phi_mask_ok` and does not touch #2557's two rules). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 04:04:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:51:48Z.


Claiming a D3D12 WARP readback test for the src_scc lowering from #1821 (follow-up Draft).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182088348 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182088348). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:51:48Z. --- Claiming a D3D12 WARP readback test for the `src_scc` lowering from #1821 (follow-up Draft). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 04:04:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:04:27Z.


Claiming: ship the compiled compute-store shader cases in the GPU check package and replay them in Run-GpuCheck.ps1 on the contributor's own adapter (Draft PR soon; also Part of #1).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182270322 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182270322). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:04:27Z. --- Claiming: ship the compiled compute-store shader cases in the GPU check package and replay them in Run-GpuCheck.ps1 on the contributor's own adapter (Draft PR soon; also Part of #1).
tedin7 commented 2026-11-26 05:02:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:15Z.


@legacy-code-archaeologist quick coordination question on your 2026-11-25 14:06Z claim that includes image_atomic_or/umin/umax/add: are you still working on those?

We have a local branch for the pixel-stage forms (image_atomic_umin 32-bit, image_atomic_umax 64-bit on a register pair with a16, image_atomic_or), each with a WARP readback against a CPU reference, wrong-value and mutation controls, plus the small runtime binding for RWTexture2D<uint> / 64-bit views. We have not opened it because of your claim.

Happy either way: if you are close, open yours and we will review it and offer our tests; if not, we can open ours as a Draft with credit and you review it. Just tell us which you prefer.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182416873 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182416873). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:14:15Z. --- @legacy-code-archaeologist quick coordination question on your 2026-11-25 14:06Z claim that includes `image_atomic_or/umin/umax/add`: are you still working on those? We have a local branch for the pixel-stage forms (`image_atomic_umin` 32-bit, `image_atomic_umax` 64-bit on a register pair with a16, `image_atomic_or`), each with a WARP readback against a CPU reference, wrong-value and mutation controls, plus the small runtime binding for `RWTexture2D<uint>` / 64-bit views. We have not opened it because of your claim. Happy either way: if you are close, open yours and we will review it and offer our tests; if not, we can open ours as a Draft with credit and you review it. Just tell us which you prefer. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:32:30Z.


Claiming: image_sample_b / image_get_lod stay lowered past a v_cmpx/saveexec-narrowed EXEC and a per-quad EXEC branch (builds on #2659; Draft PR to follow).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182684743 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182684743). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:32:30Z. --- Claiming: image_sample_b / image_get_lod stay lowered past a v_cmpx/saveexec-narrowed EXEC and a per-quad EXEC branch (builds on #2659; Draft PR to follow). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:35:18Z.


Claiming: binary16 VOPC compares in gfx2hlsl.py compare(): v_cmp_<rel>_f16 and v_cmpx_<rel>_f16, e32 and e64 (SDWA stays with #1680). Draft PR soon, with a WARP readback over NaN, inf, -0 and denormal halves.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182725234 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182725234). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:35:18Z. --- Claiming: binary16 VOPC compares in `gfx2hlsl.py` `compare()`: `v_cmp_<rel>_f16` and `v_cmpx_<rel>_f16`, e32 and e64 (SDWA stays with #1680). Draft PR soon, with a WARP readback over NaN, inf, -0 and denormal halves. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:35:45Z.


Claiming: compute readfirstlane waterfall, body scalar that does not depend on the key read after the loop (W1).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182732013 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182732013). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:35:45Z. --- Claiming: compute readfirstlane waterfall, body scalar that does not depend on the key read after the loop (W1).
tedin7 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:36:21Z.


Claiming: v_pk_mul_f16 / v_pk_add_f16 / v_pk_fma_f16 lowering in gfx2hlsl (Draft PR soon).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182740499 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182740499). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:36:21Z. --- Claiming: v_pk_mul_f16 / v_pk_add_f16 / v_pk_fma_f16 lowering in gfx2hlsl (Draft PR soon).
tedin7 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:36:33Z.


Claiming: SDWA v_add_f16 (VOP2 SDWA, binary16) in gfx2hlsl.py sdwa(); WARP readback test, Draft PR soon. Binary16 compares stay with the other claim, packed ops separate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182743431 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7182743431). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:36:33Z. --- Claiming: SDWA v_add_f16 (VOP2 SDWA, binary16) in gfx2hlsl.py sdwa(); WARP readback test, Draft PR soon. Binary16 compares stay with the other claim, packed ops separate.
tedin7 commented 2026-11-26 05:02:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:58:25Z.


Claiming: compute WaveSync (wave-wide gathers through groupshared memory) and the guest wave size, with v_readfirstlane_b32 of a per-lane VGPR on top of it (#2791, supersedes #2745).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183064996 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7183064996). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:58:25Z. --- Claiming: compute WaveSync (wave-wide gathers through groupshared memory) and the guest wave size, with v_readfirstlane_b32 of a per-lane VGPR on top of it (#2791, supersedes #2745).
tedin7 commented 2026-11-26 06:02:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:30:27Z.


Claiming: s_wqm_b64 exec, exec on a narrowed EXEC kept exact in pixel programs with sample_b / get_lod, as a per-quad vote (stacked on #2736; Draft PR to follow); a backward branch around the v_interp_p1ll_f16 / v_interp_p2_f16 pair in the pixel stage (Draft PR soon); image_store with d16 (four binary16 values from two VGPRs) in the pixel stage (Draft PR soon).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183547133 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7183547133). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:30:27Z. --- Claiming: s_wqm_b64 exec, exec on a narrowed EXEC kept exact in pixel programs with sample_b / get_lod, as a per-quad vote (stacked on #2736; Draft PR to follow); a backward branch around the v_interp_p1ll_f16 / v_interp_p2_f16 pair in the pixel stage (Draft PR soon); image_store with d16 (four binary16 values from two VGPRs) in the pixel stage (Draft PR soon). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 07:00:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T06:23:22Z.


Claiming: the pixel-stage resource-heap image record in gfx2hlsl.py: s_load_dwordx8 at a register offset (index shifted left by 5) through the resource heap, with the index read from a table buffer word as the compute form of #2580 already models (translator and manifest first; runtime binding as a separate slice). Draft PR soon.

Claiming: image_gather4_lz with a repeat (wrap) sampler in gfx2hlsl.py (CLAMP_X / CLAMP_Y of 0 for the native Gather form; WARP readback at the u/v = 0 and 1 edges). Draft PR soon.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7184381271 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7184381271). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T06:23:22Z. --- Claiming: the pixel-stage resource-heap image record in `gfx2hlsl.py`: `s_load_dwordx8` at a register offset (index shifted left by 5) through the resource heap, with the index read from a table buffer word as the compute form of #2580 already models (translator and manifest first; runtime binding as a separate slice). Draft PR soon. Claiming: `image_gather4_lz` with a repeat (wrap) sampler in `gfx2hlsl.py` (CLAMP_X / CLAMP_Y of 0 for the native Gather form; WARP readback at the u/v = 0 and 1 edges). Draft PR soon. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 08:01:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:17:09Z.


Claiming: raise the mesh parameter range from param0..12 to param0..31 (ISA 10.2; the 32-vector D3D12 budget still applies) in mesh_param_link.py and the mesh export recognizer, with a param18/param28 pairing draw (Draft PR soon).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185292732 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7185292732). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:17:09Z. --- Claiming: raise the mesh parameter range from param0..12 to param0..31 (ISA 10.2; the 32-vector D3D12 budget still applies) in mesh_param_link.py and the mesh export recognizer, with a param18/param28 pairing draw (Draft PR soon). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 10:04:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T09:53:13Z.


Claiming: NVIDIA pipeline-creation failure (NVVM compilation failed: 3) in the buffer_store_format xyzw store helper of gfx2hlsl (Draft PR soon).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7188607589 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7188607589). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T09:53:13Z. --- Claiming: NVIDIA pipeline-creation failure (`NVVM compilation failed: 3`) in the buffer_store_format xyzw store helper of gfx2hlsl (Draft PR soon). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 11:02:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:28:45Z.


Releasing all of our open translator claims in this issue. We withdrew the related Python gfx2hlsl PRs because translation is moving to the native C++ frontend (see #870): #2030 #2079 #2096 #2741 #2745 #2747 #2755 #2758 #2760 #2761 #2763 #2772 #2784 #2786 #2789 #2791 #2792 #2793 #2796. Anything we claimed here that is not already merged is free for anyone to take. The branches stay available if any part is useful.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7189419512 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7189419512). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T10:28:45Z. --- Releasing all of our open translator claims in this issue. We withdrew the related Python gfx2hlsl PRs because translation is moving to the native C++ frontend (see #870): #2030 #2079 #2096 #2741 #2745 #2747 #2755 #2758 #2760 #2761 #2763 #2772 #2784 #2786 #2789 #2791 #2792 #2793 #2796. Anything we claimed here that is not already merged is free for anyone to take. The branches stay available if any part is useful.
mumba17 commented 2026-11-26 13:03:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-26T12:43:09Z.


Held locally during the C++ rewrite: low-half readers of a plain v_interp_p2_f16 result, plus two notes

I'm not opening a PR, since translator work is paused for the C++ frontend. This is in case any of it is useful there.

1. Low-half readers (local branch, not pushed). interp_f16_scan currently accepts only v_cvt_f32_f16 as a reader of a plain p2 destination. The branch also accepts:

  • a v_fma_mix* source with op_sel_hi set and op_sel clear (a binary16 low half; Stage.mix already lowers it as f16tof32 of bits 15:0);
  • a v_pack_b32_f16 source whose op_sel bit is clear (lowered with a 0xffff mask).

v_fma_mix_f32 and v_pack_b32_f16 also define their whole destination. The high half, a binary32 fma_mix source and a v_fma_mixlo/hi_f16 destination stay refused. It overlaps tedin7's withdrawn #2789 (same fma_mix rule) and adds v_pack_b32_f16.

Tests: four accepted/refused variants in startup_gfx2hlsl_interp_f16_check.py, hand-encoded and checked with the translator's decoder (llvm-mc 15 binary mode not run locally). Draws on WARP and RTX 3090 (driver 32.0.16.1664, Windows 26300): the fma_mix stage exports 1.5 from the low half of attr0.x, the pack of the attr0.x halves exports the vertex word 0xc0003e00, and a mutant of each must fail. ctest -j 1 -R "mesh57|mesh_cbv_order|startup_gfx2hlsl": 342/342 at d4dfe97b.

2. Soundness gap on main (found by tedin7 in #2789, confirmed at d4dfe97b). parse('exp mrt0 v4, v5, v5, v5 done vm') returns operands ['mrt0 v4', 'v5', ...], so the scan never sees the first exported register. A plain p2 result exported only as channel x is not checked for its undefined upper half.

3. Counts from a local capture (RTX 3090, counts only). 95 distinct slot 57 G-buffer pixel programs, lowered alone through MeshPixelStage after #2824:

  • s_load with a register offset through the resource heap: 47
  • a v_fma_mix (38) or v_pack_b32_f16 (1) read of a p2 result: 39
  • sampler from a descriptor: 6; other: 3

With the low-half rule, 2 of the 39 stop next at a v_mul_f16 read of the upper half, and 37 at "unmodelled v_interp_p2_f16 result across a branch". The scan carries no state across branches, so a C++ design that tracks the defined half per register across blocks would cover them.

@R0Y00 do you want any of this as notes or tests for the C++ frontend, as a PR against the Python translator, or not at all? I'll hold it until you say.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7192368781 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7192368781). Originally posted by [mumba17](https://github.com/mumba17) on 2026-11-26T12:43:09Z. --- **Held locally during the C++ rewrite: low-half readers of a plain `v_interp_p2_f16` result, plus two notes** I'm not opening a PR, since translator work is paused for the C++ frontend. This is in case any of it is useful there. **1. Low-half readers (local branch, not pushed).** `interp_f16_scan` currently accepts only `v_cvt_f32_f16` as a reader of a plain `p2` destination. The branch also accepts: - a `v_fma_mix*` source with `op_sel_hi` set and `op_sel` clear (a binary16 low half; `Stage.mix` already lowers it as `f16tof32` of bits 15:0); - a `v_pack_b32_f16` source whose `op_sel` bit is clear (lowered with a `0xffff` mask). `v_fma_mix_f32` and `v_pack_b32_f16` also define their whole destination. The high half, a binary32 `fma_mix` source and a `v_fma_mixlo/hi_f16` destination stay refused. It overlaps tedin7's withdrawn #2789 (same `fma_mix` rule) and adds `v_pack_b32_f16`. Tests: four accepted/refused variants in `startup_gfx2hlsl_interp_f16_check.py`, hand-encoded and checked with the translator's decoder (llvm-mc 15 `binary` mode not run locally). Draws on WARP and RTX 3090 (driver 32.0.16.1664, Windows 26300): the `fma_mix` stage exports 1.5 from the low half of `attr0.x`, the `pack` of the `attr0.x` halves exports the vertex word `0xc0003e00`, and a mutant of each must fail. `ctest -j 1 -R "mesh57|mesh_cbv_order|startup_gfx2hlsl"`: 342/342 at d4dfe97b. **2. Soundness gap on main (found by tedin7 in #2789, confirmed at d4dfe97b).** `parse('exp mrt0 v4, v5, v5, v5 done vm')` returns operands `['mrt0 v4', 'v5', ...]`, so the scan never sees the first exported register. A plain `p2` result exported only as channel x is not checked for its undefined upper half. **3. Counts from a local capture (RTX 3090, counts only).** 95 distinct slot 57 G-buffer pixel programs, lowered alone through `MeshPixelStage` after #2824: - `s_load` with a register offset through the resource heap: 47 - a `v_fma_mix` (38) or `v_pack_b32_f16` (1) read of a `p2` result: 39 - `sampler from a descriptor`: 6; other: 3 With the low-half rule, 2 of the 39 stop next at a `v_mul_f16` read of the upper half, and 37 at "unmodelled `v_interp_p2_f16` result across a branch". The scan carries no state across branches, so a C++ design that tracks the defined half per register across blocks would cover them. @R0Y00 do you want any of this as notes or tests for the C++ frontend, as a PR against the Python translator, or not at all? I'll hold it until you say. AI-assisted (Claude Code).
SimSalabimse commented 2026-12-01 08:31:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-12-01T08:31:27Z.


I'm picking up the native side of this: the gfx1013 native graphics frontend still refuses NGG-style vertex shaders (LDS ds_write_b32/ds_read, v_mbcnt, s_sendmsg GS alloc, s_barrier) as a graphics wave/control-flow instruction, and it's the top refusal in my runs.

Plan: recognise the pass-through NGG VS shape only (lane-private LDS slots with a disjointness proof along the lines of tedin7's earlier work, alloc counts equal to the wave counts, identity primitive export) and lower it to a plain VS. Anything not proven stays refused with a specific reason. Linux tests with identity and contrast cases via llvm-mc. I have a first version on my fork (branch local/ngg-vs-passthrough) with Linux tests; it gets a Windows run next, then a draft PR.

Draft PR: #3711

AI-Assisted

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7305431512 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1723#issuecomment-7305431512). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-12-01T08:31:27Z. --- I'm picking up the native side of this: the gfx1013 native graphics frontend still refuses NGG-style vertex shaders (LDS `ds_write_b32`/`ds_read`, `v_mbcnt`, `s_sendmsg` GS alloc, `s_barrier`) as a graphics wave/control-flow instruction, and it's the top refusal in my runs. Plan: recognise the pass-through NGG VS shape only (lane-private LDS slots with a disjointness proof along the lines of tedin7's earlier work, alloc counts equal to the wave counts, identity primitive export) and lower it to a plain VS. Anything not proven stays refused with a specific reason. Linux tests with identity and contrast cases via llvm-mc. I have a first version on my fork (branch local/ngg-vs-passthrough) with Linux tests; it gets a Windows run next, then a draft PR. Draft PR: #3711 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#1716
No description provided.