Commit Graph

18350 Commits

Author SHA1 Message Date
30267d09b5 tex_export: read the addrlib patterns on first use; add tests
tex_export.py called amd_swizzle.load() at import, so the module could not
be imported (or tested) without Mesa's gfx10SwizzlePattern.h. The patterns
are now read once, on the first eq4k call; behaviour is otherwise unchanged.

tests/test_tex_export.py (pytest, skipped without numpy) covers, on
synthetic swizzle equations and textures, with no game data or header:
eq4k picking the entry per bpe and reading the patterns once; detile
offsets (row-major for a linear equation, a permutation of whole tiles,
partial tiles padded); the DX10 DDS header; export_one choosing the top mip
at the data offset or at the end of the mip chain on both scoring paths
(Pillow and raw bytes), gpu_chain reassembly, the blob cache, unsupported
formats and data outside the blob; and main()'s log, ordering and --limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:07:09 +01:00
c5aeb1526c Tools: census every map resource in levels.rpf 2026-11-21 21:06:18 +00:00
bed17e998e Tests: cover stereo streamed-music manifest fields 2026-11-21 21:05:35 +00:00
b39592d530 Test two-plane vertex clip coverage against per-pixel CPU masks 2026-11-21 13:05:32 -08:00
ce2cf75785 Merge main and share compute fixture header overrides 2026-11-21 22:04:18 +01:00
1def0f7a1f CI: build vk_harness with Vulkan headers that lack maintenance8 2026-11-21 21:03:23 +00:00
dd199d1549 rdna2spirv: ignore pos1..pos3 exports when OSG1 is absent 2026-11-21 18:02:52 -03:00
783d7af1e2 Merge branch 'fix/llvm-mc-command' of https://github.com/mokkymiah/Leonida into fix/llvm-mc-command 2026-11-21 21:02:08 +00:00
bb20c19651 Textures: make the compact mode split reproducible in scan 2026-11-21 21:02:00 +00:00
48613bbda9 Tests: pin classify_carve classes and rpf_probe header reads 2026-11-21 21:01:30 +00:00
d50ba56650 Tools: decode RBF0 trees for UI and subtitles
Add a stdlib record/tree decoder for the measured RBF0 format. It joins 64 KiB continuations, parses the inline descriptor table, builds element/attribute/content/text trees, and writes JSON plus optional generic XML. Unknown descriptors, record types and malformed framing fail closed with a partial tree. Add synthetic tests and the measured grammar, samples and remaining unknowns to docs/rbf0.md; note the rig-set blob tree result in docs/animation.md.
2026-11-21 21:01:14 +00:00
4be73f9bbb Textures: tighten the compact tool wording and BC coverage note 2026-11-21 21:01:03 +00:00
c3cd32888f Textures: report the compact standalone/tail split in scan 2026-11-21 21:01:03 +00:00
39631ee147 Textures: decode the TTPF compact mip tail 2026-11-21 21:01:03 +00:00
5b3bbad6e6 Test compute workgroup Y/Z registers on a 3D Vulkan dispatch 2026-11-21 22:00:38 +01:00
503c8716e4 Tools: export stereo streamed-music AWC channels correctly 2026-11-21 21:00:20 +00:00
66a410edf0 Accept LLVM_MC as a whole command in the tests and GPU tools
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.
2026-11-21 21:00:03 +00:00
aae4d99e10 check.py: draw each pixel test at the wave size recorded in index.json (fixes #146)
RADV runs fragment shaders as wave64 on RDNA1 unless asked; a wave32 test then reads lanes it never wrote
(ps_bary, ps_uniform_branch). run_gpu_tests.py already passed VKH_SUBGROUP_SIZE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 15:57:04 -05:00
eb1bde307b Accept LLVM_MC as a whole command in the tests and GPU tools
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.
2026-11-21 20:56:01 +00:00
530246a6e7 tests: loader_test fills its byte buffer with uint8_t{0} (C4244 x2 under /W4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 15:55:49 -05:00
43daf286dc Tools: catalog the common.rpf XML documents 2026-11-21 20:55:43 +00:00
005fd935d1 Add SECURITY.md: private reporting and cleanup for committed game data
Added a SECURITY.md file detailing security reporting procedures and guidelines for handling sensitive game data.
2026-11-21 23:51:46 +03:00
95b2c091c8 Build a native Windows llvm-mc with the AMDGPU target, no WSL needed
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>
2026-11-21 21:50:01 +01:00
5be11c035f tests: pin the D3D12 stub generator's parsing and output
gen_d3d12_stubs.py runs during the Windows build, so its only current
safety net is the compiler rejecting bad generated code. These cases pin
the interface grammar, inheritance order, return conventions, directive
passthrough and the idempotent write, using a synthetic header instead of
the Windows SDK.
2026-11-21 20:48:38 +00:00
16d285e7bc Merge pull request #152 from AlxcBTW
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-21 15:47:57 -05:00
89ca8c85e5 Merge pull request #149 from eIBart0 2026-11-21 15:47:57 -05:00
0d7dbaa4dd Merge pull request #159 from Diesel 2026-11-21 15:47:57 -05:00
690aab328f Merge pull request #164 from Kam471 2026-11-21 15:47:57 -05:00
6a0a3ec541 Merge pull request #113 from eIBart0 2026-11-21 15:47:56 -05:00
7ec7511da0 Merge pull request #140 from IAmNotSiob 2026-11-21 15:47:56 -05:00
556fc4a1db Merge pull request #161 from S1m0ne1997 2026-11-21 15:47:56 -05:00
e149b42875 Merge pull request #153 from NWX10 2026-11-21 15:47:56 -05:00
b7a233d0c1 Merge pull request #165 from NWX10 2026-11-21 15:47:56 -05:00
180fd6c556 Merge pull request #162 from NWX10 2026-11-21 15:47:56 -05:00
0f85eec343 Merge pull request #154 from crastinator 2026-11-21 15:47:56 -05:00
94fa29042c Merge pull request #160 from Ayinaki 2026-11-21 15:47:55 -05:00
dae4be1781 Merge pull request #151 from andretuta 2026-11-21 15:47:55 -05:00
9b5e01b9c6 Merge pull request #145 from Ayinaki 2026-11-21 15:47:55 -05:00
0788af6303 Merge pull request #144 from errusso 2026-11-21 15:47:55 -05:00
6b102f8931 Merge pull request #150 from Kam471 2026-11-21 15:47:55 -05:00
7cdae2b450 Merge pull request #148 from Kam471 2026-11-21 15:47:55 -05:00
240c54e6ea Merge pull request #143 from Kam471 2026-11-21 15:47:55 -05:00
899e334406 Merge pull request #141 from Kam471 2026-11-21 15:47:55 -05:00
5716b7ed9c Merge pull request #139 from Kam471 2026-11-21 15:47:54 -05:00
8b0e1a2733 Merge pull request #133 from Kam471 2026-11-21 15:47:54 -05:00
71414bf0bf rpf9dump: write every output under a temporary name and rename it into place
make_game.py takes ttpf manifest.json and audio_manifest.json as proof that
a step finished, and every exporter skips a file that already exists. Both
were written in place, so a stopped run or a full disk could leave:

- a truncated manifest, after which make_game.py skips that texture pool
  or the audio banks on every later run, or
- a truncated .dds / .obj / .xma.wav under its final name, kept forever
  because the next run sees it exists.

All outputs (ttpf DDS + manifest, audio_manifest.json, XMA2 .xma.wav,
model .obj, embedded and dictionary .dds) now go through Util.WriteAtomic:
written to <path>.partial, then File.Move'd over the final name; the
temporary is removed on failure, and a stale one from a stopped run is
deleted first (WriteXmaWave opens its target with FileMode.CreateNew).
The models manifest already worked this way.

Util moves to its own file so tests/Rpf9DumpDiagnostics can link it; the
diagnostics program gains four checks for WriteAtomic.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:47:34 +03:00
9d02cc9f37 Assets stage: resume stopped audio steps, keep no partial files, retry failed XMA decodes
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>
2026-11-21 23:47:33 +03:00
6139be94f5 manifest.py: fail when the input directory cannot be scanned 2026-11-21 21:47:05 +01:00
52b50d99bb runtime/test: load MoltenVK on macOS so the GPU tests run on Apple GPUs 2026-11-21 21:41:39 +01:00
71d39cefb9 Rework RTS0 parser to offset-table layout; harden oracle test
Per maintainer feedback: the real blob is a DXBC container whose RTS0
chunk starts version, numParameters, parametersOffset, numStaticSamplers,
staticSamplersOffset, flags, with parameters as a {type, visibility,
offset} table and payloads at their offsets (d3d types follow
D3D12_ROOT_PARAMETER_TYPE numbering, not the model's enum order).

Also fixes the oracle segfault mechanism: return early when parsing fails
instead of indexing an empty model, and bounds every offset addition in
size_t so hostile containers cannot wrap the guard into an OOB read.
Adds a wild-offset control plus a DXBC-walk test (19 portable checks green
under ASan+UBSan).
2026-11-21 17:40:40 -03:00