gfx2hlsl: startup refusals with no open issue or PR (claimable items) #2455

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

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


First-refusal census of locally captured startup shader requests, translated with current main plus a local merge of the open translator PRs. Counts only; the inputs are private and not attached. The items below are the refusals for which I found no open issue or PR. Each is small enough to claim on its own; say so in a comment before starting.

Task status

Check the claim and PR status below before starting work.

  • Compute manifest raises on a sampler with LOD limits. ComputePipeline.manifest() formats the sampler key with '0x%x' after skipping only the cmp prefix, so a key with the lod prefix (added when a sampler carries LOD limits) raises TypeError instead of writing a line. The graphics manifest handles both prefixes (smpc / smpl). Seen on 17 of 2,689 compute requests. Acceptance: a compute program with a LOD-limited constant sampler writes an smpl line (or refuses with a reason), with a control for the plain and comparison forms. The compute loader side of smpl needs checking too. Merged for manifest generation. JVProg’s #2482 landed at b976e8bc. The startup runtime loader remains a separate part of #2490.

  • s_load_dword* through a pointer joined at a branch target (vertex/pixel). 12 of 124 requests once the earlier refusals are lifted. The pointer is an s_mov_b32 copy made dozens of joins earlier and written on no path in between; the dominance rule from #2460 for constants does not cover pointer symbols. Acceptance: the pointer symbol survives a join when its write dominates and no path rewrites it, with a negative control where one arm rewrites it. Claimed. RavenCurseBurg has a source-built reproduction.

  • s_getpc_b64 refused in a pixel stage (4 of 124 requests, same set). Not investigated; the first step is to name the exact form and what consumes the pair. Merged for the diagnostic. ChazY11’s #2484 landed at adf4e3bf. The proven calculated-jump control still translates. General numeric use of the load address remains a separate question.

  • v_cubetc_f32 (and presumably v_cubesc_f32 / v_cubema_f32 / v_cubeid_f32) in compute: 21 of 2,689 requests as first refusal. No handler in gfx2hlsl.py. Acceptance: value checks on the six face cases and the tie cases against the ISA definition. Existing evidence. RavenCurseBurg verified the #2035 prototype. Coordinate a follow-up with the author of #2035 before implementing the same slice.

  • s_mov_b32 inside a block skipped per lane by s_cbranch_execz, defining vcc that is live at the join (compute): 25 of 1,086 requests once #2461 is applied. May belong with the execz item in #2274; listed here so it is not lost. Claimed. Ybucaille is taking the compute skipped-block write.

  • Scalar ALU table short operand lists. ChazY11's #2515 landed at 3e3697f1. The instruction-specific refusal replaces the format exception. The complete-form, guard-removal and separate s_bfm_b32 controls passed on the reviewed head.

Already tracked elsewhere (not duplicated)

Largest groups from the same census and where they live:

  • v_min_u32 with a DPP control (quad_perm, fi:1) in pixel stages: #2023 item H, cross-lane model in #2125.
  • exec writes (s_and_saveexec_b32) inside an execz block in compute: #2274 (in progress there). 351 of 1,086 requests after #2461.
  • buffer_store_format_xyzw / d16 forms: #2022 item B.
  • s_load with a register offset through the resource heap: #2066.
  • LDS (ds_write_*, exchange, fill): #1541, #2404.
  • SDWA v_cndmask_b32: #2391. Lane-mask complements: #2459. Formatted-load proof in compute: #2461. v_readfirstlane_b32 uniform proof: #2446, #2454, #2455.

Refs #870, #2274.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6609942326 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T17:24:33Z. --- First-refusal census of locally captured startup shader requests, translated with current main plus a local merge of the open translator PRs. Counts only; the inputs are private and not attached. The items below are the refusals for which I found no open issue or PR. Each is small enough to claim on its own; say so in a comment before starting. ## Task status Check the claim and PR status below before starting work. - [ ] **Compute manifest raises on a sampler with LOD limits.** `ComputePipeline.manifest()` formats the sampler key with `'0x%x'` after skipping only the `cmp` prefix, so a key with the `lod` prefix (added when a sampler carries LOD limits) raises `TypeError` instead of writing a line. The graphics manifest handles both prefixes (`smpc` / `smpl`). Seen on 17 of 2,689 compute requests. Acceptance: a compute program with a LOD-limited constant sampler writes an `smpl` line (or refuses with a reason), with a control for the plain and comparison forms. The compute loader side of `smpl` needs checking too. **Merged for manifest generation.** JVProg’s #2482 landed at `b976e8bc`. The startup runtime loader remains a separate part of #2490. - [ ] **`s_load_dword*` through a pointer joined at a branch target** (vertex/pixel). 12 of 124 requests once the earlier refusals are lifted. The pointer is an `s_mov_b32` copy made dozens of joins earlier and written on no path in between; the dominance rule from #2460 for constants does not cover pointer symbols. Acceptance: the pointer symbol survives a join when its write dominates and no path rewrites it, with a negative control where one arm rewrites it. **Claimed.** RavenCurseBurg has a [source-built reproduction](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170667798). - [ ] **`s_getpc_b64`** refused in a pixel stage (4 of 124 requests, same set). Not investigated; the first step is to name the exact form and what consumes the pair. **Merged for the diagnostic.** ChazY11’s #2484 landed at `adf4e3bf`. The proven calculated-jump control still translates. General numeric use of the load address remains a separate question. - [ ] **`v_cubetc_f32`** (and presumably `v_cubesc_f32` / `v_cubema_f32` / `v_cubeid_f32`) in compute: 21 of 2,689 requests as first refusal. No handler in `gfx2hlsl.py`. Acceptance: value checks on the six face cases and the tie cases against the ISA definition. **Existing evidence.** RavenCurseBurg [verified the #2035 prototype](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170419048). Coordinate a follow-up with the author of #2035 before implementing the same slice. - [ ] **`s_mov_b32` inside a block skipped per lane by `s_cbranch_execz`, defining `vcc` that is live at the join** (compute): 25 of 1,086 requests once #2461 is applied. May belong with the execz item in #2274; listed here so it is not lost. **Claimed.** Ybucaille is taking the [compute skipped-block write](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7171007401). - [x] **Scalar ALU table short operand lists.** ChazY11's #2515 landed at `3e3697f1`. The instruction-specific refusal replaces the format exception. The complete-form, guard-removal and separate s_bfm_b32 controls passed on the reviewed head. ## Already tracked elsewhere (not duplicated) Largest groups from the same census and where they live: - `v_min_u32` with a DPP control (`quad_perm`, `fi:1`) in pixel stages: #2023 item H, cross-lane model in #2125. - exec writes (`s_and_saveexec_b32`) inside an execz block in compute: #2274 (in progress there). 351 of 1,086 requests after #2461. - `buffer_store_format_xyzw` / `d16` forms: #2022 item B. - `s_load` with a register offset through the resource heap: #2066. - LDS (`ds_write_*`, exchange, fill): #1541, #2404. - SDWA `v_cndmask_b32`: #2391. Lane-mask complements: #2459. Formatted-load proof in compute: #2461. `v_readfirstlane_b32` uniform proof: #2446, #2454, #2455. Refs #870, #2274.
JVProg commented 2026-11-25 18:01:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T17:38:43Z.


I'm claiming the first item, "Compute manifest raises on a sampler with LOD limits". I will reproduce it with a source-built fixture, check the compute loader side of smpl, and cover the plain and comparison forms as controls. The other items stay free.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7169797761 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7169797761). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T17:38:43Z. --- I'm claiming the first item, **"Compute manifest raises on a sampler with LOD limits"**. I will reproduce it with a source-built fixture, check the compute loader side of `smpl`, and cover the plain and comparison forms as controls. The other items stay free. AI-assisted (Claude Code).
JVProg commented 2026-11-25 18:01:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T17:53:09Z.


Update on the first item (compute manifest and LOD-limited samplers), including the loader side.

I opened #2482 for the manifest fix. The stand-in problem remains:

The stand-in does not load compute translations yet. docs/startup-runtime.md says so ("The stand-in does not load the result yet and still creates a placeholder"). So #2482 lets the translator publish the manifest, but does not make that compute pipeline run in the startup runtime, and it does not change the stand-in.

I reproduced the TypeError on 1a0e506d with image_sample_l and image_sample_lz through a constant sampler. In #2482 the graphics and compute manifests share one method for the smp / smpc / smpl lines.

Local checks of those changes on top of 1a0e506d, run before the commit (38517b69; Release, Windows 11 build 26300):

  • The new check in tests/startup_image_sample_lod_check.py fails with the same TypeError without the fix and passes with it. Its controls are a mip-filter-none sampler (smp) and a comparison sampler (smpc).
  • The existing parser and decoder in translated_sampler_bindings.h accept the smpl line. 44 selected sampler and compute CTest tests passed on WARP and an RX 9070 XT (driver 32.0.32029.2010).
  • In a temporary local harness (not part of the fix), I built the static sampler from the compute manifest with that decoder and dispatched three translated shaders on both adapters. All 12 dispatches read the expected mip: with smpl 1, 1 and 2; with the line changed to smp as a control 2, 0 and 0. The D3D12 debug layer was not available in this harness. This does not exercise a runtime load path, because there is none.
  • The test's compute instruction words reuse existing helpers; I did not reassemble them with llvm-mc.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170135897 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170135897). Originally posted by [JVProg](https://github.com/JVProg) on 2026-11-25T17:53:09Z. --- Update on the first item (compute manifest and LOD-limited samplers), including the loader side. **I opened #2482 for the manifest fix. The stand-in problem remains:** **The stand-in does not load compute translations yet.** `docs/startup-runtime.md` says so ("The stand-in does not load the result yet and still creates a placeholder"). So #2482 lets the translator publish the manifest, but does not make that compute pipeline run in the startup runtime, and it does not change the stand-in. I reproduced the `TypeError` on `1a0e506d` with `image_sample_l` and `image_sample_lz` through a constant sampler. In #2482 the graphics and compute manifests share one method for the `smp` / `smpc` / `smpl` lines. Local checks of those changes on top of `1a0e506d`, run before the commit (`38517b69`; Release, Windows 11 build 26300): - The new check in `tests/startup_image_sample_lod_check.py` fails with the same `TypeError` without the fix and passes with it. Its controls are a mip-filter-none sampler (`smp`) and a comparison sampler (`smpc`). - The existing parser and decoder in `translated_sampler_bindings.h` accept the `smpl` line. 44 selected sampler and compute CTest tests passed on WARP and an RX 9070 XT (driver 32.0.32029.2010). - In a temporary local harness (not part of the fix), I built the static sampler from the compute manifest with that decoder and dispatched three translated shaders on both adapters. All 12 dispatches read the expected mip: with `smpl` 1, 1 and 2; with the line changed to `smp` as a control 2, 0 and 0. The D3D12 debug layer was not available in this harness. This does not exercise a runtime load path, because there is none. - The test's compute instruction words reuse existing helpers; I did not reassemble them with `llvm-mc`. AI-assisted (Claude Code).
ChazY11 commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:03:12Z.


Claiming the third item, s_getpc_b64 refused in a pixel stage — the one the census says is "not investigated;
the first step is to name the exact form and what consumes the pair". I will start there rather than at a lowering,
because the deliverable you describe is identification, and I would rather report what the pair feeds than guess at
a semantic.

What I will do, in this order, and report even if the answer is "no small change is possible":

  1. locate the refusal and name the exact form (s_getpc_b64 s[a:b] and any _e32/_e64 variants the decoder
    produces for the captured requests);
  2. find every consumer of the pair in the tree (s_add_u32/s_addc_u32 against a label constant is the usual
    shape, but I will check rather than assume) and whether the value is used as an absolute address, a
    PC-relative delta, or only as a symbol for a table base;
  3. state whether the pair is provably a constant offset from the instruction address (in which case a guarded
    lowering that reuses the existing calculated_pc bookkeeping may be possible) or whether the consumed value
    escapes the model — in which case the refusal stays and the item closes as "correctly refused, reason named".

I have no access to the captured requests themselves, so item 1 will be driven by the decoder and the fixtures in
the tree; if the exact form depends on bytes I cannot see, I will say so instead of inventing one.

Not touching the other four items. Refusal-count context I can reproduce here if it helps: 137-entry Linux check
list all green, 63 startup_gfx2hlsl_* checks green, and the gfx2hlsl family runs on this host without D3D12.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170371169 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170371169). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T18:03:12Z. --- Claiming the third item, **`s_getpc_b64` refused in a pixel stage** — the one the census says is "not investigated; the first step is to name the exact form and what consumes the pair". I will start there rather than at a lowering, because the deliverable you describe is identification, and I would rather report what the pair feeds than guess at a semantic. What I will do, in this order, and report even if the answer is "no small change is possible": 1. locate the refusal and name the exact form (`s_getpc_b64 s[a:b]` and any `_e32`/`_e64` variants the decoder produces for the captured requests); 2. find every consumer of the pair in the tree (`s_add_u32`/`s_addc_u32` against a label constant is the usual shape, but I will check rather than assume) and whether the value is used as an absolute address, a PC-relative delta, or only as a symbol for a table base; 3. state whether the pair is provably a constant offset from the instruction address (in which case a guarded lowering that reuses the existing `calculated_pc` bookkeeping may be possible) or whether the consumed value escapes the model — in which case the refusal stays and the item closes as "correctly refused, reason named". I have no access to the captured requests themselves, so item 1 will be driven by the decoder and the fixtures in the tree; if the exact form depends on bytes I cannot see, I will say so instead of inventing one. Not touching the other four items. Refusal-count context I can reproduce here if it helps: 137-entry Linux check list all green, 63 `startup_gfx2hlsl_*` checks green, and the gfx2hlsl family runs on this host without D3D12. AI-assisted.
ChazY11 commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:10:45Z.


Item 3 is delivered as #2484 (s_getpc_b64 now names the reason instead of reporting the mnemonic alone), and I
will not claim a second item — see the note on item 2 below, which is why.

Item 2 (s_load_dword* through a pointer joined at a branch target): I could not reproduce the refusal shape from
the tree alone, so I am leaving it unclaimed.
What I tried, on main at a6c8d80d, translating synthetic programs
through Stage.translate():

straight line, pointer from two s_mov_b32, then s_load_dword s0, s[4:5], 0x0
  -> refused: s_load through s4 holding ('const', 256)

same program with s_cbranch_scc1 0x10 over one arm, pointer untouched on both
  -> IndexError in my harness (the branch scan needs pipe state I did not reconstruct)

So the tree-side repro of the straight-line case refuses for a reason that is not the join at all: a constant is
not a descriptor, and the message says so. The shape the census reports needs a real descriptor/pointer symbol that
survives a join, and reproducing that needs a program whose pointer comes from a resource binding rather than a
literal — which is exactly the part of my synthetic harness that does not work yet (the IndexError above is my
missing pipe state, not the translator).

Whoever takes it: the acceptance text ("the pointer symbol survives a join when its write dominates and no path
rewrites it, with a negative control where one arm rewrites it") is implementable against
tests/startup_gfx2hlsl_join_symbols_check.py, which already builds the branch/dominance fixtures — that is where I
would start rather than in a bespoke harness, which is what I got wrong here.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170548787 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170548787). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T18:10:45Z. --- Item 3 is delivered as #2484 (`s_getpc_b64` now names the reason instead of reporting the mnemonic alone), and I will not claim a second item — see the note on item 2 below, which is why. **Item 2 (`s_load_dword*` through a pointer joined at a branch target): I could not reproduce the refusal shape from the tree alone, so I am leaving it unclaimed.** What I tried, on `main` at `a6c8d80d`, translating synthetic programs through `Stage.translate()`: ```text straight line, pointer from two s_mov_b32, then s_load_dword s0, s[4:5], 0x0 -> refused: s_load through s4 holding ('const', 256) same program with s_cbranch_scc1 0x10 over one arm, pointer untouched on both -> IndexError in my harness (the branch scan needs pipe state I did not reconstruct) ``` So the tree-side repro of the *straight-line* case refuses for a reason that is not the join at all: a constant is not a descriptor, and the message says so. The shape the census reports needs a real descriptor/pointer symbol that survives a join, and reproducing that needs a program whose pointer comes from a resource binding rather than a literal — which is exactly the part of my synthetic harness that does not work yet (the `IndexError` above is my missing pipe state, not the translator). Whoever takes it: the acceptance text ("the pointer symbol survives a join when its write dominates and no path rewrites it, with a negative control where one arm rewrites it") is implementable against `tests/startup_gfx2hlsl_join_symbols_check.py`, which already builds the branch/dominance fixtures — that is where I would start rather than in a bespoke harness, which is what I got wrong here. AI-assisted.
RavenCurseBurg commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T18:05:14Z.


Compute cube coordinate instructions, verified on three adapters. The existing lowering in #2035 already gives the four correct compute results for the six faces and the finite tie cases below. The PR was closed to shorten the Windows test queue. Its current head is cb8fb26c70.

I assembled an 80-byte gfx1013 compute program with LLVM 15. Eighteen lanes each load a distinct float3 from a raw SRV, compute face ID, S, T and signed major × 2, and write four words to a UAV. The four additional vectors tie X/Y, X/Z, Y/Z and all three axes. Eight more lanes cover every combination of positive and negative zero on X/Y/Z. All eight select +Z, retaining the signs of X, -Y and Z in the three other outputs. The first cube operation on upstream main a6c8d80d is refused with v_cubeid_f32. On #2035 the same bytes translate and compile with DXC cs_6_0.

Output compared on Intel UHD 770, RTX 4060 and WARP Mismatched words per adapter, out of 320
Original translation 0
Face ID reads X and Y in reverse order 5
Change the sign of S 18
Change the sign of T 18
Discard the sign of the major axis 9
Require strict Z-major comparisons 25

The tie control first fails for (4, 2, -4), returning face +X instead of -Z at output word 28. The 320-word comparison includes 248 untouched words. Intel driver 32.0.101.5973, NVIDIA 32.0.15.9579, WARP 10.0.26100.9711. The local debug layer was unavailable.

Source, input vectors, output words and commands. The program only exercises coordinate ALU. The 21 private requests in the census still need a rerun after integration. The standalone test can be taken independently when #2035 is resumed.

Replacement PR. I reran the same 18-thread compute program on #2514 at 7a2887ba. All three adapters matched the 72 result and 248 sentinel words with DXC defaults and with -Gis. All five controls were detected on each adapter. Per-device results and the source adapted to the replacement lowering.

AI-assisted with Codex (GPT-6.2 Astra, xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170419048 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170419048). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T18:05:14Z. --- **Compute cube coordinate instructions, verified on three adapters.** The existing lowering in #2035 already gives the four correct compute results for the six faces and the finite tie cases below. The PR was closed to shorten the Windows test queue. Its current head is cb8fb26c70b35cfb489bde0b1e58faff151d4264. I assembled an 80-byte gfx1013 compute program with LLVM 15. Eighteen lanes each load a distinct float3 from a raw SRV, compute face ID, S, T and signed major × 2, and write four words to a UAV. The four additional vectors tie X/Y, X/Z, Y/Z and all three axes. Eight more lanes cover every combination of positive and negative zero on X/Y/Z. All eight select +Z, retaining the signs of X, -Y and Z in the three other outputs. The first cube operation on upstream main a6c8d80d is refused with `v_cubeid_f32`. On #2035 the same bytes translate and compile with DXC cs_6_0. | Output compared on Intel UHD 770, RTX 4060 and WARP | Mismatched words per adapter, out of 320 | | --- | ---: | | Original translation | 0 | | Face ID reads X and Y in reverse order | 5 | | Change the sign of S | 18 | | Change the sign of T | 18 | | Discard the sign of the major axis | 9 | | Require strict Z-major comparisons | 25 | The tie control first fails for (4, 2, -4), returning face +X instead of -Z at output word 28. The 320-word comparison includes 248 untouched words. Intel driver 32.0.101.5973, NVIDIA 32.0.15.9579, WARP 10.0.26100.9711. The local debug layer was unavailable. [Source, input vectors, output words and commands](https://github.com/RavenCurseBurg/Xbox2Windows/blob/d64262deea85881d675f83e5dfac644708b2222b/tests/measure_compute_cube_faces.py). The program only exercises coordinate ALU. The 21 private requests in the census still need a rerun after integration. The standalone test can be taken independently when #2035 is resumed. **Replacement PR.** I reran the same 18-thread compute program on #2514 at `7a2887ba`. All three adapters matched the 72 result and 248 sentinel words with DXC defaults and with `-Gis`. All five controls were detected on each adapter. [Per-device results and the source adapted to the replacement lowering](https://github.com/R0Y00/Xbox2Windows/pull/2514#issuecomment-7172534499). AI-assisted with Codex (GPT-6.2 Astra, xhigh).
Ybucaille commented 2026-11-25 19:04:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T18:30:43Z.


I'm claiming the fifth item, s_mov_b32 inside a block skipped per lane by s_cbranch_execz, defining vcc that is live at the join (compute). The other items are claimed or delivered (1 JVProg #2482, 2 RavenCurseBurg, 3 ChazY11 #2484, 4 RavenCurseBurg #2035).

Scope, to avoid overlap: #2466 accepts s_and_b64 / s_orn2_b64 with exec at an execz target in vertex and pixel stages, and #2274 covers exec writes inside an execz block in compute. This item is the compute case where the skipped block writes vcc through a scalar move and the join reads it. I will start from a source-built gfx1013 compute fixture that reproduces the refusal on current main (with #2461), then work out what the join must hold for a lane that skipped the block, with a negative control where the value differs between the two paths.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171007401 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7171007401). Originally posted by [Ybucaille](https://github.com/Ybucaille) on 2026-11-25T18:30:43Z. --- I'm claiming the fifth item, **`s_mov_b32` inside a block skipped per lane by `s_cbranch_execz`, defining `vcc` that is live at the join** (compute). The other items are claimed or delivered (1 JVProg #2482, 2 RavenCurseBurg, 3 ChazY11 #2484, 4 RavenCurseBurg #2035). Scope, to avoid overlap: #2466 accepts `s_and_b64` / `s_orn2_b64` with `exec` at an execz target in vertex and pixel stages, and #2274 covers exec writes inside an execz block in compute. This item is the compute case where the skipped block writes `vcc` through a scalar move and the join reads it. I will start from a source-built gfx1013 compute fixture that reproduces the refusal on current `main` (with #2461), then work out what the join must hold for a lane that skipped the block, with a negative control where the value differs between the two paths. AI-assisted (Claude Code).
RavenCurseBurg commented 2026-11-25 19:04:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T18:15:47Z.


I am working on item 2, the pointer copied before a branch target and then used by s_load_dword*.

I reproduced the distinction using a synthetic gfx1013 pixel program, an actual root descriptor table, and the pipeline constructor from tests/startup_gfx2hlsl_join_symbols_check.py. With #2460 (661c9a1a) and #2069 (99e1c69f) merged locally, the straight-line version below gives srv 0 tex2d table 0 32. With the extra conditional blocks, it refuses the load through s24 as joined, even when the second block only writes s30.

s_cmp_eq_u32 s9, 0
s_cbranch_scc1 1
s_mov_b32 s24, 5
s_mov_b32 s26, s8
s_add_u32 s26, s26, 32
s_mov_b32 s24, s26
s_mov_b32 s25, 0
s_cmp_eq_u32 s9, 1
s_cbranch_scc1 1
s_mov_b32 s30, 17
; ... load an image descriptor with s_load_dwordx8 s[16:23], s[24:25], 0 ...

Replacing the final move with s_add_u32 s24, s24, 32 makes the incoming addresses genuinely different and must keep the refusal. Copying the unadvanced entry pointer in the positive fixture already works on both main and #2460. Implementation and Windows results. The forward-branch change is in draft #2507, based on the updated #2069 at a747241f. The incremental commit makes the two equal addresses agree and keeps the differing-address case refused. Five bindings and six refusals passed, all eleven full gfx1013 programs matched their LLVM 15 assembly, and 66 existing translator checks passed. In a separate 350-program comparison, all 49 accepted programs selected the correct binding and all 220 with multiple possible offsets refused. The other 81 were conservative refusals.

The actual guest command list read two distinct textures at byte 0 and 32. On this exact commit, five programs × FXC/DXC × Intel UHD 770 / RTX 4060 / WARP produced 30 images matching all 32 pixels. Deliberately changing only the manifest offset changed all 32 pixels in each of 30 controls. The Windows Server 2025 CPU, FXC WARP and DXC WARP checks also passed. The source-built fixtures establish these cases; private census impact still needs the project-side retest.

AI-assisted with Codex (GPT-6.2 Astra, xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170667798 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7170667798). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T18:15:47Z. --- I am working on item 2, the pointer copied before a branch target and then used by `s_load_dword*`. I reproduced the distinction using a synthetic gfx1013 pixel program, an actual root descriptor table, and the pipeline constructor from `tests/startup_gfx2hlsl_join_symbols_check.py`. With #2460 (`661c9a1a`) and #2069 (`99e1c69f`) merged locally, the straight-line version below gives `srv 0 tex2d table 0 32`. With the extra conditional blocks, it refuses the load through s24 as joined, even when the second block only writes s30. ```asm s_cmp_eq_u32 s9, 0 s_cbranch_scc1 1 s_mov_b32 s24, 5 s_mov_b32 s26, s8 s_add_u32 s26, s26, 32 s_mov_b32 s24, s26 s_mov_b32 s25, 0 s_cmp_eq_u32 s9, 1 s_cbranch_scc1 1 s_mov_b32 s30, 17 ; ... load an image descriptor with s_load_dwordx8 s[16:23], s[24:25], 0 ... ``` Replacing the final move with `s_add_u32 s24, s24, 32` makes the incoming addresses genuinely different and must keep the refusal. Copying the unadvanced entry pointer in the positive fixture already works on both main and #2460. **Implementation and Windows results.** The forward-branch change is in draft [#2507](https://github.com/R0Y00/Xbox2Windows/pull/2507), based on the updated #2069 at `a747241f`. The [incremental commit](https://github.com/RavenCurseBurg/Xbox2Windows/commit/02bdb0297535a48f9cad3bf20ad920eab7cb4947) makes the two equal addresses agree and keeps the differing-address case refused. Five bindings and six refusals passed, all eleven full gfx1013 programs matched their LLVM 15 assembly, and 66 existing translator checks passed. In a separate 350-program comparison, all 49 accepted programs selected the correct binding and all 220 with multiple possible offsets refused. The other 81 were conservative refusals. The actual guest command list read two distinct textures at byte 0 and 32. On this exact commit, five programs × FXC/DXC × Intel UHD 770 / RTX 4060 / WARP produced 30 images matching all 32 pixels. Deliberately changing only the manifest offset changed all 32 pixels in each of 30 controls. The [Windows Server 2025 CPU, FXC WARP and DXC WARP checks](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45680212999) also passed. The source-built fixtures establish these cases; private census impact still needs the project-side retest. AI-assisted with Codex (GPT-6.2 Astra, xhigh).
ChazY11 commented 2026-11-25 20:04:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T19:04:18Z.


A one-source operand list on 35 scalar ALU ops raises IndexError, not a refusal

Found by fuzzing the scalar table rather than by reading: for every opcode in the table, call the handler with one
source instead of two.

Probe().one('s_or_b32', 's_or_b32 s1, s2')
File "tools/startup/gfx2hlsl.py", line 1953, in one
    term = self.lower(base, asm, ops, mods)
File "tools/startup/gfx2hlsl.py", line 2198, in lower
    return self.scalar(base, ops)
File "tools/startup/gfx2hlsl.py", line 2473, in scalar
    expr = text.format(*values)
IndexError: Replacement index 1 out of range for positional args tuple

values has one element because srcs has one, while the template still wants {1}. Per the project's own
convention that is translator crash in <op>: IndexError, not a refusal naming the instruction — the same class
issue #2463 is cataloguing.

How many

单源短形态 → IndexError: 35 个操作码
s_add_i32 s_add_u32 s_and_b32 s_and_b64 s_andn2_b32 s_andn2_b64 s_ashr_i32 s_bfe_u32
s_lshl1_add_u32 s_lshl2_add_u32 s_lshl3_add_u32 s_lshl4_add_u32 s_lshl_b32 s_lshr_b32
s_max_i32 s_max_u32 s_min_i32 s_min_u32 s_mul_hi_u32 s_mul_i32 s_nand_b32 s_nand_b64
s_nor_b32 s_nor_b64 s_or_b32 s_or_b64 s_orn2_b32 s_orn2_b64 s_pack_hh_b32_b16
s_sub_i32 s_sub_u32 s_xnor_b32 s_xnor_b64 s_xor_b32 s_xor_b64

三操作数形态(多一个源):0 个异常

So the three-operand form is fine — the extra source is refused somewhere and the message is well-formed.
Only the short form crashes, and it does so for every op whose template has two placeholders.

Note this is a different dispatch branch from the arity guards in #2469: those fire earlier in lower() for
their own subsets, and s_or_b32 reaches scalar() at line 2198 without passing one. That is why the guards
already on main do not cover this.

Where the guard belongs

Line 2472–2473:

values = [self.u(t) for t in srcs]
expr = text.format(*values)

The handler knows how many placeholders the template needs; a check that len(values) matches the highest index
used in text, raising Unsupported('%s with %d operands, expected %d' % ...), covers all 35 in one place and
uses the message shape the rest of the table already uses. I would put it immediately before text.format rather
than in each handler.

My own mistake, stated so the count is trustworthy

The first pass reported seven more ops (s_mov_b32, s_mov_b64, s_not_b32, s_not_b64, s_brev_b32,
s_sext_i32_i8/i16) failing with AttributeError. That was my probe, not the translator: I gave the probe
masks = {} (a dict) where set_s expects a set, and getattr(self, 'masks', set()).discard(n) does not exist on a
dict. With masks = set() those seven are clean. The 35 above are all IndexError from the format string.

Scope of the measurement

This is the single-instruction handler path, which is what the existing arity fixtures use too. I did not drive a
whole program through translate_request to see the recorded reason string; if you want that as the repro line in
the issue, it is the same call one level up.


If this is in scope for #2463, I can prepare the guard plus a fixture in the shape of startup_gfx2hlsl_scalar_arity_check.py
(all 35 ops, the short form refused with the message, the complete form still translating, and the existing
negative control that disabling the guard brings the IndexError back). Say the word and I will open it against
the handlers you prefer, or leave it to the maintainers of the surrounding work.

AI-assisted; the fuzz pass and the traceback were produced locally on Windows 11 build 26300.9974, no build needed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171780784 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7171780784). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T19:04:18Z. --- ## A one-source operand list on 35 scalar ALU ops raises `IndexError`, not a refusal Found by fuzzing the scalar table rather than by reading: for every opcode in the table, call the handler with one source instead of two. ```python Probe().one('s_or_b32', 's_or_b32 s1, s2') ``` ```text File "tools/startup/gfx2hlsl.py", line 1953, in one term = self.lower(base, asm, ops, mods) File "tools/startup/gfx2hlsl.py", line 2198, in lower return self.scalar(base, ops) File "tools/startup/gfx2hlsl.py", line 2473, in scalar expr = text.format(*values) IndexError: Replacement index 1 out of range for positional args tuple ``` `values` has one element because `srcs` has one, while the template still wants `{1}`. Per the project's own convention that is `translator crash in <op>: IndexError`, not a refusal naming the instruction — the same class issue #2463 is cataloguing. ### How many ```text 单源短形态 → IndexError: 35 个操作码 s_add_i32 s_add_u32 s_and_b32 s_and_b64 s_andn2_b32 s_andn2_b64 s_ashr_i32 s_bfe_u32 s_lshl1_add_u32 s_lshl2_add_u32 s_lshl3_add_u32 s_lshl4_add_u32 s_lshl_b32 s_lshr_b32 s_max_i32 s_max_u32 s_min_i32 s_min_u32 s_mul_hi_u32 s_mul_i32 s_nand_b32 s_nand_b64 s_nor_b32 s_nor_b64 s_or_b32 s_or_b64 s_orn2_b32 s_orn2_b64 s_pack_hh_b32_b16 s_sub_i32 s_sub_u32 s_xnor_b32 s_xnor_b64 s_xor_b32 s_xor_b64 三操作数形态(多一个源):0 个异常 ``` So the three-operand form is fine — the extra source is refused somewhere and the message is well-formed. Only the *short* form crashes, and it does so for every op whose template has two placeholders. Note this is a **different dispatch branch** from the arity guards in #2469: those fire earlier in `lower()` for their own subsets, and `s_or_b32` reaches `scalar()` at line 2198 without passing one. That is why the guards already on `main` do not cover this. ### Where the guard belongs Line 2472–2473: ```python values = [self.u(t) for t in srcs] expr = text.format(*values) ``` The handler knows how many placeholders the template needs; a check that `len(values)` matches the highest index used in `text`, raising `Unsupported('%s with %d operands, expected %d' % ...)`, covers all 35 in one place and uses the message shape the rest of the table already uses. I would put it immediately before `text.format` rather than in each handler. ### My own mistake, stated so the count is trustworthy The first pass reported seven more ops (`s_mov_b32`, `s_mov_b64`, `s_not_b32`, `s_not_b64`, `s_brev_b32`, `s_sext_i32_i8/i16`) failing with `AttributeError`. That was **my probe**, not the translator: I gave the probe `masks = {}` (a dict) where `set_s` expects a set, and `getattr(self, 'masks', set()).discard(n)` does not exist on a dict. With `masks = set()` those seven are clean. The 35 above are all `IndexError` from the format string. ### Scope of the measurement This is the single-instruction handler path, which is what the existing arity fixtures use too. I did not drive a whole program through `translate_request` to see the recorded reason string; if you want that as the repro line in the issue, it is the same call one level up. --- If this is in scope for #2463, I can prepare the guard plus a fixture in the shape of `startup_gfx2hlsl_scalar_arity_check.py` (all 35 ops, the short form refused with the message, the complete form still translating, and the existing negative control that disabling the guard brings the `IndexError` back). Say the word and I will open it against the handlers you prefer, or leave it to the maintainers of the surrounding work. AI-assisted; the fuzz pass and the traceback were produced locally on Windows 11 build 26300.9974, no build needed.
ChazY11 commented 2026-11-25 20:04:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T19:07:40Z.


Prepared the guard and its fixture on a local branch so it is ready if you want it, not opened as a PR and not
pushed — the finding is in the comment above, and the claim is yours to assign.

Branch startup/scalar-table-short-arity, one commit 17f76a58, against 394f24f8:

tools/startup/gfx2hlsl.py                           +  the guard, immediately before `text.format(*values)`
tests/startup_gfx2hlsl_scalar_table_arity_check.py   +  the check
CMakeLists.txt  AGENTS.md  .github/workflows/...     +  the three-way registration

The guard, in scalar():

needed = max((int(i) for i in re.findall(r'\{(\d+)\}', text)), default=-1) + 1
if len(srcs) < needed:
    raise Unsupported('%s with %d operands, expected %d' % (base, len(ops), needed + 1))

Verified here, all pure Python:

python -B tests/startup_gfx2hlsl_scalar_table_arity_check.py
    the SCA table has two-source templates: ok
    no two-source template crashes on a short source list: ok
    every short form is refused with the operand count it needs: ok
    a complete form is never refused for its operand count: ok
    control: without the guard the short form raises IndexError: ok
    the one template with its own arity check still refuses without the guard: ok
    scalar table arity checks: 0 failed

gfx2hlsl family after the change: 67 checks, 0 red
guard text changed to `if False:` -> the check exits 1; restored -> exits 0

One detail the control had to account for: 35 of the 36 templates come back to IndexError with the guard
disabled. s_bfm_b32 stays refused because it carries its own arity message, so the control asserts 35 plus a
separate check that the remaining one still refuses by its own message — rather than counting it as a survivor and
loosening the threshold.

Say whether you want it as a PR, want it folded into another branch, or would rather the maintainers of #2469's
follow-ups take it, and I will act accordingly. If the answer is "leave it", it stays unopened.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171855581 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7171855581). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T19:07:40Z. --- Prepared the guard and its fixture on a local branch so it is ready if you want it, **not opened as a PR** and not pushed — the finding is in the comment above, and the claim is yours to assign. Branch `startup/scalar-table-short-arity`, one commit `17f76a58`, against `394f24f8`: ```text tools/startup/gfx2hlsl.py + the guard, immediately before `text.format(*values)` tests/startup_gfx2hlsl_scalar_table_arity_check.py + the check CMakeLists.txt AGENTS.md .github/workflows/... + the three-way registration ``` The guard, in `scalar()`: ```python needed = max((int(i) for i in re.findall(r'\{(\d+)\}', text)), default=-1) + 1 if len(srcs) < needed: raise Unsupported('%s with %d operands, expected %d' % (base, len(ops), needed + 1)) ``` Verified here, all pure Python: ```text python -B tests/startup_gfx2hlsl_scalar_table_arity_check.py the SCA table has two-source templates: ok no two-source template crashes on a short source list: ok every short form is refused with the operand count it needs: ok a complete form is never refused for its operand count: ok control: without the guard the short form raises IndexError: ok the one template with its own arity check still refuses without the guard: ok scalar table arity checks: 0 failed gfx2hlsl family after the change: 67 checks, 0 red guard text changed to `if False:` -> the check exits 1; restored -> exits 0 ``` One detail the control had to account for: **35 of the 36** templates come back to `IndexError` with the guard disabled. `s_bfm_b32` stays refused because it carries its own arity message, so the control asserts 35 plus a separate check that the remaining one still refuses by its own message — rather than counting it as a survivor and loosening the threshold. Say whether you want it as a PR, want it folded into another branch, or would rather the maintainers of #2469's follow-ups take it, and I will act accordingly. If the answer is "leave it", it stays unopened. AI-assisted.
R0Y00 commented 2026-11-25 20:04:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T19:20:51Z.


ChazY11, please open the scalar short-arity guard as a focused PR against current main, referencing this issue. The complete-form control and the separate s_bfm_b32 refusal cover the two diagnostic paths. Keep the return as an instruction-specific Unsupported, and leave the existing pointer-join and lane-mask claims with their authors.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172169233 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7172169233). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T19:20:51Z. --- ChazY11, please open the scalar short-arity guard as a focused PR against current `main`, referencing this issue. The complete-form control and the separate `s_bfm_b32` refusal cover the two diagnostic paths. Keep the return as an instruction-specific `Unsupported`, and leave the existing pointer-join and lane-mask claims with their authors.
ChazY11 commented 2026-11-25 20:04:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T19:25:06Z.


Opened as requested: #2515, rebased onto 6d2d3bed, one commit.

It keeps the three points you named: the return is the same instruction-specific
Unsupported('%s with %d operands, expected %d') the rest of the table uses; the fixture asserts that a
complete form is never refused for its operand count; and s_bfm_b32 is handled as its own diagnostic path —
the negative control excludes it by name and asserts separately that it still refuses by its own message, rather
than counting it as a survivor.

The pointer-join and lane-mask claims are untouched and stay with their authors.

startup_gfx2hlsl_* family on the branch: 67 checks, 0 red. With the guard turned into if False: the new check
exits 1, restored it exits 0.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172266555 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2463#issuecomment-7172266555). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T19:25:06Z. --- Opened as requested: [#2515](https://github.com/R0Y00/Xbox2Windows/pull/2515), rebased onto `6d2d3bed`, one commit. It keeps the three points you named: the return is the same instruction-specific `Unsupported('%s with %d operands, expected %d')` the rest of the table uses; the fixture asserts that a **complete** form is never refused for its operand count; and `s_bfm_b32` is handled as its own diagnostic path — the negative control excludes it by name and asserts separately that it still refuses by its own message, rather than counting it as a survivor. The pointer-join and lane-mask claims are untouched and stay with their authors. `startup_gfx2hlsl_*` family on the branch: 67 checks, 0 red. With the guard turned into `if False:` the new check exits 1, restored it exits 0. 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#2455
No description provided.