shader: lower v_add_co_ci_u32 in gfx2hlsl (Part of #1723) #2033
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2033
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2033/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tedin7 on GitHub · 2026-11-24 23:30 UTC · original
tedin7:x2w-r20-v-add-co-ci→main· +209 −0 · 4 files · 2 commits · closed without mergingPart of #1723
What this unblocks: Run 20 census #19 (38 shader pairs) refused for
v_add_co_ci_u32.v_add_co_ci_u32(e32 and e64) was refused as an unknown instruction. It now lowers toa + b + (carry_in & 1)and writes the carry out (bit 0) tovccor an SGPR mask. A carry in from an SGPR that is not a known mask, source modifiers, and an exec destination stay refused. Under an unknown exec the write and the carry are guarded by exec. New teststartup_gfx2hlsl_add_co_ci_check.py, registered asstartup_gfx2hlsl_add_co_ciin CMakeLists.txt.Verification:
python3 -B tests/startup_gfx2hlsl_add_co_ci_check.py-> PASS (on origin/main the same test fails withUnsupported: v_add_co_ci_u32)for t in tests/startup_gfx2hlsl_*_check.py; do python3 -B $t; done-> no failuresAI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:31 UTC · original · edited 2026-11-24 23:37 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
0b62bd2ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@ -2476,1 +2476,4 @@set_tests_properties(startup_gfx2hlsl_neg_operand PROPERTIES TIMEOUT 60)# v_add_co_ci_u32: add with carry in and out (#1723).add_test(NAME startup_gfx2hlsl_add_co_ci COMMAND "${INTAKE_PYTHON}" -B"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_add_co_ci_check.py")@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:37 UTC · original
This adds a public startup-translator capability and a new reproduction command, but neither
README.mdnordocs/experiments.mdwas updated. Searching those documents finds carry-in coverage forpixel_aot, not this new startup check.AGENTS.mdrequires a documentation update when capabilities or reproduction commands change; record the supported e32/e64 forms, remaining refusals and exact Python/CTest command alongside the other startup experiments.AGENTS.md reference: AGENTS.md:L210-L211
Useful? React with 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:37 UTC · original
When a numeric addend is
vcc,execor an SGPR holding a lane mask,u()returns the translator's per-lane 0/1 projection rather than the full 32-bit register word. For example, afters_mov_b32 vcc_lo, -1, the valid gfx1013 instructionv_add_co_ci_u32_e32 v5, vcc_lo, vcc_lo, v2, vcc_lowithv2 = 0must producev5 = 0with carry 1, but the emitted HLSL usesca = 1and producesv5 = 2with carry 0. This changes a previously refused input into silently incorrect arithmetic. Reject lane-mask registers in these two numeric-source positions unless their full word is represented separately.Useful? React with 👍 / 👎.
@ -2476,1 +2476,4 @@set_tests_properties(startup_gfx2hlsl_neg_operand PROPERTIES TIMEOUT 60)# v_add_co_ci_u32: add with carry in and out (#1723).add_test(NAME startup_gfx2hlsl_add_co_ci COMMAND "${INTAKE_PYTHON}" -B"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_add_co_ci_check.py")@tedin7 on GitHub · 2026-11-25 00:55 UTC · original
Fixed in 39c36020: new "Add with carry in and out" paragraph in docs/experiments.md (e32/e64 forms, refusals, exact Python and CTest commands). Commit lands with the next rebased push.
@tedin7 on GitHub · 2026-11-25 00:55 UTC · original
Fixed in 39c36020: vcc, exec and known mask SGPRs are now refused as numeric sources; four new refusal cases added to startup_gfx2hlsl_add_co_ci_check.py (all PASS). Commit lands with the next rebased push.
@tedin7 on GitHub · 2026-11-25 13:51 UTC · original
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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:37 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
0b62bd2cd3ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Pull request closed