Commit Graph

39 Commits

Author SHA1 Message Date
339066a207 tex_headers: ask report_paths for the report-path guard
`same_output_path` was a second derivation of `report_paths.same_report_path`, which CONTRIBUTING.md asks a report writer to call, and it missed the helper's folding-volume probe (vfat/exFAT/CIFS mounts let `R.json` and `r.json` pass as two reports). The name stays as a one-line delegation because `tests/test_tex_headers_report_paths.py` patches it to count its calls.
2026-12-01 19:44:40 -05:00
00131bb85e main keeps its own runtime, tools and tests; the branch's variants stay on port/d3d12-nvidia
After the merge the tree held this branch's older states of files main maintains. Run against main's code,
tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have
been built from two generations of its sources. So that the merge cannot break what main builds and tests:

- runtime/ is main's, file for file (68 files only this branch had are not carried over);
- every file under tools/, tests/ and docs/ that both sides have is main's (80 files);
- ten translator tests only this branch has, which test rules main's translator does not have, and their
  fixtures are left out.

What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1,
play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven
notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and
the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia.

Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the
line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own.
Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the
branch's), CI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:58:38 -05:00
b87abdef57 Merge mandy's main into port/d3d12-nvidia
Brings the D3D12 runtime branch (d3d12/, its launcher scripts and notes, and the pull requests reviewed and applied
on it) together with mandy's main.

Conflicts (67 files, none under d3d12/): docs/, make_game.py, runtime/, scripts/build_runtime.ps1, tests/ and
tools/. Every one takes main's side: main is where that code is maintained, and this branch's copies were older
states of the same files or the same pull requests in another form. tests/test_fspx_unpack.py is main's too, as it
tests main's tools/fspx_unpack.py. Nothing under d3d12/ is changed by the merge.

Checked before pushing: python -m compileall over make_game.py, tools and tests; make_game.py --help;
scripts/check_no_game_data.py over the files this adds to main; tests/test_text_write_line_endings.py. The
translator suite, the C++ runtime build and CI have not run on the result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:50:37 -05:00
db250ca9bc PR #1171: tex_headers: ask report_paths for the report-path guard (TEX-HEADERS-SHARED-REPORT-PATH)
From https://github.com/ProjectLeonida/mandy/pull/1171 (head ca8cccc1f647), applied as a reviewed patch.

Co-authored-by: breachato <breachato@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 15:42:20 -05:00
a28d967966 DDS previews batch: tests for the new formats, R9G9B9E5 through tex_export --png
- tests/test_dds_png_dx10.py: hand-built 2x2 texels with padded row pitch and a one-byte-short payload for
  R9G9B9E5_SHAREDEXP (67), B5G6R5 (85), B5G5R5A1 (86), R8G8 SNORM/UINT/SINT (51/50/52),
  R8 SNORM/UINT/SINT (63/62/64) and R10G10B10A2 TYPELESS/UINT (23/25, checked against UNORM 24);
  these merged without tests.
- tools/tex_headers.py: list DXGI 67 in DXGI and FMT_INFO (4-byte element), so the indexer keeps such
  textures and tex_export --png reaches dds_png's decoder instead of "unsupported format" (ecox982745's
  finding on #2218). New tests in test_tex_export.py (index -> DDS -> PNG) and test_tex_headers.py.
- tests/test_tex_export.py: the "undecodable format" cases used DXGI 25, which #2320 now decodes; they use
  R8G8B8A8_UINT (30) instead. FMT has 57 entries with 67.
- tools/dds_png.py, tools/tex_export.py: one docstring list of the decoded formats instead of the per-PR lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 13:22:35 -05:00
de4b0c122d tex_headers: handle UTF-8 BOM on index.json reads (#6269)
Squash-merged after diff review of PR #6269 - tex_headers: handle UTF-8 BOM on index.json reads
2026-11-23 08:26:04 -06:00
d5af57f999 Merge pull request #2645 from Lucy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:49 -05:00
67dfec1660 Merge remote-tracking branch 'origin/main' into ttpf-volume-patterns
# Conflicts:
#	tests/test_ttpf_mips.py
2026-11-23 02:48:23 +00:00
86d4f3c130 Merge pull request #3491 from wxrrry 2026-11-22 17:02:16 -05:00
4419744fe7 Merge pull request #2680 from Kam471 2026-11-22 16:59:33 -05:00
75de778023 tools/tex_headers: handle shifted table pages, dynamic header offsets and strict pointer tag validation (ASSET-274) 2026-11-23 00:41:18 +03:00
cac7fe25cf tex_headers: address review comments on pointer tags, JOAAT name mapping, and mip layout
- tools/tex_headers.py: read mips from flags at +0x42 (flags >> 16) and preserve b6 at +0x3e.
- tools/tex_headers.py: validate system pointer tag (0x5...) and reject null pointers so all-zero buffers produce empty records.
- tools/tex_headers.py: match texture names by lowercase JOAAT32 hash rather than index position.
- docs/textures.md: wrap lines under 118 chars and label dry cell occupancy as hypothesis.
- tests/test_tex_headers.py: add tests for differing b6/mips offsets, zero buffers, invalid tags, reversed and missing names.
2026-11-23 00:17:56 +03:00
14c5b93ff7 Merge remote-tracking branch 'origin/main' into feature/asset-274-textures-rpf 2026-11-23 00:16:19 +03:00
47938586a4 tex_headers: decode texture dictionary system pages and verify DXGI formats (ASSET-274)
- Add parse_texture_dict_page in tools/tex_headers.py to extract grcTexture descriptors, name hashes, and data offsets from pgDictionary pages.
- Update docs/textures.md resolving the ASSET-274 hypothesis: all 1,313 texture page pairs are keyed by waterfog/waterfog2 joaat32 hashes matching the active world streaming grid cells, with formats strictly matching DXGI enums (0x5f = BC6H_UF16, 0x62 = BC7_UNORM, 0x4d = BC3_UNORM).
- Add synthetic unit tests in tests/test_tex_headers.py for parse_texture_dict_page.
2026-11-22 23:41:01 +03:00
993dff588f Merge pull request #3176 from Marco Luzzaro 2026-11-22 15:15:27 -05:00
a490bf2a55 tex_headers: prefilter the report path guard
An existing regular report with one link and a non-input basename cannot alias a scanned index.json or .bin stream. Skip the per-file realpath/samefile loop for it; missing paths, links, input-like names and symlinked inputs are still compared.
2026-11-22 20:08:50 +00:00
f847748cc7 Merge origin/main (7 pull requests merged on GitHub)
# Conflicts:
#	docs/design.md
#	tools/psin_data.py
2026-11-22 14:46:26 -05:00
7768de3ce2 Report texture index output directory errors 2026-11-22 20:36:01 +01:00
cb6cd67a68 Merge pull request #2680 from OpenCode 2026-11-22 13:17:01 -05:00
ac44474cac fix(tools): retain small textures in the descriptor index
The minimum-size heuristic discarded small textures before the exporter could read their descriptors.
2026-11-22 19:10:57 +01:00
db188f6bfe tex_headers: refuse reports that alias a carve blob 2026-11-22 17:50:02 +00:00
b43a9dad55 ttpf_mips: 3D SW_4KB_S volumes use AMD's bit order for 2-, 4- and 16-byte elements
VOLUME_PATTERNS_4K rows 1, 2 and 4 and the matching tile extents in
tex_headers._VOLUME_4K_TILE matched no GFX10 pattern in Mesa addrlib. They
now follow GFX10_SW_4K_S3_PATINFO (the RbPlus table is identical, and so is
rpf9-explorer's VolumePatterns): 2-byte tiles are 8x16x16, 4-byte 8x16x8,
16-byte 4x8x8. In the 1.0.2.1 corpus this changes the one R16_FLOAT volume
(ttdb_graphics #901): adjacent-Y voxel differences fall from 0.357 to 0.067 of
the random-pair level, adjacent-Z from 0.029 to 0.007, and the check's 3D
Z-diff from 0.023623 to 0.004238 (29.3x below the 2D control instead of 5.3x).
The two 8-byte volumes are unchanged. New VolumePatternTest pins the table to
addrlib's rows and checks the extents follow from it; it fails on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:40:50 +00:00
d041ba4664 fix(tools): encode DDS pitch and top mip size correctly
The DDS header describes a single uncompressed row or the top compressed level. Recording the complete payload misstates those layouts when lower mips or multiple slices follow.
2026-11-22 18:22:49 +01:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
7fbc618e88 Merge pull request #1443 from pushkarreddyy 2026-11-22 06:38:05 -05:00
15326e84f4 tex_headers: refuse report destinations that overwrite input manifests 2026-11-22 16:59:53 +05:30
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
0848764046 tex_headers: a malformed carve index.json is one ERROR line, not a traceback
scan_archive() read index.json's "files" rows unchecked, so an index of
the wrong shape ({}, {"files": "oops"}, rows without off/head) ended in
a KeyError or TypeError traceback after the carve had finished. main()
now reports it as 'ERROR: cannot read <path>: <reason>' with exit 2, as
gamedata_index.main() does, before writing anything.

Found by @ray3242.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:47:59 -06:00
638c407735 tex_headers: R11G11B10 and R10G10B10A2 map to GFX10 36/50/54, not 43/44/48
GFX10 format names list channel widths from the top bit, so R11G11B10_FLOAT
(red in bits 10:0) is 10_11_11_FLOAT (36) and R10G10B10A2 is 2_10_10_10 (50,
54), as runtime/src/gfx10_descriptors.h already uses. 11_11_10_FLOAT (43) and
10_10_10_2 (44, 48) have no DXGI twin.
2026-11-22 12:07:10 +05:30
8915480d17 tex_headers: create the --out folder instead of losing a finished scan
main() opened the output path directly after walking every carved archive, so
naming a file in a folder that does not exist ended the run in a
FileNotFoundError traceback with the results already computed. Create the
parent folder first, as #941/#966 and navmesh_index (#1009) do.

Tests: CliInputTest runs the tool with --out under missing nested folders and
requires exit 0 plus the JSON on disk. Negative control on main: that case
fails; with the change 56/56 pass.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:45:20 -06:00
fee6c26fa4 Fix DDS cubemap array size 2026-11-21 21:19:09 -05:00
569d4aa33a Textures: decode all 697 TTPF 2D arrays, streaming cubemaps and 3D volumes (ASSET-36) 2026-11-21 21:31:04 -03:00
ba977f5a71 tex_headers.py: check the carve folder and --archives names before scanning
A missing carve folder ended in a FileNotFoundError traceback from os.listdir, and an --archives name without
an index.json in a traceback from scan_archive, after earlier archives had already been scanned. A folder with
no carved archive at all wrote an empty textures_index.json. All three are now usage errors (exit 2) and
nothing is written.

Tests: CliInputTest in tests/test_tex_headers.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:36:38 +03:00
ea80364306 Textures: name the compact rule in the tex_headers module doc 2026-11-21 21:23:48 +00:00
0589fb5a37 Textures: share the compact layout and record the after split 2026-11-21 21:23:48 +00:00
ab5e88950e tools, tests: add stdlib paths for tex_headers and rtti_scan and un-skip CI tests 2026-11-21 17:18:04 -03:00
617bf181ad CI: keep optional numpy out of module imports and pytest collection 2026-11-21 19:30:39 +00:00
9755e72780 test(tools): add DDS synthesis, mip calculations, and GFX10 format mapping tests for tex_headers 2026-11-21 19:08:22 +01:00
db0dc8bd5e Initial commit: Leonida, build-it-yourself PC port groundwork
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>
2026-11-20 15:22:16 -05:00