test(hw_oracle): unit tests for tools/hw_oracle/tsharp.py #298

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

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T03:02:52Z.


Carried over from old PR 10030 by Ritolino in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10030, 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.
Ritolino: 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):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116997647

What and why

Adds standalone stdlib-only unit tests (tests/test_hw_oracle_tsharp.py) for tools/hw_oracle/tsharp.py (CPU-only, no GPU required).

  • Verifies check_arch, has_custom_pitch, 256-byte pitch_texels alignment, GFX10 vs GFX11 8-dword image_words bitfields (including gfx1010 zero word4, 1x1 and 16384x16384 PITCH_MSB boundaries, all format codes per family, and validation errors).
  • Tests lay_out 0xcd row padding, lanes, _longs packing/wrapping, and kernel_lines generation (dmask, multi-iteration, power-of-two checks), plus bitfield-corruption negative controls.
  • Does not touch any shared files.

Tested

AI-assisted.

Ran on Windows 11 (Python 3.12.10, stdlib-only):

  • python -I tests/test_hw_oracle_tsharp.py -v -> Ran 13 tests in 0.001s — OK
  • python -I -m compileall -q make_game.py tools tests -> exit code 0

Checklist

  • No game data (no extracted assets, keys, hashes, or disassembly from the game).
  • Translator rule N/A (test-only PR; no changes to tools/rdna2spirv.py).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465282268 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/298). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T03:02:52Z. --- > Carried over from **old PR 10030** by `Ritolino` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10030`, 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. > `Ritolino`: 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): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116997647 ### What and why Adds standalone `stdlib-only` unit tests (`tests/test_hw_oracle_tsharp.py`) for `tools/hw_oracle/tsharp.py` (CPU-only, no GPU required). - Verifies `check_arch`, `has_custom_pitch`, 256-byte `pitch_texels` alignment, GFX10 vs GFX11 8-dword `image_words` bitfields (including `gfx1010` zero word4, `1x1` and `16384x16384` `PITCH_MSB` boundaries, all format codes per family, and validation errors). - Tests `lay_out` `0xcd` row padding, `lanes`, `_longs` packing/wrapping, and `kernel_lines` generation (`dmask`, multi-iteration, power-of-two checks), plus bitfield-corruption negative controls. - Does not touch any shared files. ### Tested AI-assisted. Ran on Windows 11 (Python 3.12.10, stdlib-only): - `python -I tests/test_hw_oracle_tsharp.py -v` -> `Ran 13 tests in 0.001s — OK` - `python -I -m compileall -q make_game.py tools tests` -> exit code 0 ### Checklist - [x] No game data (no extracted assets, keys, hashes, or disassembly from the game). - [x] Translator rule N/A (test-only PR; no changes to `tools/rdna2spirv.py`).
aslan2142 commented 2026-11-24 19:18:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T19:18:39Z.


This carry-over of old upstream PR 10030 has been taken over in #1030, so I'm closing this draft as #17 describes. The branch old-pr/10030 stays.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7141909102 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/298#issuecomment-7141909102). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T19:18:39Z. --- This carry-over of old upstream PR 10030 has been taken over in #1030, so I'm closing this draft as #17 describes. The branch `old-pr/10030` stays. AI-assisted (Claude Code, Claude Opus 5.5).

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!298
No description provided.