Repository navigation
mesh_compute_vs: -h/--help prints usage, a missing spirv dir is an error - #1507
Merged
ItsNotRexed merged 1 commit intoNov 22, 2026
Merged
Conversation
`mesh_compute_vs.py --help` took `--help` as the spirv dir, found no index.json and exited 0 with no output; a path that does not exist did the same, so a typo looked like a successful run with nothing to do. -h/--help now print the docstring and exit 0, and a path that is not a directory is one ERROR line and exit 1, like the tool's other errors. build_for_index / write_for_index are unchanged. Same fix as ItsNotRexed#1379 for bary_fallback_gs.py.
x2Tweek
approved these changes
Nov 22, 2026
x2Tweek
left a comment
Contributor
There was a problem hiding this comment.
Verified independently at head 57e426f4 (base bb2e1842), Windows 11, Python 3.15 (python -I, isolated mode):
python -I tests/test_mesh_compute_vs.py -v→ 10/10 OK (0.178s), including the two new tests.python -I -m compileall -q tools/mesh_compute_vs.py tests/test_mesh_compute_vs.py→ clean (exit 0).- Negative control: detached worktree at base
bb2e1842with the PR'stests/test_mesh_compute_vs.pycopied in → exactly 3 failures on the two new tests (test_help_prints_usagefor both-hand--helpsubtests, andtest_a_missing_directory_is_one_error_line—build_for_indexwas called once where it must not be), all other 8 tests still pass. - Code review: the
-h/--helpcheck runs before the argc check and prints__doc__to stdout with exit 0; theos.path.isdirguard runs beforebuild_for_indexso no partial output is written and the error is a singleERROR: <dir>: not a directoryline on stderr with exit 1 — consistent with the error style already established in this tool and with the fix from #1379. - Note: the sibling
tests/test_mesh_compute.pysuite requirespytest, which is not installed in my environment, so I did not run it here; the diff does not touch that file or anything it imports.
No GPU involvement — this is a pure CLI-argument fix. LGTM.
(AI-assisted review: I ran the listed commands and the negative control locally and report the results above.)
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: #1380 (comment)
What and why
python -I tools/mesh_compute_vs.py --helptook--helpas the spirv dir, found noindex.jsonand exited 0 with no output. A path that doesn't exist did the same, so a typo looked like a successful run with nothing to do. Same bug #1379 fixed inbary_fallback_gs.py; I flagged this one on #1290, which has since merged without it.-h/--helpprint the docstring to stdout and exit 0.ERROR: <dir>: not a directoryline on stderr and exit 1, like the tool's other errors (mesh_compute_vs: a missing spirv-as and a rejected shader are one ERROR line, not tracebacks #1290). It is checked beforebuild_for_index, so nothing is written.build_for_index/write_for_indexare unchanged. An existing directory withoutindex.jsonstill means "nothing to do".Also touches
tools/mesh_compute_vs.py: #1407 (shader generation, lines ~12 and ~110-170) and #1428 (stdoutreconfigureunder__main__). Neither changesmain()'s argument handling;git merge-treeagainst both PR heads is clean.Tested
python -I tests/test_mesh_compute_vs.py: 10 tests OK. The two new tests (test_help_prints_usage,test_a_missing_directory_is_one_error_line) fail 3 times against current main and pass with the fix.python -m pytest -q tests/test_mesh_compute.py: 9 passed, 13 skipped (the skips need llvm-mc).python -m compileall -q make_game.py tools tests: clean.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator rule changed.)