OpenTPW

Review TPI-FSH-V: Theme Park Inc SHPI reader (commit 425169c)#

October 10, 2026. Independent review of 425169c ("Decode Theme Park Inc's SHPI textures…", parent 6c58be0), merged for testing onto fork main f51e874. The merge is clean. Scope: FshFile, --inspect-fsh, OPENTPW_TPI_PATH, docs/FSH.md, COMPAT-014/015 and the new tests. This review says nothing about how Theme Park Inc (TPI) draws these textures. It makes no claim that TPI is playable or that decoded colours match the original game's output.

Corpus: TPI retail Data extracted from the Dutch/Benelux CD's cabinets, read in place. Nothing from the CD was executed. The CD's third-party no-CD folder was neither opened nor used.

Merge blockers#

None.

Verdicts#

CheckVerdict
Independent decoder vs FshFile, RGBA SHA-256Confirmed: 7,283 of 7,283 match, 0 mismatches (every file, so above the 200-file sample asked for)
Corpus counts in the commit, README, FSH.md, THEME-PARK-INC.md, FORMAT-BACKLOG.mdConfirmed, re-derived with this review's own DWFB walker and RefPack decoder
RefPack padding to 16 enforced only where the data shows itConfirmed
Bounds, caps, truncation, non-seekable input, overflowConfirmed: no unexpected exception type in about 204k mutated or truncated inputs
Rejection of variants not in the corpusConfirmed, with the documented lenient points below
Bounded claims; COMPAT-014/015 wordingConfirmed, with two wording nits (N1, N2)
Build, tests, register, evidence runner, CRLF, git objectsConfirmed (see Build and tests)

1. Independent decoder#

tools/ppc-analysis/lanes/review/test_tpi_fsh_v1.py contains a minimal DWFB directory walker, a RefPack decoder and an SHPI decoder, all written for this review. Unlike FshFile, this decoder is permissive: it accepts any record order and any attached record, and it does not enforce the padding rule. If an assumption in FshFile were wrong, it would therefore show up here as a count or hash difference instead of being hidden. FshFile's output came from a scratch console harness outside the repository. The harness walked WadArchive and wrote one JSON line per file with the RGBA SHA-256 of each image. OPENTPW_FSH_DUMP=<that file> makes the test compare the two, file by file.

2. Corpus counts (re-derived)#

All of the following match the commit. They are asserted in the Corpus tests, which need OPENTPW_TPI_PATH.

FactCount
.fsh files and members7,283 = 162 loose + 7,121 in 303 WADs
SHPI members not named .fsh, or the reverse0
Header id G231, one image; header size equals the length7,283
Image code 0x7B / 0xFB547 / 6,736
Palette 0x24 (all 256 entries) / 0x2A (414 with 256, 2,560 with fewer) / 0x2D4,308 / 2,974 / 1 (snowtrac.wad!stexture/icewall1.fsh)
Palette height field1 everywhere
Name 0x70 present6,649
Attached record orders(0x24, 0x70) 3,824; (0x2A, 0x70) 2,824; (0x24) 484; (0x2A) 150; (0x2D, 0x70) 1. No other code
Four position words zero7,283
Highest index below the palette's entry count7,283
Image at offset 112 after the Buy ERTS gap7,283
Tag equal to the first four characters of the file name7,101
Distinct sizes; most common; largest26; 32×32 3,001, 128×128 2,009, 64×64 1,840; 384×344 and 250×250
Loose .fsh with a TGA thumbnail of the same name70 (0x2A/32-bit 23, 0x24/24-bit 43, 0x24/32-bit 4)
0x2D entries with bit 15 set256 of 256

Not re-derived: the thumbnail and duplicate-texture error figures (MAE table, "12 pairs") and the "36 of 162 loose files with non-zero alignment bytes". These are covered only by the author's asset tests, which pass here (FshFileTests 19/19 with OPENTPW_TPI_PATH).

3. Robustness#

Scratch harness, five corpus files: alphkid (loose, 0x2A, RefPack), icewall1 (0x2D), tb_camera (padded), an_g07 (raw 0x24) and Mutant_Eye (loose, 0x24, RefPack).

4. Claims and wording#

The README row, FSH.md, THEME-PARK-INC.md and FORMAT-BACKLOG.md say "decode to RGBA", "nothing uses them in the game" and "Theme Park Inc is not playable". None of them claims visual fidelity, and all their counts agree with section 2. COMPAT-014 correctly says the opaque, no-colour-key choice is unproven. COMPAT-015 correctly limits the A1R5G5B5 reading to one file whose entries all have bit 15 set.

Nits (not blocking):

5. Build and tests#

Run in a scratch clone with f51e874 merged with 425169c (merge 572422a, scratch only, not pushed).

Not tested#

Resolution on main#

Source: docs/reverse/REVIEW-TPI-FSH.md in the project repository.