native_pso_hashes: exit 0 on --help (test_tool_startup red on main since #497) #776

Merged
Boost9898 merged 1 commit from upstream-pr/776 into main 2026-11-24 14:37:41 +00:00
Boost9898 commented 2026-11-24 13:41:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Boost9898 on 2026-11-24T13:41:32Z.


Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133124413

What and why

#497 (1740e093c) added tools/native_pso_hashes.py, which imports its sibling shader_carve. tests/test_tool_startup.py derives its list from such imports and runs each tool with --help. This one took --help as a wrong argument count, printed the usage and exited 2, so test_each_sibling_importing_tool_starts fails on main 647affe2a (tool='native_pso_hashes').

main() now treats -h/--help like tools/mesh_compute_vs.py does: it prints the docstring to stdout and returns 0. A wrong argument count still returns 2. A unit test in tests/test_native_pso_hashes.py covers both flags.

Tested

Apple M4, macOS 26.5.1, Python 3.14.8 and 3.12.10, CPU only, no game files.

  • tests/test_tool_startup.py: fails on main 647affe2a. With this change, OK on both versions.
  • tests/test_native_pso_hashes.py (with the new test): OK on both versions. Negative control: without the change to the tool, the new test fails and so does test_tool_startup.py.
  • python -m compileall, git diff --check and scripts/check_no_game_data.py on the changed files: clean.

GPUs tested: n/a (no GPU tests involved)

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 changes)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5473276340 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/776). Originally posted by [Boost9898](https://github.com/Boost9898) on 2026-11-24T13:41:32Z. --- Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7133124413 ### What and why #497 (`1740e093c`) added `tools/native_pso_hashes.py`, which imports its sibling `shader_carve`. `tests/test_tool_startup.py` derives its list from such imports and runs each tool with `--help`. This one took `--help` as a wrong argument count, printed the usage and exited 2, so `test_each_sibling_importing_tool_starts` fails on `main` `647affe2a` (`tool='native_pso_hashes'`). `main()` now treats `-h`/`--help` like `tools/mesh_compute_vs.py` does: it prints the docstring to stdout and returns 0. A wrong argument count still returns 2. A unit test in `tests/test_native_pso_hashes.py` covers both flags. ### Tested Apple M4, macOS 26.5.1, Python 3.14.8 and 3.12.10, CPU only, no game files. - `tests/test_tool_startup.py`: fails on `main` `647affe2a`. With this change, OK on both versions. - `tests/test_native_pso_hashes.py` (with the new test): OK on both versions. Negative control: without the change to the tool, the new test fails and so does `test_tool_startup.py`. - `python -m compileall`, `git diff --check` and `scripts/check_no_game_data.py` on the changed files: clean. GPUs tested: n/a (no GPU tests involved) 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule changes)
KernelSmoker commented 2026-11-24 13:43:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T13:43:15Z.

Review: COMMENTED


Independent Linux verification of PR head 116de82f6ddaa226cf942da17749345c5e5dc87d on current base 47c6511747c93aa3fb908d7782ca96173d0eead3: tests/test_native_pso_hashes.py passed 9/9 and tests/test_tool_startup.py passed 2/2, including the previously failing sibling-startup case. Direct python3 -I tools/native_pso_hashes.py --help exited successfully and displayed the expected usage; git diff --check passed. Synthetic fixtures only, no game data or GPU. At the latest hosted-check refresh, all reported checks were still queued. AI-assisted independent verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6040261998 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/776#pullrequestreview-6040261998). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T13:43:15Z. **Review:** COMMENTED --- Independent Linux verification of PR head `116de82f6ddaa226cf942da17749345c5e5dc87d` on current base `47c6511747c93aa3fb908d7782ca96173d0eead3`: `tests/test_native_pso_hashes.py` passed 9/9 and `tests/test_tool_startup.py` passed 2/2, including the previously failing sibling-startup case. Direct `python3 -I tools/native_pso_hashes.py --help` exited successfully and displayed the expected usage; `git diff --check` passed. Synthetic fixtures only, no game data or GPU. At the latest hosted-check refresh, all reported checks were still queued. AI-assisted independent verification.
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!776
No description provided.