Commit Graph

11 Commits

Author SHA1 Message Date
3d49d31cba Merge pull request #2258 from kirigayakazima/fix/gamedata-blobs-safety
gamedata_blobs: fix unshipped count, index type checks, and atomic JSON
2026-11-29 15:09:20 +01:00
9234f6b0f4 Merge pull request #1269 from TheGeogeo/test/non-ascii-paths
tests: check paths with non-ASCII characters in the child's own encoding (TEST-NON-ASCII-PATHS)
2026-11-28 09:05:17 +01:00
843a265f47 gamedata_blobs: guard .bk2 carve inputs and parse index.json once 2026-11-27 20:03:54 +08:00
d1545dfdef gamedata_blobs: fix unshipped count, index type checks, and atomic JSON
Fix SGD5 unshipped overlap counting in cross_reference_sgd5(), validate
nonnegative pure-int off/stored and UTF-8/RecursionError in check_carve_index(),
avoid double-parsing index.json in main(), validate --shaders and
trailing-separator --json paths upfront, and write --json atomically
with published_mode and replace_retry.
2026-11-26 18:51:19 +08:00
1e9c868cb6 tests: check paths with non-ASCII characters in the child's own encoding (TEST-NON-ASCII-PATHS)
These cases decoded a child's ANSI or OEM output as something else, so they failed on Windows when the temp folder's name was not ASCII.
2026-11-24 22:06:00 +01:00
15f30f0a97 gamedata_blobs: Region 1's lowest cell offset decides where Region 3 starts
parse_spatial_grid_blob found Region 3 as the trailing run of 4-byte-aligned
words below the blob size. When the last word(s) of Region 2 happen to be such
a value, the run took them in, Region 3 started too early and a valid grid was
rejected ("Region 3 start ... does not match lowest cell offset ..." or
"Region 3 offset leaves Region 2 bounds").

docs/gamedata.md (the 0x23c000 row) locates Region 3 as the trailing run
matching min(cell_offs). The run is now only the search range: Region 3 starts
at the lowest start in it where Region 1 (which ends at the lowest Region 3
word) has that start as its lowest cell offset. Blobs main accepted parse the
same; with no agreeing start the old checks still reject the blob.

Tests: cynbun's repro with several colliding last words, a run of three
colliding Region 2 words, truncated blobs, and a skipped first Region 3 word
that has no consistent split. The colliding cases fail on main.

Finding by cynbun in old upstream 7049 (old numbers link nowhere now).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:44:02 -05:00
2e15bb5ed5 tests: gamedata_blobs expects exit 2 and ERROR: for a missing input (#6701)
#6701 made a missing input one "ERROR: ..." line with exit 2 in gamedata_blobs and four
other tools, and tests/test_missing_input_exit_codes.py checks that. The older
BadCarveIndexTest.test_missing_file_names_what_is_wrong still wanted exit 1 and an
"error:" prefix, so tests/test_gamedata_blobs.py failed on main.

assert_one_error takes the expected code and prefix; the missing-file case asks for 2
and "ERROR:", and the four bad-carve-folder cases keep 1 and "error:".

Tested: python -I tests/test_gamedata_blobs.py (8 tests OK, 1 failure before) and
python -I tests/test_missing_input_exit_codes.py OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:34:02 +01:00
d612f6548f gamedata_index, gamedata_blobs: read carve index.json with utf-8-sig (#6555)
Squash-merged after diff review of PR #6555
2026-11-23 12:45:51 -06:00
c6e56d96fd gamedata_blobs: a bad carve folder is one error line naming the index and the bad row (#5948)
Squash-merged after review of PR #5948 - gamedata_blobs: a bad carve folder is one error line naming the index and the bad row
2026-11-23 08:07:59 -06:00
01ae62c873 gamedata_blobs: compute VFX data lines, Region 3 spans, and fix docs/tool alignment 2026-11-23 04:16:33 +01:00
3cbf800bc5 gamedata_blobs: decode common.rpf text preload/VFX settings and binary tables 2026-11-23 02:19:36 +01:00