OLD-10026: test: unit tests for tools/rdna2_isa_tables.py #1019

Merged
klikso merged 1 commit from upstream-pr/1019 into main 2026-11-28 11:44:10 +00:00
klikso commented 2026-11-24 16:59:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by klikso on 2026-11-24T16:59:36Z.


Claimed in the coordination issue as: OLD-10026

What and why

Carries forward old-pr/10026 (draft #294) rebased onto current main:

  • Adds comprehensive unit tests for tools/rdna2_isa_tables.py covering instruction tables, opcode lookups, operand constraints, and encoding classifications.

Original commit preserved: Ritolino <[email protected]>.

Tested

  • python -I tests/test_rdna2_isa_tables.py: 5/5 passed
  • python -I scripts/check_no_game_data.py tests/test_rdna2_isa_tables.py: passed (no game data)
  • python -I tests/test_text_write_line_endings.py: passed
  • python -m compileall -q make_game.py tools tests: clean

GPUs tested: n/a

AI-assisted: yes

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 (no translator rule).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476664202 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1019). Originally posted by [klikso](https://github.com/klikso) on 2026-11-24T16:59:36Z. --- Claimed in the coordination issue as: OLD-10026 ### What and why Carries forward `old-pr/10026` (draft #294) rebased onto current `main`: - Adds comprehensive unit tests for `tools/rdna2_isa_tables.py` covering instruction tables, opcode lookups, operand constraints, and encoding classifications. Original commit preserved: `Ritolino <230431388+[email protected]>`. ### Tested - `python -I tests/test_rdna2_isa_tables.py`: 5/5 passed - `python -I scripts/check_no_game_data.py tests/test_rdna2_isa_tables.py`: passed (no game data) - `python -I tests/test_text_write_line_endings.py`: passed - `python -m compileall -q make_game.py tools tests`: clean GPUs tested: n/a AI-assisted: yes ### 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 (no translator rule).
PierreEbele commented 2026-11-25 14:33:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:33:09Z.


Reviewed a29750431: ran python3 -I tests/test_rdna2_isa_tables.py on the PR tree and again with the file copied into a main worktree — OK, 5 tests in both (expected for a test-only PR over an unmodified module). Probed that the suite has teeth: the promoted-parity loops hit 190/41/79 real entries (not vacuous), the unmapped-SOP1 negative control holds (0x7F absent, max key 0x49), and every TABLE_BOUNDS entry matches rdna2_decode.py's field masks. No finding. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165452353 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1019#issuecomment-7165452353). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T14:33:09Z. --- Reviewed a29750431: ran `python3 -I tests/test_rdna2_isa_tables.py` on the PR tree and again with the file copied into a main worktree — OK, 5 tests in both (expected for a test-only PR over an unmodified module). Probed that the suite has teeth: the promoted-parity loops hit 190/41/79 real entries (not vacuous), the unmapped-SOP1 negative control holds (0x7F absent, max key 0x49), and every `TABLE_BOUNDS` entry matches `rdna2_decode.py`'s field masks. No finding. AI-assisted review. **Recommendation:** Merge
MoonEyes commented 2026-11-27 23:45:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:45:00Z.


Hi @klikso, thanks for these tests. I merged this pull request onto current main locally and ran them: they pass, and they also pass on plain main. The "Is it mergeable?" list in CONTRIBUTING.md asks for "A new test that fails on main and passes with the pull request", so as it stands this one doesn't show a bug that main still has. If one of these cases did fail before a fix that has since landed, could you say which commit, or add a case that still fails on main? If the tests are meant to lock in behaviour main already has, please say so in the description and a maintainer can decide.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7230379276 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1019#issuecomment-7230379276). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:45:00Z. --- Hi @klikso, thanks for these tests. I merged this pull request onto current `main` locally and ran them: they pass, and they also pass on plain `main`. The "Is it mergeable?" list in CONTRIBUTING.md asks for "A new test that fails on `main` and passes with the pull request", so as it stands this one doesn't show a bug that `main` still has. If one of these cases did fail before a fix that has since landed, could you say which commit, or add a case that still fails on `main`? If the tests are meant to lock in behaviour `main` already has, please say so in the description and a maintainer can decide. AI-assisted (Claude Code, Claude Opus 5.5).
sodove commented 2026-11-28 11:26:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T11:26:09Z.


#1019 | head a2975043142c24c7d445cbad334536e0977310ef | python3 -I tests/test_rdna2_isa_tables.py -v | red: 5 passed | green: 5 passed | Passed on both trees

This adds tests of the ISA tables, including decoding and invalid inputs. All five already passed on pinned main.

Copied the PR tests onto clean main 4a54aedcb6b66525e0c9f72a6ea10263337c9141 for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. Batch claim.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238549539 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1019#issuecomment-7238549539). Originally posted by [sodove](https://github.com/sodove) on 2026-11-28T11:26:09Z. --- #1019 | head `a2975043142c24c7d445cbad334536e0977310ef` | `python3 -I tests/test_rdna2_isa_tables.py -v` | red: 5 passed | green: 5 passed | **Passed on both trees** This adds tests of the ISA tables, including decoding and invalid inputs. All five already passed on pinned main. Copied the PR tests onto clean main `4a54aedcb6b66525e0c9f72a6ea10263337c9141` for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. [Batch claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7238450840).
DadaCap commented 2026-11-28 11:44:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T11:44:12Z.


Merged, thank you @klikso! This PR (OLD-10026: test: unit tests for tools/rdna2_isa_tables.py) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238748555 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1019#issuecomment-7238748555). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T11:44:12Z. --- Merged, thank you @klikso! This PR (OLD-10026: test: unit tests for tools/rdna2_isa_tables.py) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.
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!1019
No description provided.