Commit Graph

33 Commits

Author SHA1 Message Date
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