gxt: decode small text tables through their string pools #56

Manually merged
github merged 1 commit from gh-pr/56/head into gh-pr/56/base 2026-11-27 02:33:07 +00:00
Owner

@⁠Snorps37 on GitHub · 2026-11-24 00:14 UTC · original
Snorps37:fix-gxt-decode → main · +59 −1 · 2 files · 1 commits · merged 2026-11-24 11:05 UTC

Closes #55

Small GXT tables now decode through their {u32, u32 len, u64 ptr} string-pool records.

  • Small tables (fewer than 3 scanned strings): the pooled strings are used alone, which avoids the hash-byte noise the scan picks up.
  • Larger tables: their current output is unchanged. Pooled strings the scan missed are appended, deduplicated.

Tested on data.rpf:

  • Decoded tables: 13,622 → 14,864 of 15,922.
  • Every table that decoded before still starts with the same lines in the same order.
  • 5,390 tables gained lines, mostly short subtitle lines ("OK.", "Hey!") that the old noise filter dropped.
  • Added a unit test with synthetic bytes: a two-string pool placed past the bitmap end.
  • cargo test --release: 120 passed.

The remaining ~1,050 failures have 1 at 0x20 and contain no readable text, so this PR leaves them alone.

**@⁠Snorps37** on GitHub · 2026-11-24 00:14 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/56) `Snorps37:fix-gxt-decode` → `main` · +59 −1 · 2 files · 1 commits · merged 2026-11-24 11:05 UTC Closes #55 Small GXT tables now decode through their `{u32, u32 len, u64 ptr}` string-pool records. - **Small tables (fewer than 3 scanned strings):** the pooled strings are used alone, which avoids the hash-byte noise the scan picks up. - **Larger tables:** their current output is unchanged. Pooled strings the scan missed are appended, deduplicated. **Tested on `data.rpf`:** - Decoded tables: 13,622 → 14,864 of 15,922. - Every table that decoded before still starts with the same lines in the same order. - 5,390 tables gained lines, mostly short subtitle lines ("OK.", "Hey!") that the old noise filter dropped. - Added a unit test with synthetic bytes: a two-string pool placed past the bitmap end. - `cargo test --release`: 120 passed. The remaining ~1,050 failures have `1` at `0x20` and contain no readable text, so this PR leaves them alone.
About 1,200 GXT tables in data.rpf failed to decode. Small tables hold
only one or two strings, below the old three-string minimum, and their
strings often sit after the bitmap region the scan stops at.

Follow {u32, u32 len, u64 ptr} records to null-terminated UTF-8 pools.
Tables with fewer than three scanned strings now use the pools alone;
larger tables keep their current output and gain any pooled string
the scan missed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:33:06 +00:00
github manually merged commit 23772e683e into gh-pr/56/base 2026-11-27 02:33:07 +00:00
Author
Owner

@⁠rpatty-dev on GitHub · 2026-11-24 11:15 UTC · original

merged thanks a ton for sorting the small gxt tables this was a big one

**@⁠rpatty-dev** on GitHub · 2026-11-24 11:15 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/56#issuecomment-7129856073) merged thanks a ton for sorting the small gxt tables this was a big one
This discussion has been locked. Commenting is limited to contributors.
No description provided.