Commit Graph

18350 Commits

Author SHA1 Message Date
703b344166 Docs: add measured asset rows to the design table 2026-11-21 20:06:19 +00:00
ff960f8565 Docs: link the documentation index from the README 2026-11-21 20:05:16 +00:00
612f1edebd Root signature packer + reconciler + hard-fail (fix the least verifiable part of the layer)
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.
2026-11-21 17:04:28 -03:00
78af668e01 Tools: report PSIN LRSC and CHKS fields 2026-11-21 20:02:19 +00:00
a9da38faa3 docs: clarify levels sampling fraction 2026-11-21 20:02:00 +00: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
93481aeb47 Docs: add a documentation index 2026-11-21 20:00:03 +00:00
43459b99df docs: extend levels map inventory with second bounded pass 2026-11-21 19:59:23 +00:00
22514404b7 Translator: implement s_ashr_i64, s_bitcmp0/1, s_bcnt0, and s_ff0 with semantic tests 2026-11-21 20:58:23 +01:00
50efbdb3b5 run_gpu_tests.py: run cs_wavemask like check.py
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>
2026-11-21 20:57:59 +01:00
12ddbc68f3 tests: add ms_clip GPU test and enable shaderClipDistance/shaderCullDistance in vk_harness 2026-11-21 16:57:03 -03:00
26727b5b81 tests: add VS and MS ClipDistance/CullDistance translation tests 2026-11-21 16:57:02 -03:00
79b3542d1f rdna2spirv: emit ClipDistance/CullDistance (and VS misc) from pos1..pos3 2026-11-21 16:57:01 -03:00
950e599577 Docs: decode the RPF9 0DRP page directory
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.
2026-11-21 19:56:46 +00:00
ff573ee55e loader: follow forwarded exports and validate delay-import descriptors
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.
2026-11-21 19:56:27 +00:00
af08a9e696 tests: rebase semantic value coverage onto current main
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.
2026-11-21 19:56:24 +00:00
65d62ffdc8 Tools: preserve duplicate XDAT payloads in fssm_unpack 2026-11-21 19:56:15 +00:00
0412c8c794 story: avoid implying the flat carve groups nested archives 2026-11-21 19:52:06 +00:00
4c75ce537a run_gpu_tests: skip the wave64 mask dumps on devices without 64-wide compute subgroups, as check.py does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:51:37 -05:00
40a3c595e1 story: state the bounded run stop accurately 2026-11-21 19:50:28 +00:00
cfb5f9a329 story: tighten PSIN header handling and measured field wording
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.
2026-11-21 19:49:55 +00:00
ec1dbca94f Docs: measure story and minigame archive composition
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.
2026-11-21 19:46:43 +00:00
67dd9a7b9e Merge pull request #107 from Lucas Motta
# Conflicts:
#	runtime/test/shaders/check.py
2026-11-21 14:43:18 -05:00
c9924321f2 Merge pull request #113 from eIBart0
# Conflicts:
#	runtime/test/vk_pipeline_check.cpp
2026-11-21 14:42:19 -05:00
6dfc0ce82b Merge pull request #119 from Ryx
# Conflicts:
#	README.md
#	runtime/README.md
2026-11-21 14:40:30 -05:00
8bf99edc7a Merge pull request #95 from Ayinaki 2026-11-21 14:40:15 -05:00
d279b28868 Merge pull request #102 from andretuta 2026-11-21 14:40:15 -05:00
fae7c56571 Merge pull request #114 from Kam471 2026-11-21 14:40:14 -05:00
d3bc937e60 Merge pull request #117 from Kam471 2026-11-21 14:40:14 -05:00
db17179b81 Merge pull request #111 from Kam471 2026-11-21 14:40:14 -05:00
f23605ce73 Merge pull request #110 from Kam471 2026-11-21 14:40:14 -05:00
499606e316 Merge pull request #109 from Kam471 2026-11-21 14:40:14 -05:00
c76aa5cf9a Merge pull request #105 from Kam471 2026-11-21 14:40:14 -05:00
d696ffd7bf Merge pull request #99 from Kam471 2026-11-21 14:40:14 -05:00
8a1d1b1713 Merge pull request #98 from Kam471 2026-11-21 14:40:14 -05:00
59654ca5b7 Merge pull request #97 from Kam471 2026-11-21 14:40:13 -05:00
fb0dfda9c3 Merge pull request #96 from Kam471 2026-11-21 14:40:13 -05:00
828cca7729 Merge pull request #108 from Kam471 2026-11-21 14:40:13 -05:00
232f24270d Merge pull request #103 from shizikaep-prog 2026-11-21 14:40:12 -05:00
c1322594db Merge pull request #106 from S1m0ne1997 2026-11-21 14:40:12 -05:00
f1ce84472b Merge pull request #104 from S1m0ne1997 2026-11-21 14:40:12 -05:00
73b2d32309 Merge pull request #118 from Kam471 2026-11-21 14:40:12 -05:00
f2fd0daedb Merge pull request #112 from eIBart0 2026-11-21 14:40:12 -05:00
db2d31d3b8 Translator: --no-asm drops the .spvasm text; make_game uses it (saves ~35 GB on the full corpus)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 14:39:45 -05:00
Ryx
99336386d1 Runtime: D3D12 copies on Vulkan (buffers, textures, uploads, BC) and GetCopyableFootprints
- 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.
2026-11-21 20:33:34 +01:00
617bf181ad CI: keep optional numpy out of module imports and pytest collection 2026-11-21 19:30:39 +00:00
ba191bd6ce Runtime: fail cleanly on malformed JSON in vk_pipeline_check JsonParser 2026-11-21 19:30:29 +00:00
8cfbdc21cc Runtime: wake vk_pipeline_check watchdog via condition_variable on completion 2026-11-21 19:29:37 +00:00
f1dd3c61c5 docs: measure world placement and streaming composition 2026-11-21 19:27:46 +00:00
c2080b5d2d runtime: add optional Bink Audio track extraction test 2026-11-21 19:26:26 +00:00