[PR #462] [MERGED] SDWA-LLVM19-ENC: recover native SDWA inline float listings #513

Closed
opened 2026-11-26 20:18:08 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/462
Author: @bobcatchris
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: sdwa-llvm19


📝 Commits (1)

  • c932457 rdna2spirv: recover native SDWA inline float from LLVM 19 listings

📊 Changes

3 files changed (+59 additions, -3 deletions)

View changed files

📝 tests/semantic/test_printed_encoding.py (+22 -1)
📝 tests/test_rdna2_decode.py (+8 -1)
📝 tools/rdna2spirv.py (+29 -1)

📄 Description

Claimed 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_encodings then rejects ps_sdwa_f16_const at offset 0x190, 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-inline

Only 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 unpatched main; new case exercises the LLVM 19 listing)
  • python -I tests/test_rdna2_decode.py — 16 pass, 1 pre-existing cs_w32_permlane_fi op_sel failure that also fails on unpatched main
  • python -I scripts/run_semantic_tests.py tests/semantic — 465 files, 6105 tests; only test_image_cube_store_glc failed in this environment, also fails on unpatched main
  • python -m compileall -q tools tests — OK
  • git diff --check — clean
  • security sweep of the diff — 0 hits

The 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

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • Translator rule covered by a synthetic regression test.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/462 **Author:** [@bobcatchris](https://github.com/bobcatchris) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `sdwa-llvm19` --- ### 📝 Commits (1) - [`c932457`](https://github.com/ubiquitarianism/leonida/commit/c932457840e38c978792d047771b9181ef3bb77a) rdna2spirv: recover native SDWA inline float from LLVM 19 listings ### 📊 Changes **3 files changed** (+59 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_printed_encoding.py` (+22 -1) 📝 `tests/test_rdna2_decode.py` (+8 -1) 📝 `tools/rdna2spirv.py` (+29 -1) </details> ### 📄 Description Claimed 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_encodings` then rejects `ps_sdwa_f16_const` at offset `0x190`, 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: https://github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches/tree/b17a81c3d9c0c36cf2da266e6a8a560f1f6e9b8a/tests/sdwa-inline Only 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 unpatched `main`; new case exercises the LLVM 19 listing) - `python -I tests/test_rdna2_decode.py` — 16 pass, 1 pre-existing `cs_w32_permlane_fi` `op_sel` failure that also fails on unpatched `main` - `python -I scripts/run_semantic_tests.py tests/semantic` — 465 files, 6105 tests; only `test_image_cube_store_glc` failed in this environment, also fails on unpatched `main` - `python -m compileall -q tools tests` — OK - `git diff --check` — clean - security sweep of the diff — 0 hits The 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 - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] Translator rule covered by a synthetic regression test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:08 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#513
No description provided.