On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").
tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both tools parse sys.argv by hand, so --help was taken as the input folder:
classify_carve reported '--help: does not exist' (exit 2) and spirv_stubs
'missing --help/index.json' (exit 1). -h and --help now print the usage to
stdout and exit 0 without touching the file system. Tests cover both flags
on both tools and fail on the previous code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add tools/spirv_stubs.py to emit minimal deduplicated SPIR-V 1.0 VS/PS
partner stubs into <spirv>/stubs/ using only the standard library.
- Record writes_depth, gs_input_locations, and gs_output_locations in
shader_meta() (keeping all existing fields intact and avoiding overlap
with PR #76 / PR #83 fields).
- Generate stubs automatically when rdna2spirv.py or build.py writes index.json.