Commit Graph

16 Commits

Author SHA1 Message Date
ecc7f55188 Accelerate sparse shader carving with an optional Rust scanner
Co-Authored-By: GPT 6.2 Sol <noreply@openai.com>
2026-11-23 20:52:45 +01:00
14e9f4eb72 tools: retry os.replace on transient Windows sharing errors in the shaders stage (#2721)
Squash-merged after diff review of PR #2721
2026-11-23 09:35:47 -06:00
f38f5fdeb7 Merge pull request #3398 from kapitche 2026-11-22 17:01:51 -05:00
efb51ac62e shader_carve: an output path under a regular file is a one-line error, not a traceback 2026-11-22 15:24:54 -05:00
76c96f5329 shader_carve: resume scanning past carved deflate payloads 2026-11-22 16:08:12 -03:00
afedb44e14 Merge pull request #1869 from lumenpearson 2026-11-22 09:48:56 -05:00
4a5c257d8a fix(tools): reject an empty shader carve 2026-11-22 17:40:43 +03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
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.
2026-11-22 14:20:30 +00:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
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>
2026-11-22 11:27:00 +00:00
a25462b919 shader_carve: isolate index publication staging 2026-11-22 05:06:11 -03:00
b8fb0816dd shader_carve.py: close archive mmap on exit and reject file output paths 2026-11-22 07:23:18 +01:00
f0de80940e shader_carve.py: a DEFLATE stream must reach its end marker
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>
2026-11-22 06:27:32 +01:00
54989059be shader_carve.py: use argparse, and reject a missing or empty archive up front
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>
2026-11-22 02:47:03 +03:00
c5dc2d0330 shader_carve.py: reject incomplete DXBC parts 2026-11-22 00:04:21 +01:00
7cc6068ab6 Shader stage: resume only finished steps, Windows-safe carve names, clear error on empty unpack (fixes #126)
- 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>
2026-11-21 23:00:32 +03:00
db0dc8bd5e Initial commit: Leonida, build-it-yourself PC port groundwork
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>
2026-11-20 15:22:16 -05:00