Commit Graph

18350 Commits

Author SHA1 Message Date
03a9973f8d Docs: FSSM/RDNA2 cross-check against SCARAB
Adds a fact-level comparison of SCARAB's FSSM, rDNA2 classification and XBSC notes with Leonida's tools, plus a synthetic repro for the duplicate tag-0x0D XBCH loss.
2026-11-21 19:25:36 +00:00
ffd26b0a9f Docs: record the completed s2 shard (10/12, 22,092 modules) 2026-11-21 19:23:35 +00:00
a87d11cacd Tools: index the PSIN metadata container 2026-11-21 19:22:22 +00:00
Ryx
40f6399088 Runtime: Vulkan-backed ID3D12Device behind the Xbox-ABI proxy
- d3d12_vulkan_device.cpp: an ID3D12Device11 (PC ABI) the device proxy
  forwards to. Creates queues, allocators, command lists (incl.
  CreateCommandList1), fences, descriptor heaps (32-byte slots; RTV/DSV hold
  TargetViews), render-target and depth-stencil views, committed buffers
  (upload/readback mapped and zeroed) and 2D textures in the common formats,
  and answers feature-level and architecture queries. Everything else is a
  generated stub that logs once.
- First use of a new texture zero-fills it and moves it to the layout the
  command expects (vulkan_replay.h initialize), as D3D12 committed resources
  start zeroed; no submission at creation. CREATE_NOT_ZEROED skips the fill.
- Children hold the proxy, so GetDevice returns the Xbox-ABI object; COM base
  classes moved to d3d12_com_object.h. D3D12 queues share one VkQueue behind a
  submit lock.
- D3D12XboxCreateDevice: LEONIDA_D3D12=vulkan creates the Vulkan device on its
  own instance and wraps it in the same proxy (gta6rt built with the Vulkan
  SDK and Python 3); the host PC device stays the default.

Tests: d3d12_vulkan_device_test calls everything through the proxy (heaps via
slot 14 with RAX start handles, a render target via slot 76 with the Xbox
layout word) and reads colour, depth, stencil and a never-written texture
back; it also runs the standalone device. Clean under the Khronos validation
layer with the other GPU tests; all 6 ctest tests pass.
2026-11-21 20:22:20 +01:00
83316689c9 docs: note the BVH family is 99.95% of inflated bytes 2026-11-21 19:21:25 +00:00
1681676f5a Docs: measured BVH archive composition
Index the three *_bvh4 RPF9 packs with the fixed carver and record the measured stream/byte composition. Add tools/bvh_index.py for the 0x81020006 header family (tag + 0x140 + 64*n == end), with synthetic tests. No game data, keys or carved payloads are included.
2026-11-21 19:19:53 +00:00
ca801d9419 Tests: add no-GPU unit tests for SPIR-V stub generation and graphics metadata 2026-11-21 16:18:02 -03:00
428e250b84 Runtime: compile real graphics pipelines (ps/vs/ms/gs) in vk_pipeline_check
- Pair ps/vs/ms/gs shaders with partner stubs from <spirv>/stubs/ and compile
  real pipelines via vkCreateGraphicsPipelines with Vulkan 1.3 dynamic
  rendering (color attachments from outputs, depth attachment when writes_depth,
  VK_EXT_mesh_shader for ms, vertex input bindings for vs).
- Enable only optional extensions needed by the selected shaders; report
  shaders missing required device features or stubs as skipped rather than failed.
- Add --stage all|cs|graphics (--compute-only / --graphics-only), per-stage
  module/pipeline/skip/timing reporting, and guard VK_KHR_maintenance8 for
  older Vulkan headers. Preserves PR #28 --jobs, cache, --start/--count, and SLOW.
2026-11-21 16:18:02 -03:00
7837080454 Tools: add pure-Python SPIR-V stub generator and graphics metadata fields
- Add tools/spirv_stubs.py to emit minimal deduplicated SPIR-V 1.0 VS/PS
  partner stubs into <spirv>/stubs/ using only the standard library.
- Record writes_depth, gs_input_locations, and gs_output_locations in
  shader_meta() (keeping all existing fields intact and avoiding overlap
  with PR #76 / PR #83 fields).
- Generate stubs automatically when rdna2spirv.py or build.py writes index.json.
2026-11-21 16:18:01 -03:00
957dfb24bd Fix: stop dropping first instruction in shader_ir.parse_file on LLVM 21+ and un-xfail vcc_half test
- shader_ir.parse_file() unconditionally skipped lines[0] as a comment header,
  while tests/conftest.py wrote raw llvm-mc stdout without a header line.
- On LLVM 14/18/19, llvm-mc emitted a leading '.text' directive on line 0 so
  lines[1:] skipped '.text'. On LLVM 21/22, llvm-mc stopped emitting '.text',
  causing parse_file() to drop the first instruction (s_mov_b64 exec, -1 in
  test_wave64_bfm64_and_half_cmp_emit_wave_ops's vcc_half shader), which left
  g.wave64 = False and made s_bcnt1_i32_b32 count both halves.
- Only skip lines[0] in parse_file() when it is not an instruction line, skip
  assembler '.' directives (like '.text'), prepend a synthetic header in
  tests/conftest.py, and restore the strict assert in tests/test_translate.py.
2026-11-21 16:17:58 -03:00
352300704d Runtime: skip oversized modules in vk_pipeline_check, and record the corpus pass 2026-11-21 19:17:43 +00:00
4d6733baa2 docs/design.md: whole-wave mask tests are exact only on 64-wide subgroups
The "Whole-wave masks" row said cs_wavemask checks all 64 lanes, which reads as if it passes
everywhere. On an RTX 4090 (subgroup 32) s_bcnt1_i32_b64 of lanes 16-47 counts one half
(#101); check.py skips these tests there since #35. Say so in the row.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:16:29 +01:00
c2e3d811a8 tests: skip cs_imgload where image reads need a format
vk_store_test requested shaderStorageImageReadWithoutFormat for both
modes, so vkCreateDevice failed on GPUs without it (Intel Gen9) and
cs_imgstore failed too, though only image_load needs the feature.
Request it in load mode only, exit 77 when it is missing, and have
check.py list that as skipped instead of failed.
2026-11-21 16:16:27 -03:00
d51bddc84e GPU tests: skip what the device can't run instead of failing (fixes #88 points 2-3)
vk_store_test exits 77 when the GPU lacks format-less storage image read/write (Intel Gen9), and check.py
reports it as SKIP. run_gpu_tests.py catches up with check.py: ps_flat (drawn with vs_ids), ps_legacy_mul,
and ps_bitmask_perm judged on lanes 0-31 only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:16:04 -05:00
5504d5eff4 runtime/CMakeLists: find d3d12.lib/dxgi.lib in the Windows SDK outside a Developer Prompt
find_library only searches %LIB%, which a plain shell doesn't set, so configuring with the
Visual Studio generator from a normal terminal (`cmake -S runtime -B runtime/build`, as the
CI workflow's check job does) skipped root_sig_test and device_proxy_test with
"d3d12.lib not found", although the generator links against that SDK. Look in the
generator's target SDK (KitsRoot10/Lib/<version>/um/x64) and in WindowsSdkDir when set.

Tested on Windows 11, VS 2022 Build Tools 14.44, SDK 10.0.26100.0, VS generator from a plain
shell: both libraries found, root_sig_test and device_proxy_test build and pass (WARP).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:15:24 +01:00
464c3903ab Docs: measured common.rpf game-data composition
Measure the XML/config layer of the 1.0.2.1 common.rpf: 954 zlib streams, 50.2 MB inflated, 266 XML documents across 118 roots with no RBF0, PSIN or Bink 2. Add a stdlib index tool and synthetic tests.
2026-11-21 19:15:06 +00:00
008aa3d3b0 Tools: parse the audio-config music record table 2026-11-21 19:13:50 +00:00
241b03c9bf docs: note that all multi-chunk RBF0 resources are wide
The three narrow resources are single-stream; also drop a no-op line from the attribute test.
2026-11-21 19:10:11 +00:00
691527329c tools, viewer: add stdlib world.json/.glb chunk builder and harden viewer 2026-11-21 16:10:06 -03:00
3008b3fd0d fix: initialize submodules in linked Git worktrees 2026-11-21 22:09:32 +03:00
4f4189ef3e tests: follow #38 (f16 op_sel helpers) in the mutation/negative controls; test_shader_checks knows #73's wave64 dumps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:09:15 -05:00
9bc8453baa docs: measured RBF0 composition in data.rpf, with rbf0_index
1,263 RBF0 resources parse to their exact last byte under the measured record grammar: 1,243 single-stream and 20 multi-chunk, 1,260 with the FB FF 01 00 prologue and 64-bit scalars, 3 without it and 32-bit scalars. No section directory or name-hash table exists. The anim.rpf rig-set blob is the same format with a different root schema.

tools/rbf0_index.py indexes an RPF9 data area or a carved directory and writes CSV/JSON; tests/test_rbf0_index.py builds synthetic headers only. No game data is added.
2026-11-21 19:08:57 +00:00
df508f3444 docs: distinguish hash presence from record confirmation 2026-11-21 19:06:07 +00:00
7f993ac8b4 docs: measured navmesh archive composition
Full RPF9 stream index of navmeshes.rpf (90,295 streams), the measured 0DRP directory-page layout, rejected AABB/NVMS pseudo-magics, and data/levels cross-check counts. Adds a stdlib navmesh_index.py and synthetic tests; no game data.
2026-11-21 19:06:01 +00:00
df86dba224 docs: scope the motion-matcher sample 2026-11-21 19:04:30 +00:00
2a0a77f15b docs: scope the bone-table resource count 2026-11-21 19:04:04 +00:00
018fda6d82 tools: parse RBF0 rig sets and bone-table resources 2026-11-21 19:02:31 +00:00
126062ae4a Runtime: initialise a loaded module's TLS and DllMain
Mapping an image never ran anything. TLS callbacks and DllMain were documented as the caller's, and
nothing called them, so a module that needs either could not be brought up at all.

Loader::initialise() now allocates the module's TLS slot, copies the template and SizeOfZeroFill into
it, writes the slot index into the image, runs the TLS callbacks with DLL_PROCESS_ATTACH, then calls
the entry point of a DLL as DllMain. Every address it follows is bounded like the rest of the loader:
the directory, the template, the index, the callback table and each callback, with a 1 MiB ceiling on
the block. Only DLLs get DllMain; an EXE's entry point has a different signature and stays the
caller's to run, and --dry-run still runs nothing.

The tests build an image whose TLS callback and DllMain are real machine-code stubs that store a
sentinel, so they check the code actually executed rather than merely being parsed.
2026-11-21 19:00:06 +00:00
71d17d05dd Merge pull request #35 from Zmirzz
# Conflicts:
#	runtime/test/shaders/check.py
#	runtime/test/shaders/cs_wave64_ballot.asm
2026-11-21 13:59:47 -05:00
4732779175 Merge pull request #32 from Kam471
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-21 13:59:19 -05:00
646d48a0d1 Merge pull request #38 from Ewann 2026-11-21 13:58:57 -05:00
aa3fe0461d Merge pull request #30 from cxccxc 2026-11-21 13:58:57 -05:00
6d2e1ed92f Merge pull request #34 from Lucas Motta 2026-11-21 13:58:56 -05:00
3294bdd048 Merge pull request #33 from Kam471 2026-11-21 13:58:56 -05:00
af60f909d1 Merge pull request #31 from Kam471 2026-11-21 13:58:56 -05:00
d9eba909c1 Merge pull request #37 from Kam471 2026-11-21 13:58:56 -05:00
453df5d388 Merge pull request #92 from Kam471 2026-11-21 13:58:56 -05:00
46aa35a1ed Merge pull request #91 from Kam471 2026-11-21 13:58:56 -05:00
58952ed353 Merge pull request #80 from eIBart0 2026-11-21 13:58:56 -05:00
2a732e0881 runtime/CMakeLists: fix the merged test section (close the loader if(WIN32), drop the replaced clear test, link d3d12_xs_device into the tests that link d3d12_xs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 13:58:28 -05:00
851b0eb079 tests: rtti_scan imports pefile only in its CLI; mark the wave64 vcc-half bcnt1 case as a known gap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 13:56:08 -05:00
ba1f2c620c tests: follow #73 (mask_sgprs removed, cur_masks is a dict); test_shader_index finds tools/ on its own
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 13:51:22 -05:00
9d28e6d210 Contributing: document runtime and package-gated tests 2026-11-21 18:47:37 +00:00
f9176e5176 Merge pull request #84 from Kam471
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-21 13:47:02 -05:00
917e821067 Merge pull request #79 from Ryx
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-21 13:47:02 -05:00
4a513f3db2 Merge pull request #62 from Kam471
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-21 13:47:02 -05:00
36555f1d33 Merge pull request #72 from Kam471
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-21 13:46:53 -05:00
6c9085acd5 Merge pull request #73 from eIBart0
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	tools/rdna2spirv.py
2026-11-21 13:46:45 -05:00
eb7c304893 Docs: RPF9 archive and carve-tool guide 2026-11-21 18:46:38 +00:00
b70ddd632c Merge pull request #85 from Kam471
# Conflicts:
#	docs/design.md
2026-11-21 13:46:24 -05:00