tooling: scanner counts the plain binary16 e32 forms pixel_aot lowers to the low half #1080

Merged
tedin7 merged 1 commit from upstream-pr/1087 into main 2026-11-24 01:10:55 +00:00
tedin7 commented 2026-11-24 00:46:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T00:46:32Z.


Change

scan_unsupported_shaders.py did not count ten plain binary16 e32 forms that pixel_aot.py already lowers (low 16 bits of the result only), so a shader using them was reported as unsupported. This adds scanner patterns for v_{add,sub,subrev,mul}_f16_e32, v_{floor,ceil,trunc,rndne}_f16_e32 and v_cvt_f16_{i16,u16}_e32, and registers their opcodes as known. Op names and the binary16 inline-constant set are read from pixel_aot.VOP2_F16, VOP1_F16_ROUND and INLINE_F16, so the scanner follows the translator tables.

The patterns mirror the translator's operand rules: e32 src1 of the arithmetic forms is a VGPR; sources are a binary16 inline constant, 0, a 16-bit literal or a register in range; integer inline constants other than 0, source modifiers, clamp, omod and _e64 are not matched. The cvt forms take the 16-bit integer operand set of int16_operand.

Refs #839 (follow-up to the merged plain binary16 slices). Scanner only; no translator change. No overlapping open PR found (searched open and merged PRs for scanner and binary16 changes; #906 touches the scanner opcode lists for other binary16 ops and does not add these patterns).

This work is AI-assisted (Claude Code).

Verification

  • New test TestRdna2Scanner.test_low16_binary16_e32_scanner_support in tests/rdna2_tools_check.py.
  • On this branch: python3 -B tests/rdna2_tools_check.py TestRdna2Scanner.test_low16_binary16_e32_scanner_support gives OK (1 test).
  • Negative control: the same test file against unmodified origin/main (ed983c1c) fails with False is not true : v_add_f16_e32 v24, v18, v19.
  • Whole file: python3 -B tests/rdna2_tools_check.py gives Ran 100 tests, OK (skipped=9, the LLVM-lib-dependent ones; LLVM 15 is not installed locally).

Evidence and follow-up

No new fixtures: the test uses synthetic assembly strings only. The accepted and refused lists were written from the operand rules in pixel_aot.half16_arith_source and int16_operand. The _e64 forms the translator also lowers without modifiers are left out of this slice. The scanner still checks syntax only; the translator decides whether a source is statically proven finite.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed (none changed).
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572004754 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1087). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T00:46:32Z. --- ## Change `scan_unsupported_shaders.py` did not count ten plain binary16 e32 forms that `pixel_aot.py` already lowers (low 16 bits of the result only), so a shader using them was reported as unsupported. This adds scanner patterns for `v_{add,sub,subrev,mul}_f16_e32`, `v_{floor,ceil,trunc,rndne}_f16_e32` and `v_cvt_f16_{i16,u16}_e32`, and registers their opcodes as known. Op names and the binary16 inline-constant set are read from `pixel_aot.VOP2_F16`, `VOP1_F16_ROUND` and `INLINE_F16`, so the scanner follows the translator tables. The patterns mirror the translator's operand rules: e32 src1 of the arithmetic forms is a VGPR; sources are a binary16 inline constant, 0, a 16-bit literal or a register in range; integer inline constants other than 0, source modifiers, clamp, omod and `_e64` are not matched. The cvt forms take the 16-bit integer operand set of `int16_operand`. Refs #839 (follow-up to the merged plain binary16 slices). Scanner only; no translator change. No overlapping open PR found (searched open and merged PRs for scanner and binary16 changes; #906 touches the scanner opcode lists for other binary16 ops and does not add these patterns). This work is AI-assisted (Claude Code). ## Verification - New test `TestRdna2Scanner.test_low16_binary16_e32_scanner_support` in `tests/rdna2_tools_check.py`. - On this branch: `python3 -B tests/rdna2_tools_check.py TestRdna2Scanner.test_low16_binary16_e32_scanner_support` gives OK (1 test). - Negative control: the same test file against unmodified `origin/main` (ed983c1c) fails with `False is not true : v_add_f16_e32 v24, v18, v19`. - Whole file: `python3 -B tests/rdna2_tools_check.py` gives Ran 100 tests, OK (skipped=9, the LLVM-lib-dependent ones; LLVM 15 is not installed locally). ## Evidence and follow-up No new fixtures: the test uses synthetic assembly strings only. The accepted and refused lists were written from the operand rules in `pixel_aot.half16_arith_source` and `int16_operand`. The `_e64` forms the translator also lowers without modifiers are left out of this slice. The scanner still checks syntax only; the translator decides whether a source is statically proven finite. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed (none changed). - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 06:46:14 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:49:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:46:42Z.


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-24T00:49:44.836594Z c85d40e PR opened
ℹ️ 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:7118422664 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1087#issuecomment-7118422664). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T00:46:42Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c85d40e3d80591114dc8d65e6cfd45939be572e3","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-24T00:49:44.836594Z">2026-11-24T00:49:44.836594Z</relative-time> | `c85d40e` | PR opened | <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>
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!1080
No description provided.