Skip to content

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

Merged
ubiquitarianism merged 1 commit into
ProjectLeonida:mainfrom
Boost9898:fix/native-pso-hashes-help
Nov 24, 2026
Merged

ubiquitarianism merged 1 commit into
ProjectLeonida:mainfrom
Boost9898:fix/native-pso-hashes-help

Conversation

@Boost9898

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #14 (comment)

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)

tools/native_pso_hashes.py (ProjectLeonida#497) imports shader_carve, so
test_tool_startup runs it with --help; it took that as a wrong argument
count and exited 2, which fails the test on main. -h/--help now print the
docstring to stdout and return 0, like mesh_compute_vs.py.

@KernelSmoker KernelSmoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ubiquitarianism
ubiquitarianism merged commit 23c4596 into ProjectLeonida:main Nov 24, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants