SDWA-LLVM19-ENC: recover native SDWA inline float listings #462
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!462
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/462/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?
@bobcatchris on GitHub · 2026-11-24 05:45 UTC · original
bobcatchris:sdwa-llvm19→main· +59 −3 · 3 files · 1 commits · merged 2026-11-24 06:33 UTCClaimed in the coordination issue as: SDWA-LLVM19-ENC
What and why
LLVM 19 prints an eight-byte integer-to-half SDWA conversion as a twelve-byte instruction with an extra literal dword.
check_printed_encodingsthen rejectsps_sdwa_f16_constat offset0x190, and the same pattern affects the signed conversion. This recovers the native source operand and instruction width when the native opcode, selector, other bytes and printed literal agree, so the translator accepts the LLVM 19 listing while still rejecting a changed literal or selection field.Carried from the source-only patch reported by @Sigtryggur-Mani-Gudmundsson:
github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches@b17a81c3d9/tests/sdwa-inlineOnly the SDWA commit from that mailbox is included; the unrelated permlane/null-export commit was dropped. No game data is included.
Tested
python -I tests/semantic/test_printed_encoding.py— 8 tests OK (7 on unpatchedmain; new case exercises the LLVM 19 listing)python -I tests/test_rdna2_decode.py— 16 pass, 1 pre-existingcs_w32_permlane_fiop_selfailure that also fails on unpatchedmainpython -I scripts/run_semantic_tests.py tests/semantic— 465 files, 6105 tests; onlytest_image_cube_store_glcfailed in this environment, also fails on unpatchedmainpython -m compileall -q tools tests— OKgit diff --check— cleanThe source report measured 4096/4096 pixels on an RTX 4070 Ti with LLVM 19.1.7, LLVM 23.1.5 and the Python decoder. I did not repeat that GPU measurement locally.
GPUs tested: n/a locally; source report used NVIDIA GeForce RTX 4070 Ti
AI-assisted: yes
Checklist
mainand merges cleanly.@QemmHD on GitHub · 2026-11-24 06:33 UTC · original
Merging. Why merged: a translator fix with its encoding test.
Why it's good: security-reviewed (translator code and tests only). Tested on Windows 11 merged onto main
8f481cf: the printed-encoding, decode and SDWA tests 87 -> 88 passed (2668 -> 2672 subtests); the full semantic suite (-j 12) 6104 -> 6105 tests with the same 3 failing files on main and with this PR (image_cube_store_glc, sopc_validation, unary_f16_validation), and the one decode-parity failure (llvm-mc 23 op_sel printing) also fails on main, so nothing new breaks.AI-assisted (Claude Code, Claude Opus 5.5).
@QemmHD on GitHub · 2026-11-24 07:37 UTC · original
Follow-up: merging this broke test_cmake_translator_deps, test_shader_stage_resume and test_runtime_paths on main, because tools/rdna2_decode.py and tools/rdna2_isa_tables.py weren't listed as translator inputs. My pre-merge check missed those three tests. Fixed by #529 (merged); I've added the repo-consistency tests to my pre-merge checks.
AI-assisted (Claude Code, Claude Opus 5.5).