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

Open
github-bot wants to merge 1 commit from github-bot/gh-105 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:18 UTC · original
ubiquitarianism:old-pr/9837 → main · +0 −9 · 1 files · 1 commits · draft

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.
**@⁠Andretuta** on GitHub · 2026-11-24 02:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/105) `ubiquitarianism:old-pr/9837` → `main` · +0 −9 · 1 files · 1 commits · draft > 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.
`test_decode_any_format_selection` calls `Gen.decode_any_format`, which no longer exists: 9ad6cc8c (SHADER-849,
"rdna2spirv: decode a run-time FORMAT without a branch") replaced the binary tree over the format codes with a
single table word per code plus OpSelect in a shared function, and removed `decode_any_format`,
`decode_format_search` and `format_decode_call`'s old body with it.

What it asserted is now 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. Its two extra assertions
named the old implementation, not a behaviour: `OpIEqual %bool %run_fmt` was the tree comparison the commit deleted,
and while `OpSelect` is still used, it is emitted 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 the commit's point.

Consequence on a clean `main` (f48adad7):

    python -I tests/test_rdna2spirv_decode.py
    Ran 26 tests / FAILED (errors=1)
    AttributeError: 'Gen' object has no attribute 'decode_any_format'

    after: Ran 25 tests, OK

The other 25 tests in the file are untouched and still pass, including every `decode_format` case, so the removal
loses no coverage of the code that remains.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:44:36 +00:00
This pull request has changes conflicting with the target branch.
  • tests/test_rdna2spirv_decode.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/105/head:github-bot/gh-105'
git switch 'github-bot/gh-105'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-105'
git switch 'github-bot/gh-105'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-105'
git switch 'github-bot/gh-105'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-105'
git switch 'main'
git merge --squash 'github-bot/gh-105'
git switch 'main'
git merge --ff-only 'github-bot/gh-105'
git switch 'main'
git merge 'github-bot/gh-105'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.