tests/rdna2spirv: drop the test of a method the branchless decode removed #105

Closed
Andretuta wants to merge 1 commit from upstream-pr/105 into main
Andretuta commented 2026-11-24 02:18:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:18:51Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464835436 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/105). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:18:51Z. --- > 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.
MoonEyes commented 2026-11-30 18:43:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:43:38Z.


Closing as superseded by current main: tests/test_rdna2spirv_decode.py no longer contains test_decode_any_format_selection, and tools/rdna2spirv.py no longer defines or calls decode_any_format. This branch's only change is already reflected in main, so there is nothing left to merge. The PR was also a draft with a conflict and no current claim.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288275153 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/105#issuecomment-7288275153). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T18:43:38Z. --- Closing as superseded by current main: tests/test_rdna2spirv_decode.py no longer contains test_decode_any_format_selection, and tools/rdna2spirv.py no longer defines or calls decode_any_format. This branch's only change is already reflected in main, so there is nothing left to merge. The PR was also a draft with a conflict and no current claim.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!105
No description provided.