Design for the d3d12_xs -> Vulkan layer: object model mapping, one BDA arena for buffers/descriptors/code, descriptor heap and hash-table model, root-signature to user-SGPR mapping, shader contract production, boot milestones, and the open questions. Includes verified package evidence (XboxBvhBuilder export signatures and imports, FSR IIDs, encrypted gameos.xvd) with reproduction notes. No code changes, no game data.
Add tests/semantic: translate two hand-written, branch-free pixel shaders
(ps_sdwa, ps_ops) and execute the resulting SPIR-V with a small strict
interpreter, asserting every mrt0 word against hand-derived expectations.
Catches wrong-value regressions (SDWA selects/sext, min3/max3, bfe_i32,
packed f16 FMA) that spirv-val cannot.
- Standard library only; no LLVM, SPIRV-Tools, GPU or game files.
- Interpreter rejects unmodelled constructs instead of approximating.
- Negative controls sabotage translated output; mutation tests sabotage a
temporary copy of tools/ and require the matching test to fail.
- Fixtures are generated from runtime/test/shaders/*.asm.
- CI job semantic-tests (Windows + Ubuntu, Python 3.12), discovery limited
to tests/semantic.
awc_opus.py is CPU-bound in its pure-Python Ogg CRC and runs one bank at a
time: the 28.5 GB of AWC banks take roughly 80 minutes. Export banks in a
process pool (default: half the CPU count) and make parse_awc return its
music list instead of storing it on the function, which a pool cannot share.
On a 1.07 GB / 112-bank sample: 110.9 s with --jobs 1, 32.2 s with --jobs 6,
and all 9,812 output files byte-identical.
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.
Preserve whole-wave mask operations, saved EXEC values and flat
pixel inputs when generating SPIR-V. Keep a dispatch-loop fallback
alongside structured control flow and share the descriptor probe.
Add reproducible GPU fixtures for these cases and exercise the
control-flow and mask analyses in CI.
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>
The BVH step is emulated over buffer reads in AMD's node format (box16/box32/triangle), with RADV's
watertight triangle test and sorted box children. GPU-checked with a synthetic BVH (vk_compute_test bvh).
All 64 ray-tracing compute shaders translate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- wave64 detected per shader; v_mbcnt and EXEC writes use the hardware lane (LocalInvocationIndex in CS/MS).
- s_mov_b32 exec_lo/exec_hi with a constant now sets each lane from its own bit (any non-zero constant
used to enable every lane). GPU-checked (cs_exec64).
- spirv/index.json: stage, wave size, capabilities/extensions, Vulkan features, bindings, local size, LDS,
mesh/GS limits and IO locations per shader, so pipelines can be created up front.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Mesh shaders -> VK_EXT_mesh_shader: PSV0 limits/topology/group size, v5 = workgroup index, s3 = wave
id << 24, NGG exports staged per thread and written after OpSetMeshOutputsEXT (GS_ALLOC_REQ counts).
GPU-checked (VKH_MESH mode in vk_harness).
- Geometry shaders ($GS_VoxelizeGeneric): LDS-ring inputs/outputs mapped to gl_in / staged slots,
EMIT/CUT -> OpEmitVertex/OpEndPrimitive. GPU-checked (VKH_GS mode).
- SCC is now set by s_and/or/xor/andn2/orn2/nand/nor/xnor/lshl/lshr_b32 (result != 0),
s_add/sub_i32 and s_addk_i32 (signed overflow), s_min/max_u32; it was left stale before. GPU-checked.
- buffer_store_format(_d16) encodes every table format (sub-dword elements via atomics); it silently
stored nothing for most formats before. GPU-checked with vk_compute_test.
- Far branches folded; d16 buffer loads; gather4_l(_o) emulation; gather offsets; 1D/a16 image stores;
BITMASK_PERM swizzles; f64 add/convert; i24 mul/mad, alignbyte, xnor, ffbh_i32, swap, s_abs, s_bfm,
64-bit ordered/cmpx compares, 16-bit compares, 8/16-bit global loads, neg() operands.
Co-Authored-By: Claude Opus 5.5 <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>
Rows held lazy projections that kept every decoded model alive; 149,811 models on levels.rpf exhausted
memory at the final serialization. Rows are now written as they are produced, to a .partial file renamed
when complete. Design notes record that most shaders are wave64 (32-wide subgroups on NVIDIA) and that
mesh shaders are NGG wave64 with the merged-shader SGPR layout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Compute: FSSM word 0x138 is COMPUTE_PGM_RSRC2 (user SGPRs, workgroup-id enables, thread-id VGPRs,
LDS size), 0x13C..0x144 the group size; checked against 2,689 CS. GPU-checked with vk_compute_test.
- LDS as a Workgroup array (reads/writes/read2/write2/st64/sub-dword/atomics/cmpst), ds_bpermute,
s_barrier as a workgroup control barrier.
- s_cbranch_vccz/vccnz/execz/execnz decided wave-wide (OpGroupNonUniformAny); v_cmp writes 0 for
inactive lanes. GPU-checked.
- image_store for 2D/2D array/3D with float/uint/sint views picked from the T# FORMAT at run time.
- Raw barycentric reads via BaryCoordKHR (321 PS), POPS via fragment-shader interlock, image_sample_o
offsets, fma_f16 op_sel, 64-bit v_cmpx, vcc_lo scalar loads, s_addk to specials, undeclared vertex
components, normalized-encoding re-anchoring, array image_get_lod/gather4_lz, image_sample_l LOD on
arrays (was reading the layer).
- Duplicate vector/pointer type declarations merged; vk_harness enables barycentrics/interlock/maintenance8.
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>
SDWA src/dst selects were ignored, so 3,826 translated shaders passed
spirv-val but computed wrong values. Sources are now narrowed (with sext())
before neg/abs, and results placed at dst_sel per dst_unused. GPU-checked with
the new synthetic shaders in runtime/test/shaders.
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>