compute_store_aot: accept two-exit compute programs, then lower a guarded read–compute–write kernel #715

Open
opened 2026-11-22 22:46:01 +00:00 by roansystemlabs · 23 comments
roansystemlabs commented 2026-11-22 22:46:01 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-22T22:46:01Z.


Problem

After #708, the next compute stops in the fixed-profile archive rescan (docs/experiments.md) are:

  • 1,002 of 2,689 CS records stop at "Unverified multi-exit program". pixel_aot.container_code() accepts a second s_endpgm only for pixel programs (stage == 0 and markers == 2, verified by _check_two_exits from #477). Every compute (and mesh) program with more than one exit is rejected before any instruction is lowered. The compute_store_aot CLI also calls container_code(..., stage=5) without llvm, which the two-exit check needs.
  • 621 CS records pass extraction but stop at the fixed store lowering. compute_store_aot stores known words (immediates, constant-buffer words or the dispatch-thread index) into one raw UAV. It has no vector memory reads, no general ALU and no control flow. Address forms such as a v_mad_u32_u24 row pitch are rejected.
  • Overlap with #708. shader_profile_audit.classify() reads the PSV0 group size before it calls container_code(). The 1,054 records that stopped at thread-group dimensions were never checked for exits, so some of them will now stop at the multi-exit check. We cannot measure that overlap without the archive.

For pixel programs, docs/experiments.md reports that 5,465 of 6,189 multi-marker records (88%) had exactly two markers. If compute looks similar, the two-exit case covers most of the 1,002, but that is an assumption until counted.

Proposal

The goal is the first real compute kernel from the console format: an edge guard, a buffer read, some arithmetic and a guarded store, dispatched as 8×8 groups and verified on hardware. We would do it in small PRs, each one reviewable on its own, and start each step only after the previous one has landed.

  1. Exits. Let compute (stage == 5) use the same _check_two_exits verifier and rules as #477: a direct branch to the block after the early exit, skipped alignment NOPs allowed, and rejection of unresolved transfers, branches into literals or padding, and disconnected blocks. The compute_store_aot CLI would pass llvm through. Source-built two-exit compute fixtures would get the same negative controls as the pixel ones. This step extracts the code span only; lowering comes next. Mesh (stage == 13) stays as it is.

  2. Guard. Lower the early exit in compute_store_aot, in two forms:

    • (a) a wave-uniform condition (s_cmp* + s_cbranch_scc0/1 around the early s_endpgm) becomes if (cond) return;;
    • (b) a per-lane condition (v_cmp* + s_and_saveexec_b64, with an exec branch around the early s_endpgm) becomes a store guarded by if.

    The exact branch shapes would come from the LLVM 15 compile of source kernels (see Verification) before any lowering code. Stores are side effects, so the per-lane select of #338 option A (#651) does not apply here; the guard has to be a real branch. Everything outside these two forms is rejected.

  3. Reads. buffer_load_dword (idxen/offen) from another caller-bound buffer descriptor, with vmcnt waits tracked like the current lgkmcnt waits.

  4. Arithmetic. A small integer and float subset for addresses and values (add, mul, mad, shifts, min/max, v_mad_u32_u24 row pitch). See question 2.

  5. First kernel. A complete guarded read, compute and write kernel with 8×8 groups and a 2D dispatch, with half of the threads out of range. After this PR, we would ask you for a CS rescan.

Alternatives

  • Wait for the compute stage of the SPIR-V bridge. It is a separate path; this proposal only extends the existing compute_store_aot profile, one verified form at a time.
  • Lower general compute control flow (else branches, nesting, loops) at once. That is a larger review and a design question; the two guard forms above are the smallest step that a typical if (id >= n) return; kernel needs.

Verification

All inputs are source-built synthetic kernels; no game files.

  • Assembly: gfx1013 fixtures are written in LLVM 15 syntax and assembled and decoded with llvm-mc-15 / libLLVM-15.so.1 in the Ubuntu CI job. For the exit and guard forms, we would include the LLVM 15 compile and disassembly of small source kernels (llc-15 -mcpu=gfx1013) with uniform and per-lane early returns. The PR would quote the exact commands.
  • GPU checks: full-buffer readback, bit for bit, against an independent per-invocation model, on _warp and _hardware. Hardware runs use an RTX 3070 on Windows 11 with the D3D12 debug layer on; each PR records the commit, driver, Windows build and GPU load. We also run the pure-Python checks from AGENTS.md.
  • Negative controls:
    • exits: wrong branch target, a branch into a literal, a disconnected exit;
    • guard: inverted condition, guard ignored, wrong bound;
    • reads: swapped source and destination descriptors, wrong offset;
    • every step: a changed guard word.
  • Census: fixture results are reported separately from any archive rescan, as you asked on #701.

Limits stated up front:

  • We do not have the archive. The census numbers above are yours, and the effect of each step needs a maintainer rescan.
  • Steps 3 to 5 will meet instructions that are not lowered yet. Many records will move to a later first stop rather than complete.

Questions

  1. Exit count. Could you share the end-marker histogram for the 1,002 multi-exit CS records, as docs/experiments.md does for pixel (two/three/four/five markers and the most common layout)? It tells us whether step 1 should stay two-exit only.
  2. ALU. For step 4, should compute reuse the pixel_aot ALU lowering, or keep a small separate subset inside compute_store_aot? We will follow your choice.
  3. #477. You wrote the two-exit verifier. Would you rather extend it to compute yourself? Then we would start from step 2 once that lands.

AI-assisted: yes

Checklist

  • I checked for an existing issue or pull request for this change. (No open PR touches tools/compute_store_aot.py, tests/compute_store_check.py or tools/shader_profile_audit.py. No issue or PR mentions multi-exit or early-exit compute. #477 covers pixel programs only. #606 adds a compute fallback for mesh draws, in other files.)
  • I did not include game files, dumps, distribution links or credentials.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6548803647 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-22T22:46:01Z. --- ### Problem After #708, the next compute stops in the fixed-profile archive rescan (`docs/experiments.md`) are: - **1,002 of 2,689 CS records** stop at "Unverified multi-exit program". `pixel_aot.container_code()` accepts a second `s_endpgm` only for pixel programs (`stage == 0 and markers == 2`, verified by `_check_two_exits` from #477). Every compute (and mesh) program with more than one exit is rejected before any instruction is lowered. The `compute_store_aot` CLI also calls `container_code(..., stage=5)` without `llvm`, which the two-exit check needs. - **621 CS records** pass extraction but stop at the fixed store lowering. `compute_store_aot` stores known words (immediates, constant-buffer words or the dispatch-thread index) into one raw UAV. It has no vector memory reads, no general ALU and no control flow. Address forms such as a `v_mad_u32_u24` row pitch are rejected. - **Overlap with #708.** `shader_profile_audit.classify()` reads the PSV0 group size before it calls `container_code()`. The 1,054 records that stopped at thread-group dimensions were never checked for exits, so some of them will now stop at the multi-exit check. We cannot measure that overlap without the archive. For pixel programs, `docs/experiments.md` reports that 5,465 of 6,189 multi-marker records (88%) had exactly two markers. If compute looks similar, the two-exit case covers most of the 1,002, but that is an assumption until counted. ### Proposal The goal is the first real compute kernel from the console format: an edge guard, a buffer read, some arithmetic and a guarded store, dispatched as 8×8 groups and verified on hardware. We would do it in small PRs, each one reviewable on its own, and start each step only after the previous one has landed. 1. **Exits.** Let compute (`stage == 5`) use the same `_check_two_exits` verifier and rules as #477: a direct branch to the block after the early exit, skipped alignment NOPs allowed, and rejection of unresolved transfers, branches into literals or padding, and disconnected blocks. The `compute_store_aot` CLI would pass `llvm` through. Source-built two-exit compute fixtures would get the same negative controls as the pixel ones. This step extracts the code span only; lowering comes next. Mesh (`stage == 13`) stays as it is. 2. **Guard.** Lower the early exit in `compute_store_aot`, in two forms: - (a) a wave-uniform condition (`s_cmp*` + `s_cbranch_scc0/1` around the early `s_endpgm`) becomes `if (cond) return;`; - (b) a per-lane condition (`v_cmp*` + `s_and_saveexec_b64`, with an exec branch around the early `s_endpgm`) becomes a store guarded by `if`. The exact branch shapes would come from the LLVM 15 compile of source kernels (see Verification) before any lowering code. Stores are side effects, so the per-lane select of #338 option A (#651) does not apply here; the guard has to be a real branch. Everything outside these two forms is rejected. 3. **Reads.** `buffer_load_dword` (idxen/offen) from another caller-bound buffer descriptor, with `vmcnt` waits tracked like the current `lgkmcnt` waits. 4. **Arithmetic.** A small integer and float subset for addresses and values (add, mul, mad, shifts, min/max, `v_mad_u32_u24` row pitch). See question 2. 5. **First kernel.** A complete guarded read, compute and write kernel with 8×8 groups and a 2D dispatch, with half of the threads out of range. After this PR, we would ask you for a CS rescan. ### Alternatives - Wait for the compute stage of the SPIR-V bridge. It is a separate path; this proposal only extends the existing `compute_store_aot` profile, one verified form at a time. - Lower general compute control flow (else branches, nesting, loops) at once. That is a larger review and a design question; the two guard forms above are the smallest step that a typical `if (id >= n) return;` kernel needs. ### Verification All inputs are source-built synthetic kernels; no game files. - **Assembly:** gfx1013 fixtures are written in LLVM 15 syntax and assembled and decoded with `llvm-mc-15` / `libLLVM-15.so.1` in the Ubuntu CI job. For the exit and guard forms, we would include the LLVM 15 compile and disassembly of small source kernels (`llc-15 -mcpu=gfx1013`) with uniform and per-lane early returns. The PR would quote the exact commands. - **GPU checks:** full-buffer readback, bit for bit, against an independent per-invocation model, on `_warp` and `_hardware`. Hardware runs use an RTX 3070 on Windows 11 with the D3D12 debug layer on; each PR records the commit, driver, Windows build and GPU load. We also run the pure-Python checks from `AGENTS.md`. - **Negative controls:** - exits: wrong branch target, a branch into a literal, a disconnected exit; - guard: inverted condition, guard ignored, wrong bound; - reads: swapped source and destination descriptors, wrong offset; - every step: a changed guard word. - **Census:** fixture results are reported separately from any archive rescan, as you asked on #701. Limits stated up front: - We do not have the archive. The census numbers above are yours, and the effect of each step needs a maintainer rescan. - Steps 3 to 5 will meet instructions that are not lowered yet. Many records will move to a later first stop rather than complete. ### Questions 1. **Exit count.** Could you share the end-marker histogram for the 1,002 multi-exit CS records, as `docs/experiments.md` does for pixel (two/three/four/five markers and the most common layout)? It tells us whether step 1 should stay two-exit only. 2. **ALU.** For step 4, should compute reuse the `pixel_aot` ALU lowering, or keep a small separate subset inside `compute_store_aot`? We will follow your choice. 3. **#477.** You wrote the two-exit verifier. Would you rather extend it to compute yourself? Then we would start from step 2 once that lands. AI-assisted: yes ### Checklist - [x] I checked for an existing issue or pull request for this change. (No open PR touches `tools/compute_store_aot.py`, `tests/compute_store_check.py` or `tools/shader_profile_audit.py`. No issue or PR mentions multi-exit or early-exit compute. #477 covers pixel programs only. #606 adds a compute fallback for mesh draws, in other files.) - [x] I did not include game files, dumps, distribution links or credentials.
R0Y00 commented 2026-11-24 06:48:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T22:57:44Z.


Please start with the source-built two-exit extraction PR. Reuse #477's branch and instruction-boundary checks, keep the stage and exact-marker limit explicit, and have the compute CLI and audit pass through LLVM. Include wrong-target, literal/padding and disconnected-exit controls. No new compute marker histogram is available here, so keep the counts separate from expected coverage. For a later lowering PR, model a per-lane guard as actual control flow around memory side effects. Keep the initial ALU subset small, reusing individual helpers only when their semantics match. The extraction PR can proceed independently of that decision.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7087207580 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7087207580). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T22:57:44Z. --- Please start with the source-built two-exit extraction PR. Reuse #477's branch and instruction-boundary checks, keep the stage and exact-marker limit explicit, and have the compute CLI and audit pass through LLVM. Include wrong-target, literal/padding and disconnected-exit controls. No new compute marker histogram is available here, so keep the counts separate from expected coverage. For a later lowering PR, model a per-lane guard as actual control flow around memory side effects. Keep the initial ALU subset small, reusing individual helpers only when their semantics match. The extraction PR can proceed independently of that decision.
roansystemlabs commented 2026-11-24 06:48:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-22T23:19:05Z.


Thanks. Starting the source-built two-exit extraction PR now, scoped exactly as above (extraction only; the per-lane guard and ALU subset stay for later PRs). I'll link it here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7087482859 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7087482859). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-22T23:19:05Z. --- Thanks. Starting the source-built two-exit extraction PR now, scoped exactly as above (extraction only; the per-lane guard and ALU subset stay for later PRs). I'll link it here.
roansystemlabs commented 2026-11-24 06:48:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-22T23:23:27Z.


To keep the plan visible: we intend to carry the whole sequence in this issue ourselves, one small PR at a time (two-exit extraction → per-lane guard as control flow → vector reads → small ALU subset → first read–compute–write kernel), each opened only after the previous one is reviewed. The extraction PR is in progress now.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7087537833 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7087537833). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-22T23:23:27Z. --- To keep the plan visible: we intend to carry the whole sequence in this issue ourselves, one small PR at a time (two-exit extraction → per-lane guard as control flow → vector reads → small ALU subset → first read–compute–write kernel), each opened only after the previous one is reviewed. The extraction PR is in progress now.
roansystemlabs commented 2026-11-24 06:48:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T00:03:22Z.


Step 1 is up: #738 (extraction only; no lowering). The per-lane guard comes next, as control flow around the store.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7088027229 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7088027229). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T00:03:22Z. --- Step 1 is up: #738 (extraction only; no lowering). The per-lane guard comes next, as control flow around the store.
roansystemlabs commented 2026-11-24 06:48:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T00:47:46Z.


Thanks for merging #738. Step 2 (the per-lane guard as control flow around the store) is next.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7088639973 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7088639973). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T00:47:46Z. --- Thanks for merging #738. Step 2 (the per-lane guard as control flow around the store) is next.
R0Y00 commented 2026-11-24 06:48:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T00:50:53Z.


Step 1 merged in #738 after the SPIR-V cache repair. Source-built LLVM 15 fixtures now exercise the #477 verifier for two-exit compute programs. This is extraction only, with no new archive count. The per-lane guard can proceed around the store as discussed, and this issue remains open for the later steps.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7088681012 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7088681012). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T00:50:53Z. --- Step 1 merged in #738 after the SPIR-V cache repair. Source-built LLVM 15 fixtures now exercise the #477 verifier for two-exit compute programs. This is extraction only, with no new archive count. The per-lane guard can proceed around the store as discussed, and this issue remains open for the later steps.
roansystemlabs commented 2026-11-24 06:48:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T02:18:15Z.


Step 2 is up: #776 (per-lane guard lowered as an if around the masked stores; unmasked stores after the exec restore stay outside). Vector reads come next.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7089829374 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7089829374). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T02:18:15Z. --- Step 2 is up: #776 (per-lane guard lowered as an `if` around the masked stores; unmasked stores after the exec restore stay outside). Vector reads come next.
R0Y00 commented 2026-11-24 06:48:58 +00:00 (Migrated from github.com)
Author
Contributor

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


#776 merged as e861e7e. The LLVM 15 fixtures now verify both guard shapes: masked stores to exit and a restored mask with later unconditional stores. WARP and RTX compared the buffers, and both Windows configurations and both Linux checks passed. This covers the store-guard step. The issue stays open for vector reads and the combined read–compute–write fixture.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7090458262 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7090458262). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T03:05:53Z. --- #776 merged as `e861e7e`. The LLVM 15 fixtures now verify both guard shapes: masked stores to exit and a restored mask with later unconditional stores. WARP and RTX compared the buffers, and both Windows configurations and both Linux checks passed. This covers the store-guard step. The issue stays open for vector reads and the combined read–compute–write fixture.
roansystemlabs commented 2026-11-24 06:48:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T03:27:13Z.


Step 3 is up: #788 (vector reads from a caller-bound source buffer, copied to the store; builds on the guard from #776). The small ALU subset and the combined read–compute–write fixture come next.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7090755700 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7090755700). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T03:27:13Z. --- Step 3 is up: #788 (vector reads from a caller-bound source buffer, copied to the store; builds on the guard from #776). The small ALU subset and the combined read–compute–write fixture come next.
R0Y00 commented 2026-11-24 06:48:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T04:25:00Z.


#788 merged as b5e2c5c. The guarded raw and indexed reads now copy one word from caller-bound t0 to u0, and the binding requires stable input bytes disjoint from the writes. Both Windows configurations and both Linux jobs passed. The next slice is the small ALU subset and one combined read–compute–write fixture, using the same guard and source-buffer contract.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7091562443 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7091562443). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T04:25:00Z. --- #788 merged as `b5e2c5c`. The guarded raw and indexed reads now copy one word from caller-bound t0 to u0, and the binding requires stable input bytes disjoint from the writes. Both Windows configurations and both Linux jobs passed. The next slice is the small ALU subset and one combined read–compute–write fixture, using the same guard and source-buffer contract.
roansystemlabs commented 2026-11-24 06:49:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T05:19:26Z.


Thanks. We're taking step 4: the small ALU subset plus one combined read–compute–write fixture, on the #776 guard and the #788 source-buffer contract, with LLVM 15 gfx1013 fixtures and full readbacks on WARP and RTX 3070 under the debug layer. PR to follow.

AI-assisted: yes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7092306689 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7092306689). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T05:19:26Z. --- Thanks. We're taking step 4: the small ALU subset plus one combined read–compute–write fixture, on the #776 guard and the #788 source-buffer contract, with LLVM 15 gfx1013 fixtures and full readbacks on WARP and RTX 3070 under the debug layer. PR to follow. AI-assisted: yes.
roansystemlabs commented 2026-11-24 06:49:07 +00:00 (Migrated from github.com)
Author
Contributor

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


Step 4 is up: #835. It accepts four LLVM 15 gfx1013 instructions between a guarded t0 read and the u0 store (v_and_b32, v_lshrrev_b32, v_mad_u32_u24, v_min_u32), reusing the pixel_aot models only where the semantics are identical, with one combined read–compute–write fixture built from source. RTX 3070 and WARP with the debug layer: 23 full readbacks each, no mismatches. Every other opcode stops with an explicit error. Add, mul_lo, left shifts, max and float are left for later slices, one fixture each.

AI-assisted: yes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7097305426 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7097305426). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T09:57:16Z. --- Step 4 is up: #835. It accepts four LLVM 15 gfx1013 instructions between a guarded t0 read and the u0 store (`v_and_b32`, `v_lshrrev_b32`, `v_mad_u32_u24`, `v_min_u32`), reusing the `pixel_aot` models only where the semantics are identical, with one combined read–compute–write fixture built from source. RTX 3070 and WARP with the debug layer: 23 full readbacks each, no mismatches. Every other opcode stops with an explicit error. Add, mul_lo, left shifts, max and float are left for later slices, one fixture each. AI-assisted: yes.
R0Y00 commented 2026-11-24 06:49:07 +00:00 (Migrated from github.com)
Author
Contributor

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


#835 is merged. The source-built guarded read–compute–write fixture now exercises the four ALU forms on the existing t0/u0 bindings, with full readback and negative controls. The issue remains open for the other arithmetic forms and the audit. The current MAD fixture uses 16-bit multiplicands, so the 24-bit truncation is covered by the generated-code check. A future GPU case with nonzero bits above bit 23 could distinguish that behavior independently.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7097792691 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7097792691). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T10:20:02Z. --- #835 is merged. The source-built guarded read–compute–write fixture now exercises the four ALU forms on the existing t0/u0 bindings, with full readback and negative controls. The issue remains open for the other arithmetic forms and the audit. The current MAD fixture uses 16-bit multiplicands, so the 24-bit truncation is covered by the generated-code check. A future GPU case with nonzero bits above bit 23 could distinguish that behavior independently.
R0Y00 commented 2026-11-24 06:49:12 +00:00 (Migrated from github.com)
Author
Contributor

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


The missing GPU witness is up in #862. It keeps the original 16-bit-factor fixture and adds one guarded lane with bit 24 set in one factor and bit 25 in the other. WARP and RTX both produced 0x0df050e1 and left the other 319 words untouched. Removing either source truncation made word 0 differ (0xfef050e1 or 0xeff050e1). The remaining read–compute–write scope in this issue stays open.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7104165999 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7104165999). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T14:32:58Z. --- The missing GPU witness is up in #862. It keeps the original 16-bit-factor fixture and adds one guarded lane with bit 24 set in one factor and bit 25 in the other. WARP and RTX both produced 0x0df050e1 and left the other 319 words untouched. Removing either source truncation made word 0 differ (0xfef050e1 or 0xeff050e1). The remaining read–compute–write scope in this issue stays open.
Jess-Doit commented 2026-11-24 06:49:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T16:37:05Z.


I’ll take the guarded compute v_mul_lo_u32 slice from the remaining integer ALU work. I’ll extend #835’s source-built t0 read → guarded multiply → u0 store fixture and compare the full readback with a CPU reference, including a wrapping product, operands with bits above bit 23, and unchanged words for inactive lanes.

Environment: Windows 10 22H2 (19045), GTX 1060 6 GB and WARP, Debug and Release. #898 also touches the compute translator and tests for its separate LDS operations. I’ll check the two diffs together before review. The pixel multiply work in #532/#678 is outside this slice.

AI-assisted (Codex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107411713 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7107411713). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-23T16:37:05Z. --- I’ll take the guarded compute `v_mul_lo_u32` slice from the remaining integer ALU work. I’ll extend #835’s source-built t0 read → guarded multiply → u0 store fixture and compare the full readback with a CPU reference, including a wrapping product, operands with bits above bit 23, and unchanged words for inactive lanes. Environment: Windows 10 22H2 (19045), GTX 1060 6 GB and WARP, Debug and Release. #898 also touches the compute translator and tests for its separate LDS operations. I’ll check the two diffs together before review. The pixel multiply work in #532/#678 is outside this slice. AI-assisted (Codex).
roansystemlabs commented 2026-11-24 06:49:31 +00:00 (Migrated from github.com)
Author
Contributor

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


Before the next arithmetic slice: could you rerun the compute audit on the current main, now that two-exit extraction, the guard, reads and the first ALU subset (#835, #862) have landed? The README still shows 12 of 2,689 compute shaders, and the first-rejection histogram would tell us which form unblocks the most next.

Once we have it, we'd take v_add_u32, v_lshlrev_b32 and v_max_u32 one fixture each, in the same shape as #835 (LLVM 15 encodings, full readback on RTX 3070 + WARP, mutations), leaving v_mul_lo_u32 to @Jess-Doit and checking overlap with #929–#954 first.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7111109815 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7111109815). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-23T19:06:47Z. --- Before the next arithmetic slice: could you rerun the compute audit on the current `main`, now that two-exit extraction, the guard, reads and the first ALU subset (#835, #862) have landed? The README still shows 12 of 2,689 compute shaders, and the first-rejection histogram would tell us which form unblocks the most next. Once we have it, we'd take `v_add_u32`, `v_lshlrev_b32` and `v_max_u32` one fixture each, in the same shape as #835 (LLVM 15 encodings, full readback on RTX 3070 + WARP, mutations), leaving `v_mul_lo_u32` to @Jess-Doit and checking overlap with #929–#954 first. _AI-assisted._
Jess-Doit commented 2026-11-24 06:49:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T19:45:02Z.


The guarded compute v_mul_lo_u32 slice landed in #909 as 4fbf91d. Its source-built readback passed on GTX 1060 and in-box WARP in Debug and Release, including the operand truncation and inactive-lane controls. This completes the multiply slice.

AI-assisted (Codex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7112050182 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7112050182). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-23T19:45:02Z. --- The guarded compute `v_mul_lo_u32` slice landed in #909 as `4fbf91d`. Its source-built readback passed on GTX 1060 and in-box WARP in Debug and Release, including the operand truncation and inactive-lane controls. This completes the multiply slice. AI-assisted (Codex).
tedin7 commented 2026-11-24 06:49:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T01:04:40Z.


Claiming the scalar-ALU slice for compute_store_aot (s_add_u32, s_sub_u32, s_and/or/xor_b32, s_lshr_b32 on the constant word), already open as #1090, with a dedicated readback and independent CPU reference. Environment: Linux with LLVM 19 locally; I rely on the Ubuntu LLVM 15 job and the Windows WARP jobs for the rest. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7118730068 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7118730068). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T01:04:40Z. --- Claiming the scalar-ALU slice for compute_store_aot (s_add_u32, s_sub_u32, s_and/or/xor_b32, s_lshr_b32 on the constant word), already open as #1090, with a dedicated readback and independent CPU reference. Environment: Linux with LLVM 19 locally; I rely on the Ubuntu LLVM 15 job and the Windows WARP jobs for the rest. AI-assisted.
tedin7 commented 2026-11-24 06:50:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T01:13:34Z.


Claiming the vector-shift/subtract slice for compute_store_aot (v_lshlrev_b32, v_ashrrev_i32, v_sub_nc_u32, v_subrev_nc_u32), with a dedicated readback and independent CPU reference. Environment: Linux with LLVM 19 locally; I rely on the Ubuntu LLVM 15 job and the Windows WARP jobs for the rest. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7118886916 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7118886916). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T01:13:34Z. --- Claiming the vector-shift/subtract slice for compute_store_aot (v_lshlrev_b32, v_ashrrev_i32, v_sub_nc_u32, v_subrev_nc_u32), with a dedicated readback and independent CPU reference. Environment: Linux with LLVM 19 locally; I rely on the Ubuntu LLVM 15 job and the Windows WARP jobs for the rest. AI-assisted.
tedin7 commented 2026-11-24 06:50:09 +00:00 (Migrated from github.com)
Author
Contributor

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


Claiming the binary32 vector ALU slice for compute_store_aot: v_add_f32_e32, v_sub_f32_e32, v_subrev_f32_e32 and v_mul_f32_e32, with a dedicated 320-word readback, an independent CPU model that rounds each step to binary32, and one negative control per form. Fused multiply-add (v_fma_f32, v_fmac_f32_e32) stays refused because DXIL has no binary32 form with a guaranteed single rounding; NaN, infinity and denormals are not claimed. Environment: Linux with LLVM 15 and 19 locally; I rely on the Windows WARP jobs for the readback. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120064357 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7120064357). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:21:57Z. --- Claiming the binary32 vector ALU slice for compute_store_aot: v_add_f32_e32, v_sub_f32_e32, v_subrev_f32_e32 and v_mul_f32_e32, with a dedicated 320-word readback, an independent CPU model that rounds each step to binary32, and one negative control per form. Fused multiply-add (v_fma_f32, v_fmac_f32_e32) stays refused because DXIL has no binary32 form with a guaranteed single rounding; NaN, infinity and denormals are not claimed. Environment: Linux with LLVM 15 and 19 locally; I rely on the Windows WARP jobs for the readback. AI-assisted.
henriazz10 commented 2026-11-24 21:01:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by henriazz10 on 2026-11-24T20:21:10Z.


I'd like to take five more ALU slices for compute_store_aot (gfx1013), as five separate PRs. Each one lowers only known words, and refuses modifiers it does not model (clamp, omod, neg/abs where not stated).

  1. s_bfe_u32 / s_bfe_i32. Scalar bit-field extract on known words. The offset is S1[4:0] and the width is S1[22:16], per the ISA, including a width of 0 and an offset plus width past 32. SCC is unread, as in the existing scalar ALU subset.
  2. s_add_i32 / s_sub_i32 / s_abs_i32. Signed scalar add, subtract and absolute value on known words, with wrap-around results. SCC (signed overflow) stays unread.
  3. v_add_nc_i32 / v_sub_nc_i32. The VOP3 signed vector add and subtract without carry-out. The clamp forms are refused.
  4. v_ldexp_f32. binary32 S0 * 2^S1, with an exact CPU model covering overflow to infinity, underflow, denormals as handled by the existing f32 profile, NaN and infinity inputs, and large exponents.
  5. v_cvt_u32_f32. float to uint32 with RDNA2 saturation: NaN gives 0, negative values give 0, values of 2^32 and above give 0xffffffff, and the rest truncate toward zero. A CPU model covers the edge inputs.

For each slice:

  • a source-built fixture with a Python reference;
  • reference controls and recompiled-HLSL controls;
  • draws on WARP and hardware;
  • the LLVM 15 round trip.

None of these overlaps the open scalar-ALU, shift/subtract, binary32 add/sub/mul or neg/abs PRs.

AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) writes them, and Claude Code reviews them.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7143412663 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7143412663). Originally posted by [henriazz10](https://github.com/henriazz10) on 2026-11-24T20:21:10Z. --- I'd like to take five more ALU slices for `compute_store_aot` (gfx1013), as five separate PRs. Each one lowers only known words, and refuses modifiers it does not model (`clamp`, `omod`, neg/abs where not stated). 1. **`s_bfe_u32` / `s_bfe_i32`.** Scalar bit-field extract on known words. The offset is `S1[4:0]` and the width is `S1[22:16]`, per the ISA, including a width of 0 and an offset plus width past 32. SCC is unread, as in the existing scalar ALU subset. 2. **`s_add_i32` / `s_sub_i32` / `s_abs_i32`.** Signed scalar add, subtract and absolute value on known words, with wrap-around results. SCC (signed overflow) stays unread. 3. **`v_add_nc_i32` / `v_sub_nc_i32`.** The VOP3 signed vector add and subtract without carry-out. The `clamp` forms are refused. 4. **`v_ldexp_f32`.** binary32 `S0 * 2^S1`, with an exact CPU model covering overflow to infinity, underflow, denormals as handled by the existing f32 profile, NaN and infinity inputs, and large exponents. 5. **`v_cvt_u32_f32`.** float to uint32 with RDNA2 saturation: NaN gives 0, negative values give 0, values of 2^32 and above give `0xffffffff`, and the rest truncate toward zero. A CPU model covers the edge inputs. For each slice: - a source-built fixture with a Python reference; - reference controls and recompiled-HLSL controls; - draws on WARP and hardware; - the LLVM 15 round trip. None of these overlaps the open scalar-ALU, shift/subtract, binary32 add/sub/mul or neg/abs PRs. AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) writes them, and Claude Code reviews them.
henriazz10 commented 2026-11-24 21:27:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by henriazz10 on 2026-11-24T21:20:06Z.


I'd like to take five more ALU slices for compute_store_aot (gfx1013). They will be five separate PRs, opened one at a time. Each lowers only known words and refuses clamp, omod and source modifiers that it does not model.

  1. v_add_co_u32 with v_add_co_ci_u32. This is the 64-bit add pattern: the carry-out goes to VCC (or an SGPR) and the next add reads it as carry-in. The carry is tracked per lane as the translator's known value of the carry SGPR. Any other reader of that SGPR is refused.
  2. v_sub_co_u32 / v_subrev_co_u32 with v_sub_co_ci_u32 / v_subrev_co_ci_u32. The same pattern for borrows.
  3. v_frexp_mant_f32 and v_frexp_exp_i32_f32. These follow the ISA definitions for zero, infinity and NaN. They use the f32 profile's literal refusals, and the denormal assumption is stated as in the v_ldexp_f32 PR.
  4. v_dot2_u32_u16 and v_dot4_u32_u8. Unsigned integer dot products with accumulation, wrapping at 32 bits. The clamp forms are refused.
  5. v_mac_f32. A non-fused multiply-add: the product is rounded to binary32 before the add. D is both an input and the output.

Each PR will include:

  • a source-built fixture with a Python reference;
  • reference controls and recompiled-HLSL controls;
  • draws on WARP and on hardware;
  • the LLVM 15 round trip.

AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) writes them, and Claude Code reviews them.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7144791814 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7144791814). Originally posted by [henriazz10](https://github.com/henriazz10) on 2026-11-24T21:20:06Z. --- I'd like to take five more ALU slices for `compute_store_aot` (gfx1013). They will be five separate PRs, opened one at a time. Each lowers only known words and refuses `clamp`, `omod` and source modifiers that it does not model. 1. **`v_add_co_u32` with `v_add_co_ci_u32`.** This is the 64-bit add pattern: the carry-out goes to VCC (or an SGPR) and the next add reads it as carry-in. The carry is tracked per lane as the translator's known value of the carry SGPR. Any other reader of that SGPR is refused. 2. **`v_sub_co_u32` / `v_subrev_co_u32` with `v_sub_co_ci_u32` / `v_subrev_co_ci_u32`.** The same pattern for borrows. 3. **`v_frexp_mant_f32` and `v_frexp_exp_i32_f32`.** These follow the ISA definitions for zero, infinity and NaN. They use the f32 profile's literal refusals, and the denormal assumption is stated as in the `v_ldexp_f32` PR. 4. **`v_dot2_u32_u16` and `v_dot4_u32_u8`.** Unsigned integer dot products with accumulation, wrapping at 32 bits. The `clamp` forms are refused. 5. **`v_mac_f32`.** A non-fused multiply-add: the product is rounded to binary32 before the add. `D` is both an input and the output. Each PR will include: - a source-built fixture with a Python reference; - reference controls and recompiled-HLSL controls; - draws on WARP and on hardware; - the LLVM 15 round trip. AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) writes them, and Claude Code reviews them.
henriazz10 commented 2026-11-25 03:01:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by henriazz10 on 2026-11-25T02:15:21Z.


I'd like to take the general per-lane compare and select for compute_store_aot (gfx1013), as one PR.

Today v_cmp_* is accepted only as a lane-guard opener, with five predicates and operands that must be verified uniform, and v_cndmask_b32_e64 only with an SGPR that holds a known constant mask. This slice adds the following.

  • Compares. The VOPC compares on known words:
    • v_cmp_{f,lt,eq,le,gt,ne,ge,t}_{u32,i32}, e32 into vcc_lo and e64 into an SGPR;
    • v_cmp_{f,lt,eq,le,gt,lg,ge,o,u,nge,nlg,ngt,nle,neq,nlt,tru}_f32, with the IEEE unordered rules for NaN.
  • Per-lane result. Each result is tracked as a per-lane condition: each thread's own bit of the mask. That is independent of the wave size, because only the same lane reads it.
  • Select. v_cndmask_b32_e32 vD, S0, vS1, vcc_lo and v_cndmask_b32_e64 ..., vcc_lo|sN select on that condition.
  • Refused. Any other reader of the condition stays refused: scalar ALU, branches, s_and_saveexec on a per-lane condition built from loaded data, and the add-with-carry _ci forms. The existing guard path, the constant-mask select and the carry/borrow tracking keep their current behavior. A compare or carry that rewrites VCC invalidates the previous per-lane value.
  • Modifiers. Source modifiers (neg/abs on f32) are refused unless modelled. clamp and SDWA are refused.

Evidence:

  • an independent Python model with the full truth tables, covering equal values, signed and unsigned order across 0x80000000, ±0, NaN on either side, and infinities;
  • a source-built fixture with a unique word per thread;
  • reference and recompiled-HLSL mutations (swapped predicates, signed for unsigned, ordered for unordered);
  • draws on WARP and hardware;
  • the LLVM 15 round trip;
  • form-coverage records.

The open SDWA comparison PR (#1670) is for pixel_aot and does not overlap with this.

AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) writes it, and Claude Code reviews it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7150498483 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/721#issuecomment-7150498483). Originally posted by [henriazz10](https://github.com/henriazz10) on 2026-11-25T02:15:21Z. --- I'd like to take the general per-lane compare and select for `compute_store_aot` (gfx1013), as one PR. Today `v_cmp_*` is accepted only as a lane-guard opener, with five predicates and operands that must be verified uniform, and `v_cndmask_b32_e64` only with an SGPR that holds a known constant mask. This slice adds the following. - **Compares.** The VOPC compares on known words: - `v_cmp_{f,lt,eq,le,gt,ne,ge,t}_{u32,i32}`, `e32` into `vcc_lo` and `e64` into an SGPR; - `v_cmp_{f,lt,eq,le,gt,lg,ge,o,u,nge,nlg,ngt,nle,neq,nlt,tru}_f32`, with the IEEE unordered rules for NaN. - **Per-lane result.** Each result is tracked as a per-lane condition: each thread's own bit of the mask. That is independent of the wave size, because only the same lane reads it. - **Select.** `v_cndmask_b32_e32 vD, S0, vS1, vcc_lo` and `v_cndmask_b32_e64 ..., vcc_lo|sN` select on that condition. - **Refused.** Any other reader of the condition stays refused: scalar ALU, branches, `s_and_saveexec` on a per-lane condition built from loaded data, and the add-with-carry `_ci` forms. The existing guard path, the constant-mask select and the carry/borrow tracking keep their current behavior. A compare or carry that rewrites VCC invalidates the previous per-lane value. - **Modifiers.** Source modifiers (`neg`/`abs` on f32) are refused unless modelled. `clamp` and SDWA are refused. Evidence: - an independent Python model with the full truth tables, covering equal values, signed and unsigned order across `0x80000000`, ±0, NaN on either side, and infinities; - a source-built fixture with a unique word per thread; - reference and recompiled-HLSL mutations (swapped predicates, signed for unsigned, ordered for unordered); - draws on WARP and hardware; - the LLVM 15 round trip; - form-coverage records. The open SDWA comparison PR (#1670) is for `pixel_aot` and does not overlap with this. AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) writes it, and Claude Code reviews it.
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#715
No description provided.