shader: lower |vN| abs operand modifier in gfx2hlsl (Part of #1723) #2022

Closed
tedin7 wants to merge 4 commits from upstream-pr/2029 into main
tedin7 commented 2026-11-24 23:27:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T23:27:10Z.


Part of #1723

What this unblocks: Run 20 census #4 (95 pairs).

v_cndmask_b32_e64 with an absolute-value source (|vN|) was refused with operand '|vN|'. The select now clears the sign bit (& 0x7fffffffu) before any negation, so -|vN| is always negative. Abs on an immediate and abs on other integer ops stay refused. The three old tests that pinned the register-abs refusal were removed from startup_gfx2hlsl_cndmask_neg_check.py; the new test covers the behavior.

Verification:

  • python3 -B tests/startup_gfx2hlsl_abs_mod_check.py -> PASS (on origin/main the same test fails with Unsupported: operand '|v30|')
  • python3 -B tests/startup_gfx2hlsl_cndmask_neg_check.py -> PASS
  • python3 -B tests/startup_gfx2hlsl_op_refusals_check.py -> exit 0
  • python3 -B tests/startup_gfx2hlsl_refusals_check.py -> exit 0
  • Not run: a Win2025 build; the change is Python only and registered as startup_gfx2hlsl_abs_mod in CMakeLists.txt.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593495683 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2029). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T23:27:10Z. --- Part of #1723 What this unblocks: Run 20 census #4 (95 pairs). `v_cndmask_b32_e64` with an absolute-value source (`|vN|`) was refused with `operand '|vN|'`. The select now clears the sign bit (`& 0x7fffffffu`) before any negation, so `-|vN|` is always negative. Abs on an immediate and abs on other integer ops stay refused. The three old tests that pinned the register-abs refusal were removed from `startup_gfx2hlsl_cndmask_neg_check.py`; the new test covers the behavior. Verification: - `python3 -B tests/startup_gfx2hlsl_abs_mod_check.py` -> PASS (on origin/main the same test fails with `Unsupported: operand '|v30|'`) - `python3 -B tests/startup_gfx2hlsl_cndmask_neg_check.py` -> PASS - `python3 -B tests/startup_gfx2hlsl_op_refusals_check.py` -> exit 0 - `python3 -B tests/startup_gfx2hlsl_refusals_check.py` -> exit 0 - Not run: a Win2025 build; the change is Python only and registered as `startup_gfx2hlsl_abs_mod` in CMakeLists.txt. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-25 01:01:55 +00:00 (Migrated from github.com)

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


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-24T23:31:06.406901Z da72305 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:7147420225 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2029#issuecomment-7147420225). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:27:24Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"da72305ac243785cafd50ece0926228b1816b1b9","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-24T23:31:06.406901Z">2026-11-24T23:31:06.406901Z</relative-time> | `da72305` | 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>
Makto94 commented 2026-11-25 11:02:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Makto94 on 2026-11-25T10:43:26Z.


First hardware run reported in this thread: startup_gfx2hlsl_abs_mod_hardware passes on head 97450a1a with both FXC and DXC.

.\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_abs_mod_hardware$' -V

Environment: NVIDIA GeForce RTX 3070 Ti (10de:2482), driver 32.0.16.2101, Windows 11 build 26300.9974, Debug build, fxc 10.0.26100.9457, dxc 1.9.2602.17, D3D12 debug layer enabled, hardware run serial on an idle machine, 0 capability skips (77). The log has 3 fxc lines and 3 dxc lines (2 draw rows and 1 "mutation: fails as expected" row per compiler), and debug_errors=0 debug_warnings=0 on all 6 runs.
Same head, WARP and CPU checks: 100% tests passed, 0 tests failed out of 2 (startup_gfx2hlsl_abs_mod, startup_gfx2hlsl_abs_mod_warp); the WARP test has 3 fxc lines, 3 dxc lines and debug_errors=0 debug_warnings=0 on all 6 runs.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7160085893 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2029#issuecomment-7160085893). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-25T10:43:26Z. --- First hardware run reported in this thread: `startup_gfx2hlsl_abs_mod_hardware` passes on head 97450a1a with both FXC and DXC. ```powershell .\tools\dev.ps1; ctest --preset dev --no-tests=error -j1 -R '^startup_gfx2hlsl_abs_mod_hardware$' -V ``` Environment: NVIDIA GeForce RTX 3070 Ti (`10de:2482`), driver 32.0.16.2101, Windows 11 build 26300.9974, Debug build, fxc 10.0.26100.9457, dxc 1.9.2602.17, D3D12 debug layer enabled, hardware run serial on an idle machine, 0 capability skips (77). The log has 3 `fxc ` lines and 3 `dxc ` lines (2 draw rows and 1 "mutation: fails as expected" row per compiler), and `debug_errors=0 debug_warnings=0` on all 6 runs. Same head, WARP and CPU checks: `100% tests passed, 0 tests failed out of 2` (`startup_gfx2hlsl_abs_mod`, `startup_gfx2hlsl_abs_mod_warp`); the WARP test has 3 `fxc ` lines, 3 `dxc ` lines and `debug_errors=0 debug_warnings=0` on all 6 runs.
tedin7 commented 2026-11-25 12:01:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T11:54:39Z.


Thank you @Makto94 for the RTX 3070 Ti run at 97450a1a: startup_gfx2hlsl_abs_mod_hardware passed with FXC and DXC, plus CPU and WARP 2/2. Recorded as extra evidence for this PR.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7161667601 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2029#issuecomment-7161667601). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T11:54:39Z. --- Thank you @Makto94 for the RTX 3070 Ti run at `97450a1a`: `startup_gfx2hlsl_abs_mod_hardware` passed with FXC and DXC, plus CPU and WARP 2/2. Recorded as extra evidence for this PR. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 14:04:28 +00:00
tedin7 commented 2026-11-25 14:05:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:51:43Z.


Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.

We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164397696 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2029#issuecomment-7164397696). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:51:43Z. --- Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is. We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here. AI-assisted; commands listed were executed locally.

Pull request closed

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!2022
No description provided.