[PR #105] tests/rdna2spirv: drop the test of a method the branchless decode removed #157

Open
opened 2026-11-26 20:16:58 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/105
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9837


📝 Commits (1)

  • 0d5198e tests/rdna2spirv: drop the test of a method the branchless decode removed

📊 Changes

1 file changed (+0 additions, -9 deletions)

View changed files

📝 tests/test_rdna2spirv_decode.py (+0 -9)

📄 Description

Carried over from old PR 9837 by noosko21-a11y in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9837, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
This branch conflicts with the current main and needs a rebase.
noosko21-a11y: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

tests/test_rdna2spirv_decode.py is red on main (f48adad7): it calls a method that no longer exists.

FAILED (errors=1)
AttributeError: 'Gen' object has no attribute 'decode_any_format'. Did you mean: 'decode_format'?

9ad6cc8c (SHADER-849, "rdna2spirv: decode a run-time FORMAT without a branch") replaced the binary tree over the format codes with one table word per code plus OpSelect in a shared function, and removed decode_any_format and decode_format_search with it. test_decode_any_format_selection was left behind.

What it asserted is already covered by the test directly below it, test_format_decode_call_builds_and_caches_function, which is the surviving entry point and checks the four components and the function cache. The two extra assertions named the old implementation rather than a behaviour:

  • OpIEqual %bool %run_fmt was the tree comparison the commit deleted;
  • OpSelect is still used, but inside the cached function, not in the caller's body the test was scanning.

Re-adding an OpIEqual assertion to a branchless decoder would assert the opposite of what the commit did, so the right move is to drop the stale test rather than rewrite it around the new internals.

The other 25 tests in the file are untouched and still pass, including every decode_format case (all kinds, short-word channel replication, fixed versus dynamic normalisation), so no coverage of the code that remains is lost.

Tested

Clean worktree at main (f48adad7):

python -I tests/test_rdna2spirv_decode.py
  main : Ran 26 tests, FAILED (errors=1)
  after: Ran 25 tests, OK

Windows 11, Python 3.12.10. Standard library only, no game files, no GPU.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. - not applicable, no translator change.

🔄 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/105 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9837` --- ### 📝 Commits (1) - [`0d5198e`](https://github.com/ubiquitarianism/leonida/commit/0d5198e2945426d7fd7ad609252005e4ecefae95) tests/rdna2spirv: drop the test of a method the branchless decode removed ### 📊 Changes **1 file changed** (+0 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_rdna2spirv_decode.py` (+0 -9) </details> ### 📄 Description > Carried over from **old PR 9837** by `noosko21-a11y` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9837`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > This branch conflicts with the current `main` and needs a rebase. > `noosko21-a11y`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `tests/test_rdna2spirv_decode.py` is red on `main` (`f48adad7`): it calls a method that no longer exists. ``` FAILED (errors=1) AttributeError: 'Gen' object has no attribute 'decode_any_format'. Did you mean: 'decode_format'? ``` `9ad6cc8c` (SHADER-849, "rdna2spirv: decode a run-time FORMAT without a branch") replaced the binary tree over the format codes with one table word per code plus `OpSelect` in a shared function, and removed `decode_any_format` and `decode_format_search` with it. `test_decode_any_format_selection` was left behind. What it asserted is already covered by the test directly below it, `test_format_decode_call_builds_and_caches_function`, which is the surviving entry point and checks the four components and the function cache. The two extra assertions named the old implementation rather than a behaviour: - `OpIEqual %bool %run_fmt` was the tree comparison the commit deleted; - `OpSelect` is still used, but inside the cached function, not in the caller's body the test was scanning. Re-adding an `OpIEqual` assertion to a branchless decoder would assert the opposite of what the commit did, so the right move is to drop the stale test rather than rewrite it around the new internals. The other 25 tests in the file are untouched and still pass, including every `decode_format` case (all kinds, short-word channel replication, fixed versus dynamic normalisation), so no coverage of the code that remains is lost. ### Tested Clean worktree at `main` (`f48adad7`): ``` python -I tests/test_rdna2spirv_decode.py main : Ran 26 tests, FAILED (errors=1) after: Ran 25 tests, OK ``` Windows 11, Python 3.12.10. Standard library only, no game files, no GPU. AI-assisted: yes ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md). - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. - not applicable, no translator change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#157
No description provided.