AI-assisted (Muse Spark + explorer fleet).
Implements docs/d3d12_vulkan.md section 3.5 as code: a portable D3D12
root-signature model (1.0/1.1, no d3d12.h) plus a packer that lays root
parameters into the 32 user-SGPR dwords in root-parameter order (constants
take N, views/tables take 2, static samplers take none). Anything that does
not fit - more than 32 user SGPRs (spill layout unknown) or more than the
64-dword D3D12 cost limit - is refused loudly instead of truncated.
tools/root_sig_contract.py reconciles a candidate signature against every
shader's user_sgpr_reads from spirv/index.json (const32 vs constant dwords,
64-bit VAs vs view/table pairs, unpaired-hi detection) and exits nonzero on
the first contradiction; --cluster shows which read-set shapes the game
actually needs.
The RTS0 chunk reader is marked hypothesis until the new Windows oracle
test (synthetic descs serialized by the real d3d12.dll) confirms the layout;
Tier A (model/packer/canonical codec/RTS0 self-consistency/reconciler) runs
everywhere with no game data and no GPU.
Tested: python -m pytest tests/test_root_sig_contract.py (12 passed);
full suite 651 passed, 20 skipped, 1 xfailed; compileall + make_game --help;
portable C++ test 17/17 PASS under g++ -Wall -Wextra -Wpedantic -Werror with
ASan+UBSan; turing atlas on RTX 2060 SUPER (subgroup 32, mesh/bary/m8/heap
true): compute32/ballot64/f16_input/maintenance8 valid, broken_negative
correctly invalid. Windows-only Tier B (oracle + MSVC build) runs in CI.
- 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>
cs_wavemask had no branch in run_gpu_tests.py, so it was silently left
out. Run it in wavemask mode with --require-wave64 and skip it where the
device has no 64-wide compute subgroup, as check.py and the wave64 dump
tests do since 4c75ce5.
Checked on RTX 5090 (subgroup 32..32): 19/25 passed, 6 skipped, exit 0.
Not checked on a 64-wide (AMD) GPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measure the 0x60-byte header, the +0x38 table of {hash,size,pointer} resource records, and continuation streams. Correct the +0x60 key claim: it is payload on 29,297 of 29,298 pages. Add a stdlib page indexer with synthetic tests.
parse_exports stored base + RVA for every export, but an export whose RVA lands inside the export
directory is a forwarder string ("KERNEL32.Sleep"), not code, so an import of one received a pointer
into the string. Forwarders are now recorded separately and followed when an import asks for one:
bundled modules first, then LoadLibraryEx/GetProcAddress for system DLLs, with a depth cap so two
modules re-exporting each other stop instead of recursing. An unresolvable forwarder records the
import as unimplemented.
The delay-import walk also assumed every descriptor is RVA-based and has a name table. A descriptor
without dlattrRva stores 32-bit virtual addresses, which cannot address an x64 image base, so it is
rejected with a message instead of being misread. A missing address table is rejected, and a missing
name table now reads its entries back through the address table.
Port the #78 value-level cases (ps_ops5, ps_ops6, ps_vcc_x2, ps_flat,
cs_bounds) onto main's semantic suite. Keep main's ps_ops4/ps_legacy_mul
coverage and forward-only execution contract, and extend the mini
interpreter with 64-bit integers, Input/PushConstant seeding, physical
storage buffer memory, OpBranch/OpPhi at forward merges, and the opcodes
the new fixtures use.
Use the PSIN +4 first-section offset when it points at a known tag, keep the LSCH fallback, and test the header path. Label the RSC8 +8 field as a u32 rather than a proven size, and state that no RSC7 header was found instead of claiming absence.
Index story000, shared_minigame000, and their script/restofworld/bvh4 companions with the fixed carver. Record the measured PSIN section chain, 0DRP page headers, RSC8 v8001 headers, nested RPF9 sub-archives, Bink 2 video and the bounded story000 layout. Add a stdlib story_index.py and synthetic-header tests; no game payload or name is committed.
- IR: CopyBufferRegion, CopyTextureRegion (subresource or placed footprint,
optional box) and CopyResource, with D3D12's call rules (512-byte footprint
offsets, 256-byte pitches, non-empty boxes).
- Replay: vkCmdCopyBuffer / CopyBufferToImage / CopyImageToBuffer / CopyImage.
Footprint pitch becomes bufferRowLength; BC extents stop at the mip edge;
every range and buffer bound is checked before anything is written. Copies
run in TRANSFER_SRC/DST, or in place in GENERAL for a COMMON texture
(implicit promotion). 2D only.
- Device: buffers expose their VkBuffer; BC1-7 formats; textureCompressionBC
enabled when present; GetCopyableFootprints for buffers and 2D textures.
Compared with the PC runtime over 13 descriptions, which showed planar
depth-stencil rows are padded to 512 bytes.
- Each submission ends with a barrier to the host so readback buffers hold the
GPU's writes after the fence wait. BC textures are not zero-filled on first
use (Vulkan cannot clear them; the validation layer caught the first try).
Tests: d3d12_vulkan_device_test now reads results back through D3D12
(CopyTextureRegion into a readback heap, Map) and adds an upload list: a
pattern into a texture, CopyResource into a COMMON texture, a boxed copy, a BC1
round trip and CopyBufferRegion. command_list_test covers the copy rules. All
GPU tests are clean under the Khronos validation layer; 6/6 ctest.