shader: lower eight SDWA bit and 24-bit multiply forms #1572
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!1572
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1572/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?
@itzJaack on GitHub · 2026-11-24 14:27 UTC · original
itzJaack:shader/sdwa-bit-operations→main· +52 −6 · 4 files · 4 commits · closed without mergingTranslate eight additional SDWA integer forms. The first group covers bit reversal and low, high unsigned, and high signed bit scans. The second group covers signed and unsigned 24-bit products, both low and high halves. Both reuse the existing instruction semantics and SDWA source selection and destination placement. The draw fixtures exercise sign extension, the no-bit sentinel, destination preservation, and signed versus unsigned high products.
Verification at
9b68efdcpython -B tests/pixel_aot_check.pypassed locally on Windows. The SDWA integer fixture now exercises 23 forms.ps_6_0.pixel_aot_sdwa_integer_CTest cases.AI Driven - Specs: AMD Ryzen 7 9850X3D | NVIDIA GeForce RTX 5070 Ti | 16 GB DDR5 | Windows 11 Pro | Model: 6.2 Astra Medium
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 14:27 UTC · original · edited 2026-11-24 14:33 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
74cb16cℹ️ 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.
@ -2733,6 +2733,8 @@ SDWA_ALU = ("add", "sub", "subrev", "mul", "mul_legacy", "max", "min", "floor",# of the result into its dst_sel, so each form is its e32 operation on the extracted words, placed like a move.SDWA_INT = {**{op: INTEGER[op] for op in ("and_b32", "or_b32", "xor_b32", "xnor_b32", "not_b32","bfrev_b32", "ffbl_b32", "ffbh_u32", "ffbh_i32",@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 14:33 UTC · original
These four newly accepted forms change the translator's public capability, but
docs/experiments.md:5639still lists fifteen supported SDWA integer operations, says other integer SDWA spellings are refused, and describes four fixture programs rather than the new five. The published support boundary and reproduction description therefore contradict the tool. Update that section with the new bit-scan forms and their validation limits, keeping the existing GPU results distinct from the still-unverified pixel draws. RootAGENTS.mdexplicitly requires a README or experiment-documentation update when a public capability changes.AGENTS.md reference: AGENTS.md:L191-L192
Useful? React with 👍 / 👎.
@tedin7 on GitHub · 2026-11-25 12:44 UTC · original
@itzJaack could you rebase this branch onto current
mainand force-push?GitHub reports head
0bad6806as conflicting withmain, so it cannot be merged as is.Files that conflict with current
main(b1a644ae):tests/form_coverage_check.pyCommands run locally:
Once it is rebased and CI is green it will be re-checked right away.
AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 02:47 UTC · original
Possible duplicate: current
mainalready lowers these eight SDWA forms.SDWA_INT_EXTRAintools/pixel_aot.py(landed with #2550) coversbfrev_b32,ffbl_b32,ffbh_u32,ffbh_i32,mul_u32_u24,mul_i32_i24,mul_hi_u32_u24,mul_hi_i32_i24.tests/pixel_aot_check.py(SDWA_INT_EXTRA_PROGRAMS,SDWA_INT_EXTRA_MUTATIONS) andtests/form_coverage_check.py.SDWA_INTinstead, and conflicts with main intests/form_coverage_check.py.Commands executed:
git fetch origin maingit grep -n -E "SDWA_INT_EXTRA|bfrev_b32|mul_hi_i32_i24" origin/main -- tools testsI did not push to this branch. @itzJaack, if you see a form that main does not cover, please reduce the PR to that delta; otherwise it can be closed. Leaving the decision to @R0Y00.
AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 14:33 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
74cb16c7e4ℹ️ 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".
@tedin7 on GitHub · 2026-11-24 14:39 UTC · original · reviewed
Looks good overall. Reviewed the SDWA bit-scan and 24-bit multiply lowering in
tools/pixel_aot.pyand the tests intests/pixel_aot_check.py,tests/form_coverage_check.py, andtests/rdna2_tools_check.pyat0bad6806e50a333a90984daee51139c83fdb124b.Semantic & Edge-Case Review
bfrev_b32,ffbl_b32,ffbh_u32,ffbh_i32,mul_i32_i24,mul_u32_u24,mul_hi_i32_i24, andmul_hi_u32_u24toSDWA_INTand updatinghelpersfrom bothINTEGER_HELPERSandMUL24_HELPERSensuresdpp_ffbh_u32,dpp_ffbh_i32,mul24_u32,mul24_i32,mul24_hi_u32, andmul24_hi_i32are emitted when used in SDWA form.sdwa_source()andsdwa_dest()applyBYTE_*/WORD_*/DWORDextraction with optionalsext()andUNUSED_PAD/UNUSED_PRESERVEplacement, whileSDWA_INT_OPERANDScontinues to rejectclamp,UNUSED_SEXT, inline constants, and untrackedUNUSED_PRESERVEdestinations.SDWA_INT_WRONGcovers lostsext, unsigned-for-signed high product, ignored byte selection/placement, and zero-vs-sentinel (-1) onv_ffbh_u32_sdwa;check_controls()andTestRdna2Scannerverifyclamprejection.Verification
python3 -B tests/pixel_aot_check.py,python3 -B tests/rdna2_tools_check.py(141 tests, 18 skipped),python3 -B tests/docs_links_check.py,python3 -B tests/bidi_controls_check.py— passed.llvm-mc-19/llvm-objcopy-19/libLLVM-19.sobinary round-trip formultiply24andbit_scanSDWA groups — passed.--preset dev):offscreen_checkbuilt (3.64s),ctest --preset dev -R '^pixel_aot_sdwa_integer_'2/2 passed (1.97s)./O2(--preset release):offscreen_checkbuilt (1.00s),ctest --preset release -R '^pixel_aot_sdwa_integer_'2/2 passed (1.88s).tests/pixel_aot_check.py(13.4s) andtests/form_coverage_check.py(42.9s) — passed.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-24 23:14 UTC · original · reviewed
Review at head
0bad6806e50a333a90984daee51139c83fdb124b. Verdict: not merging yet. Two blockers that are not code defects.Executed locally:
git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflicts.gh pr checks 1572: Windows build and test, Linux Python checks, and gfx1013 fixtures all pass.git diff --stat origin/main...HEAD: 4 files, +52/-6, all undertools/andtests/.safe-merge-check: G6 and G7 block.Findings:
docs/experiments.mdstill lists fifteen supported SDWA integer operations and says other integer SDWA spellings are refused. The eight newly accepted forms make that text wrong. Please update the capability note and fixture counts.No logic defects found in the lowering itself. Merge held until the docs P1 thread is resolved and #1612 is sequenced.
AI-assisted; commands listed were executed locally.
@R0Y00 on GitHub · 2026-11-26 03:09 UTC · original · requested changes
Main now contains all eight lowering forms through #2550 (
11519862). I integrated current main locally and ran the form coverage suite. The old broad SDWA table takes precedence over the newer extended handler, and the existing UNUSED_SEXT refusal control for v_bfrev_b32 fails. Please keep the main lowering and its controls. If your independent bit-scan or signed/unsigned multiply vectors add coverage, a test-only update can retain those vectors and credit without registering the forms in both handlers. #1612 is closed, so the remaining overlap is #2550.Pull request closed