- The mode file is written before the translation starts (index.json is absent
then), not after it: a stop between the merge and the old write left an index
with no mode, which counted as "off" and either re-translated hours of work
or passed emulated shaders off as native.
- auto keeps shaders that were translated with emulation when this run would
not emulate (a GPU asleep or hidden, vulkaninfo missing): they are exact on
every GPU. An explicit --wave64-emulate off still translates natively.
- auto turns emulation on when tools/vk_subgroup_info.py says the runtime's GPU
can't be made to run compute and mesh 64-wide (subgroupSizeControl, both stage
bits: vk_pipeline_check's can_require_sg); it never turns it off.
- smallest_max_subgroup gives None (unknown, so on) when a device prints no
subgroup size instead of leaving it out of the minimum.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Without --stages, runtime (Windows only for now) is left out off Windows.
Before, the default build ran shaders and assets (hours) and then failed
in runtime, so pipelines never ran.
- Asked for explicitly off Windows, preflight() refuses it before any work.
- pipelines finds vk_pipeline_check where CMake builds it off Windows
(runtime/build/linux as in the README, or runtime/build as in
CONTRIBUTING.md) instead of only vk_pipeline_check.exe, and says how to
build it when it is missing. Windows is unchanged.
- tests/test_make_game_platform.py (9 tests, 6 fail before this change);
test_make_game_preflight.py's all-tools test asks for runtime only on
Windows, since it is now refused elsewhere.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LLVM 23 prints a VOP3/VOP3P source it doesn't read (SRC1/SRC2 of one- and
two-source ops) as 0x80, inline constant 0, where the game's compiler stores 0.
Re-anchoring in shaders with code-embedded data compares the printed encoding
with the blob, so those instructions never matched and 1,471 of the 1,473 such
shaders were rejected ("reachable instruction with normalized encoding").
same_encoding now ignores an SRC1/SRC2 field only when it is 0 in the blob and
0x80 as printed; a source LLVM does read prints as decoded (s0), so a real
difference still fails. The existing VOP3P op_sel_hi rule now combines with it.
make_game.py: `dotnet` is on PATH with only the .NET runtime, and the asset
stage then fails in `dotnet build` ("No .NET SDKs were found"). The preflight
now asks `dotnet --list-sdks` for an SDK 8 or newer.
Tested on Windows 11, LLVM 23.1.5 (MSYS2 UCRT64 llvm-tools), the 1,473
shaders with embedded data, disassembled with this branch's shader_disasm.py:
main: 2 translated, 1471 "normalized encoding"
this branch: 1473 translated, 1473 pass spirv-val
Full corpus on the earlier tree with the same rule: 26,503/26,503 pass.
.NET check: false with only the runtime installed, true after adding SDK 8.0.428.
No GPU pipeline run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013qV4hmKSJmU6cXAgrehZzr
Since 7cc6068 (#126) the disassembly counts as finished only by disasm.done.
Work folders built before it have none, so their next build disassembled
the whole corpus again and, as that drops spirv/index.json, translated it
all again too: hours of work on a build that was already finished.
- A folder whose translation finished (spirv/index.json) but has no
disasm.done gets the marker: translation only ever ran after disassembly.
- The disasm moved from its old place next to the carve folder is marked
finished, so it is translated again as intended, not disassembled again.
Two tests in tests/test_shader_stage_resume.py; both fail before this change.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#152 added rdna2spirv.py --wave64-emulate (wave64 compute and mesh shaders exact on any
subgroup size), but the build never passed it, so 32-wide GPUs (NVIDIA, Intel) got the
native translation.
- auto (default) reads the smallest maxSubgroupSize from vulkaninfo and turns emulation on
below 64, or when vulkaninfo is missing or tells nothing (the emulated output is exact
everywhere). on and off are taken as given.
- The mode used is written to spirv/wave64_emulate.txt; a change translates again. A folder
without the file counts as off, which is how it was made.
- translate() passes the flag to every shard.
- Tests: tests/test_make_game_wave64.py (new), resume and argparse tests extended.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LLVM_MC may be one executable or a command line such as the WSL llvm-mc documented for Windows. shader_disasm.py already split it, but the tests, runtime/test/shaders/build.py and scripts/run_gpu_tests.py treated it as a single executable, so the documented setup skipped translator tests, and build.py passed a Windows path to WSL. Share the splitter in tools/mc_command.py and feed assembly on stdin.
scripts/build_llvm_mc.ps1 sparse-clones the LLVM sources llvm-mc needs,
builds it alone with LLVM_TARGETS_TO_BUILD=AMDGPU, static CRT and the DIA
SDK off (its headers need ATL, which the C++ build tools don't always
include), checks it disassembles an s_endpgm for gfx1013, keeps only
llvm-mc.exe and sets LLVM_MC for the user. README, docs/design.md and the
make_game.py / shader_disasm.py hints mention it next to the WSL route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- --jobs 0 (or a negative count) was accepted: translate() then started no
rdna2spirv.py shard, found no failed shard, and ran --merge over nothing,
so the translation step looked finished; shader_disasm.py's thread pool
raises on 0 workers. --jobs now takes a positive integer (the same check
as tools/manifest.py's positive_int); argparse exits 2 otherwise.
- The "--out and --work must be outside the game folder" check compared
paths with case, so on Windows `--out c:\games\gta6\out` passed for the
game folder C:\Games\GTA6. Both sides now go through os.path.normcase.
- tests: two new cases in test_make_game_argparse.py (the case test runs
on Windows only, where paths compare without case).
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The audio steps had the same resume problem as the shader stage (#126):
- make_game.py: the Ogg Opus and XMA2 steps counted as done once their
folder existed, which a stopped run also leaves. They now count as done
by a marker (audio/ogg.done, audio/xma.done) written after the step
succeeds.
- make_game.py: XMA2 -> WAV with ffmpeg now runs on every assets run for
the streams that have no .wav yet, writes to a temporary name renamed on
success, and checks ffmpeg's exit code. A failed or stopped decode no
longer leaves a short .wav, and installing ffmpeg after the first run now
decodes the streams instead of never trying again.
- awc_opus.py: .ogg/.wav files are written under a temporary name and
renamed, so a stopped run or a full disk never leaves a truncated file.
A read/write error (OSError) now fails the run (exit 1) so the step is
retried; banks that do not parse are still skipped as before.
- tests: new tests/test_audio_stage_resume.py (10 tests, standard library
only); WavValidationTest updated to set up the new markers.
AI-assisted.
Co-Authored-By: Claude Opus 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>
Only require ffmpeg when the assets stage will run, so --wav with shaders/runtime only is not blocked. Add tests/test_audio_wav.py: standard-library unittest, skipped without ffmpeg, pinning a 1 s Ogg Opus to an exact 48,000-frame 16-bit mono 48 kHz WAV and checking resume and missing-ffmpeg behaviour.
Add tools/audio_wav.py (stdlib only): recursive .ogg/.opus discovery, ffmpeg to pcm_s16le, mirrored paths, skip existing, --jobs, clear summary, and a clear error when ffmpeg is missing. It trims to the Ogg Opus end granule (minus pre-skip) so ffmpeg cannot keep a partial final frame. Wire it into make_game.py behind --wav, after the Ogg Opus step, with an ffmpeg preflight. Update README and the awc_opus docstring.
The official Windows LLVM build ships no llvm-mc.exe and has no AMDGPU
target, which is what issue #7 ran into. A tool that existed but could
not disassemble produced empty output, so shader_disasm.py counted 0
invalid words, wrote an empty .s per shader and reported every one as
"clean"; make_game.py then translated nothing.
Probe one s_endpgm before the run and stop with the tool's own error.
Empty per-shader output is now "failed" and exits 1, never "clean".
LLVM_MC may be a whole command line, so Windows can call WSL's llvm-mc:
set LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc
make_game.py accepts the same form in preflight and need(); README and
design.md now state the real requirement. New tests cover a missing
tool, a missing AMDGPU target, empty output and the success path.
rdna2spirv.py reads index.json, the .dxbc files and fssm/ from the parent of the
.s folder. With disasm/ next to dxbc/, 25,040 of 26,503 shaders got stage '?' and
were rejected. Old work folders get disasm/ moved in and spirv/ redone.
Co-Authored-By: Claude <noreply@anthropic.com>
rdna2spirv.py already shards; make_game.py ran it as a single process. Start one
--shard per job, fail if any shard fails, then --merge. On 1,200 shaders: 3m43s
on one process, 58s on 6, byte-identical .spv and index.json.
Co-Authored-By: Claude <noreply@anthropic.com>
make_game.py found only data/ttdb pools; 11 more live in pack/<name>/data/ttdb and now go to
ttpf_pack/<pack>/. All 57 pools exported (308,895 textures, 0 failures) and 160,898 models.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make_game.py no longer needs --game: it looks for a supported copy in the usual
places (by a few file sizes only), asks when there are several or none, checks
every prerequisite and free space before a long build, and fetches the
rpf9-explorer submodule when git is available. Build.bat runs it by double-click.
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>