[PR #1862] [CLOSED] rdna2spirv: restore the dot4 inline op_sel_hi under exact re-anchoring too (SHADER-FSPX-DOT4-EXACT) #1874

Closed
opened 2026-11-26 21:19:15 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1862
Author: @Coderlord
Created: 11/25/2026
Status: ❌ Closed

Base: main ← Head: fspx-dot4-exact


📝 Commits (1)

  • e88177e rdna2spirv: restore the dot4 inline op_sel_hi under exact re-anchoring too (SHADER-FSPX-DOT4-EXACT)

📊 Changes

2 files changed (+49 additions, -1 deletions)

View changed files

📝 tests/test_rdna2spirv_decode.py (+44 -0)
📝 tools/rdna2spirv.py (+5 -1)

📄 Description

Claimed in the coordination issue as: SHADER-FSPX-DOT4-EXACT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163717323)

What and why

A listing whose undecodable words sit at offsets its llvm-mc messages name is re-anchored exactly
(invalid_at, from #984). That branch of translate tried the v_fma_mix literal restores but not
restore_dot4_inline_sel, which the forward-search branch and check_printed_encodings both try. So a
v_dot4_i32_i8 whose src1 is a replicated inline integer (llvm-mc prints op_sel_hi[1] set where the program's
word has it clear) was marked normalized, and the whole program was refused as "reachable instruction with
normalized encoding".

llvm-mc 23.1.6 names every word it rejects, so two of the 29 FSPX programs of the FidelityFX DLL take that branch and
did not translate. The title then has no pipeline for one of them, and the DLL reads through the missing object
(an access violation at amd_fidelityfx_upscaler_xbox.dll+0x65ff, about 50 s after the first-run setup is
confirmed, native Windows). The fix is one condition: the exact branch tries restore_dot4_inline_sel before the
literal restores, as the other two paths do.

Tested

  • FSPX step (rdna2spirv.py <work>/shaders/fspx/disasm --no-asm --wave64-emulate) with llvm-mc 23.1.6 (conda-forge
    llvm-tools): 27 of 29 translated and passing spirv-val on main 98c2f7777, 29 of 29 with this change.
    The other 6 FSPX programs with rejected words (the dot4 forms #984 recovers) translate either way.
  • python -I tests/test_rdna2spirv_decode.py: 26 tests OK. The new
    test_exact_anchoring_restores_dot4_inline_sel (one rejected word at a known offset after s_endpgm, a dot4
    printed with the default op_sel_hi) passes with the change and fails without it with "reachable instruction with
    normalized encoding".
  • Retail boots on this card (native Windows, ubiq main ed94fbef9 + #1768): without this change the process
    died 50 s after the first-run setup was confirmed, in amd_fidelityfx_upscaler_xbox.dll+0x65ff (a read at
    0x10), right after the runtime logged "no translated compute shader for FSPX" for one of the two programs and
    refused its pipeline (E_INVALIDARG). With the 29 retranslated, the next boot logged no missing FSPX program
    and did not fault in the DLL; it went on to a later, unrelated stop (a lost device about 75 s into the session).

GPUs tested: NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 Pro 26300

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: an
    existing restore applied in one more branch, no new rule)

🔄 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/1862 **Author:** [@Coderlord](https://github.com/Coderlord) **Created:** 11/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fspx-dot4-exact` --- ### 📝 Commits (1) - [`e88177e`](https://github.com/ubiquitarianism/leonida/commit/e88177e53a86ac26d26c94f3788afa1296e3ed55) rdna2spirv: restore the dot4 inline op_sel_hi under exact re-anchoring too (SHADER-FSPX-DOT4-EXACT) ### 📊 Changes **2 files changed** (+49 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_rdna2spirv_decode.py` (+44 -0) 📝 `tools/rdna2spirv.py` (+5 -1) </details> ### 📄 Description Claimed in the coordination issue as: SHADER-FSPX-DOT4-EXACT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163717323) ### What and why A listing whose undecodable words sit at offsets its llvm-mc messages name is re-anchored exactly (`invalid_at`, from #984). That branch of `translate` tried the `v_fma_mix` literal restores but not `restore_dot4_inline_sel`, which the forward-search branch and `check_printed_encodings` both try. So a `v_dot4_i32_i8` whose src1 is a replicated inline integer (llvm-mc prints `op_sel_hi[1]` set where the program's word has it clear) was marked normalized, and the whole program was refused as "reachable instruction with normalized encoding". llvm-mc 23.1.6 names every word it rejects, so two of the 29 FSPX programs of the FidelityFX DLL take that branch and did not translate. The title then has no pipeline for one of them, and the DLL reads through the missing object (an access violation at `amd_fidelityfx_upscaler_xbox.dll+0x65ff`, about 50 s after the first-run setup is confirmed, native Windows). The fix is one condition: the exact branch tries `restore_dot4_inline_sel` before the literal restores, as the other two paths do. ### Tested - FSPX step (`rdna2spirv.py <work>/shaders/fspx/disasm --no-asm --wave64-emulate`) with llvm-mc 23.1.6 (conda-forge `llvm-tools`): **27 of 29** translated and passing spirv-val on `main` 98c2f7777, **29 of 29** with this change. The other 6 FSPX programs with rejected words (the dot4 forms #984 recovers) translate either way. - `python -I tests/test_rdna2spirv_decode.py`: 26 tests OK. The new `test_exact_anchoring_restores_dot4_inline_sel` (one rejected word at a known offset after `s_endpgm`, a dot4 printed with the default op_sel_hi) passes with the change and fails without it with "reachable instruction with normalized encoding". - Retail boots on this card (native Windows, ubiq `main` ed94fbef9 + #1768): without this change the process died 50 s after the first-run setup was confirmed, in `amd_fidelityfx_upscaler_xbox.dll+0x65ff` (a read at 0x10), right after the runtime logged "no translated compute shader for FSPX" for one of the two programs and refused its pipeline (`E_INVALIDARG`). With the 29 retranslated, the next boot logged no missing FSPX program and did not fault in the DLL; it went on to a later, unrelated stop (a lost device about 75 s into the session). GPUs tested: NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 Pro 26300 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: an existing restore applied in one more branch, no new rule) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:19:15 +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#1874
No description provided.