Correct scalar shader operands and condition flags #315

Manually merged
github merged 2 commits from gh-pr/315/head into gh-pr/315/base 2026-11-27 15:57:49 +00:00
Owner

@⁠TaynanGT on GitHub · 2026-11-27 15:44 UTC · original
TaynanGT:fix/shader-scalar-translation → main · +47 −4 · 4 files · 2 commits · merged 2026-11-27 15:50 UTC

The scalar usage table now covers the range of operand codes returned by the decoder. The regression exercises spill analysis with codes above 127. This ports VIctory-NVIDIA #53 by illuminatedfellow.

Scalar min/max now set SCC from the operand comparison specified in the RDNA 2 ISA. The dispatch test covers signed and unsigned comparisons, equal operands, and zero results. Version 12 regenerates cached translations with the corrected flag. Thanks to 11run11 and simbaui4life for the reports in Belobug #634 and VIctory-7900XTX #404.

**@⁠TaynanGT** on GitHub · 2026-11-27 15:44 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/315) `TaynanGT:fix/shader-scalar-translation` → `main` · +47 −4 · 4 files · 2 commits · merged 2026-11-27 15:50 UTC The scalar usage table now covers the range of operand codes returned by the decoder. The regression exercises spill analysis with codes above 127. This ports [VIctory-NVIDIA #53](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/53) by illuminatedfellow. Scalar min/max now set SCC from the operand comparison specified in the [RDNA 2 ISA](https://docs.amd.com/v/u/en-US/rdna2-shader-instruction-set-architecture). The dispatch test covers signed and unsigned comparisons, equal operands, and zero results. Version 12 regenerates cached translations with the corrected flag. Thanks to 11run11 and simbaui4life for the reports in [Belobug #634](https://github.com/Belobug/VIctory-Belobug-AMD/pull/634) and [VIctory-7900XTX #404](https://github.com/avatarmanz/VIctory-7900XTX/pull/404).
unspill marks the scalar codes a program uses in a table of 128, but an
instruction's effects can name a code up to 255 (a VOP3 compare whose
sdst field holds a constant's code, e.g. 0xD4C5A8D7), which panicked
with an index out of bounds instead of a translation error. The table
now covers every code, as stores and other beside it already do.

Found by fuzzing the translator (mutated test programs and random words
through ir::build, structure, resources, io and lowering). Port of
avatarmanz/VIctory-7900XTX#325; the new test panics on this main
(index 215, len 128) and passes with the change.
The scalar condition code follows the operand comparison. Cover signed and unsigned operations, equal values, and zero results. Refresh cached translations with version 12.

Reported in Belobug/VIctory-Belobug-AMD#634 and avatarmanz/VIctory-7900XTX#404.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:57:47 +00:00
github manually merged commit 3c83a339ca into gh-pr/315/base 2026-11-27 15:57:49 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 15:45 UTC · original · edited 2026-11-27 16:06 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-27T15:46:09.712355Z 3c83a33 PR opened
🔒 Security Review ✅ Completed 2026-11-27T15:47:46.774601Z 3c83a33 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-27 15:45 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/315#issuecomment-7222437005) · edited 2026-11-27 16:06 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"3c83a339ca4b248f8b1f0b4fbb953453c82e4c71","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"3c83a339ca4b248f8b1f0b4fbb953453c82e4c71","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"3c83a339ca4b248f8b1f0b4fbb953453c82e4c71","mergeGateEnabled":false,"pullRequestNumber":315,"repository":"TaynanGT/Vice-Tay","status":"completed"} --> <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-27T15:46:09.712355Z">2026-11-27T15:46:09.712355Z</relative-time> | `3c83a33` | PR opened | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-27T15:47:46.774601Z">2026-11-27T15:47:46.774601Z</relative-time> | `3c83a33` | 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.