open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.
AI-assisted (Claude), on behalf of dev-ewann.
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>
The carver accepted a raw DEFLATE stream when the inflated bytes started with
DXBC and had the expected size, even if the stream never reached its final
block. It now also requires decompressor.eof, so a stream cut off or
corrupted after the payload is counted as rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It read sys.argv by hand, so no arguments stopped with IndexError. A missing archive
(or a folder in its place) created the output folder first and then ended in a
traceback, and an empty archive failed in mmap. It now checks the archive before
anything is created: a usage error (exit 2) with no output folder left behind.
The documented `shader_carve.py <archive.rpf> <out_dir>` form is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- make_game.py: a step counts as done only when the file it writes last
exists (index.json, fssm_index.json, disasm.done, spirv/index.json),
not when its folder exists or holds >=1000 files. Re-running a step
drops the later steps' markers so they run again.
- shader_carve.py / fssm_unpack.py: write their index last, via a temp
file and os.replace, so a stopped run never leaves one behind.
- shader_carve.py: file names are unique without case and Windows device
names (CON, NUL, COM1...) get a "_" prefix; ~N suffixes never land on
a real name.
- fssm_unpack.py: exit 1 with a clear message when nothing unpacks,
before writing the index, instead of an IndexError.
- tests/test_shader_stage_resume.py: 13 tests, standard library only.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shader pipeline (carve, FSSM unpack, gfx1013 disassembly, RDNA2 to SPIR-V),
asset export via rpf9-explorer's Core (submodule), PE loader and shim
skeleton, and make_game.py, which builds from the user's own copy of the game.
No game data, keys or executables are included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>