shader: round signed half-export references toward zero #199

Merged
Vonsek merged 1 commit from upstream-pr/202 into main 2026-11-21 18:23:09 +00:00
Vonsek commented 2026-11-21 18:21:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:21:02Z.


Change

Round negative half-precision pixel export references toward zero. The previous reference could move a negative result farther from zero after the nearest-half conversion.

Verification

At 2931900, ctest --preset dev --no-tests=error -R '^pixel_aot_(hardware|warp)$' -V passed both tests on an NVIDIA GeForce RTX 5080 and Microsoft WARP. Each signed draw checked 4,096 pixels and 16,384 channels with zero maximum absolute error. The D3D12 debug layer was unavailable.

Evidence and follow-up

The test generates four signed values on either side of a half-precision rounding midpoint from source in this repository under its license. Before the fix WARP returned -1 in the two negative channels at (0, 0), while the reference expected -1.00098 and -0.999512. The two positive channels agreed.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the verification command and result.
  • I verified the negative control before changing the reference.
  • Existing build and reproduction instructions still apply.
  • I did not include game files, dumps, distribution links or secrets.

This change was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6532673353 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/202). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T18:21:02Z. --- ## Change Round negative half-precision pixel export references toward zero. The previous reference could move a negative result farther from zero after the nearest-half conversion. ## Verification At 2931900, `ctest --preset dev --no-tests=error -R '^pixel_aot_(hardware|warp)$' -V` passed both tests on an NVIDIA GeForce RTX 5080 and Microsoft WARP. Each signed draw checked 4,096 pixels and 16,384 channels with zero maximum absolute error. The D3D12 debug layer was unavailable. ## Evidence and follow-up The test generates four signed values on either side of a half-precision rounding midpoint from source in this repository under its license. Before the fix WARP returned -1 in the two negative channels at (0, 0), while the reference expected -1.00098 and -0.999512. The two positive channels agreed. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the verification command and result. - [x] I verified the negative control before changing the reference. - [x] Existing build and reproduction instructions still apply. - [x] I did not include game files, dumps, distribution links or secrets. This change was AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:41:47 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:21:16Z.


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-21T18:24:21.595887Z 2931900 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:7067192142 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/202#issuecomment-7067192142). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T18:21:16Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"293190094c4acde9e49f3d778d23021df8394e5d","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-21T18:24:21.595887Z">2026-11-21T18:24:21.595887Z</relative-time> | `2931900` | 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!199
No description provided.