compute: read raw buffer descriptor num_records as a number in compute_store_aot #2153

Merged
tedin7 merged 3 commits from upstream-pr/2161 into main 2026-11-25 07:20:25 +00:00
tedin7 commented 2026-11-25 01:53:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:53:52Z.


Part of #2022

What this unblocks: compute shaders that use a raw buffer descriptor's size word in scalar compares, selects and lane writes (Item C).

Changes:

  • Peer-review fix: root descriptors carry no size (WARP read 0xfffffffc), so the draw case now runs through a new offscreen_check --compute-store-sized-case that binds both raw buffers as 1280-byte descriptor-table views.
  • Word 2 (num_records) of a raw, stride-less descriptor lowers to GetDimensions on the bound view. Every other descriptor word stays opaque.
  • New s_cmp_eq/lg_{i,u}32 and s_cselect_b32, with SCC tracked only from the last compare and cleared by any instruction that may write it.
  • Two existing refusal messages for s_cselect_b32 now name the missing SCC instead of an unsupported instruction.
  • New tests/compute_desc_numeric_check.py (controls, binary, D3D12 draw with wrong-reference and mutated-shader negative controls), CMake/CI/AGENTS.md registration and a docs/experiments.md section.

Verification:

  • Linux: python3 -B tests/compute_desc_numeric_check.py controls PASS
  • Linux: python3 -B tests/compute_desc_numeric_check.py binary llvm-mc-19 llvm-objcopy-19 libLLVM-19.so PASS
  • Linux: compute_salu_absdiff_check.py controls, compute_alu_bcnt64_check.py, compute_alu_cmp_ne_check.py, compute_entry_layout_check.py, docs_links_check.py PASS
  • Linux: tests/compute_store_check.py binary llvm-mc-19 ... ran; LLVM 19 prints some different spellings than the LLVM 15 CI uses
  • tests/form_coverage_check.py fails here only because iced_x86 is not installed
  • Win2025 (WARP): x2w_pipe.py win2025 2161 --scope direct --regex "compute_(store_aot_|desc_numeric)" at defcd53c: 137/137 passed, including compute_store_aot_desc_numeric_warp; tests/compute_desc_numeric_check.py ok.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6595328791 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2161). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:53:52Z. --- Part of #2022 What this unblocks: compute shaders that use a raw buffer descriptor's size word in scalar compares, selects and lane writes (Item C). Changes: - Peer-review fix: root descriptors carry no size (WARP read 0xfffffffc), so the draw case now runs through a new `offscreen_check --compute-store-sized-case` that binds both raw buffers as 1280-byte descriptor-table views. - Word 2 (`num_records`) of a raw, stride-less descriptor lowers to `GetDimensions` on the bound view. Every other descriptor word stays opaque. - New `s_cmp_eq/lg_{i,u}32` and `s_cselect_b32`, with SCC tracked only from the last compare and cleared by any instruction that may write it. - Two existing refusal messages for `s_cselect_b32` now name the missing SCC instead of an unsupported instruction. - New `tests/compute_desc_numeric_check.py` (controls, binary, D3D12 draw with wrong-reference and mutated-shader negative controls), CMake/CI/AGENTS.md registration and a `docs/experiments.md` section. Verification: - Linux: `python3 -B tests/compute_desc_numeric_check.py controls` PASS - Linux: `python3 -B tests/compute_desc_numeric_check.py binary llvm-mc-19 llvm-objcopy-19 libLLVM-19.so` PASS - Linux: `compute_salu_absdiff_check.py controls`, `compute_alu_bcnt64_check.py`, `compute_alu_cmp_ne_check.py`, `compute_entry_layout_check.py`, `docs_links_check.py` PASS - Linux: `tests/compute_store_check.py binary llvm-mc-19 ...` ran; LLVM 19 prints some different spellings than the LLVM 15 CI uses - `tests/form_coverage_check.py` fails here only because `iced_x86` is not installed - Win2025 (WARP): `x2w_pipe.py win2025 2161 --scope direct --regex "compute_(store_aot_|desc_numeric)"` at defcd53c: 137/137 passed, including `compute_store_aot_desc_numeric_warp`; `tests/compute_desc_numeric_check.py` ok.
chatgpt-codex-connector[bot commented 2026-11-25 04:04:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T03:41:57Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T03:47:37.542817Z defcd53 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152159876 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2161#issuecomment-7152159876). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T03:41:57Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"defcd53c5321cce6d73ddb9fc32baaaed69ddcac","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T03:47:37.542817Z">2026-11-25T03:47:37.542817Z</relative-time> | `defcd53` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
legacy-code-archaeologist commented 2026-11-25 06:01:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T05:58:11Z.


Ran head c3eface9. Windows 11 build 26100, debug layer unavailable. Adapters: WARP 10.0.26100.8972, NVIDIA Quadro M1000M 32.0.15.7371, Intel HD Graphics 530 31.0.101.2111, the hardware ones selected with XBOX2WINDOWS_ADAPTER.

Test WARP Quadro M1000M Intel HD 530
compute_desc_numeric_controls pass n/a n/a
compute_store_aot_desc_numeric_{warp,hardware} pass pass pass

The draw prints no per-dispatch lines, so the result is the test status only.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7154310478 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2161#issuecomment-7154310478). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-25T05:58:11Z. --- Ran head `c3eface9`. Windows 11 build 26100, debug layer unavailable. Adapters: WARP 10.0.26100.8972, NVIDIA Quadro M1000M 32.0.15.7371, Intel HD Graphics 530 31.0.101.2111, the hardware ones selected with `XBOX2WINDOWS_ADAPTER`. | Test | WARP | Quadro M1000M | Intel HD 530 | |---|---|---|---| | `compute_desc_numeric_controls` | pass | n/a | n/a | | `compute_store_aot_desc_numeric_{warp,hardware}` | pass | pass | pass | The draw prints no per-dispatch lines, so the result is the test status only. _AI-assisted._
upstream-sync closed this pull request 2026-11-25 08:04:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2153
No description provided.