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

Manually merged
github merged 1 commit from gh-pr/1087/head into gh-pr/1087/base 2026-11-26 22:40:39 +00:00
Owner

@⁠tedin7 on GitHub · 2026-11-24 00:46 UTC · original
tedin7:x2w-scan-f16-low16-sync → main · +66 −0 · 2 files · 1 commits · merged 2026-11-24 01:10 UTC

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.
**@⁠tedin7** on GitHub · 2026-11-24 00:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1087) `tedin7:x2w-scan-f16-low16-sync` → `main` · +66 −0 · 2 files · 1 commits · merged 2026-11-24 01:10 UTC ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:40:37 +00:00
github manually merged commit c85d40e3d8 into gh-pr/1087/base 2026-11-26 22:40:39 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 00:46 UTC · original · edited 2026-11-24 00:49 UTC

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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 00:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1087#issuecomment-7118422664) · edited 2026-11-24 00:49 UTC <!-- 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>
This discussion has been locked. Commenting is limited to contributors.
No description provided.