Skip to content

README: say what rpf9dump and the assets stage do with BCPack textures - #3816

Open
iurysf wants to merge 1 commit into
ItsNotRexed:mainfrom
iurysf:leonida/readme-bcpack
Open

iurysf wants to merge 1 commit into
ItsNotRexed:mainfrom
iurysf:leonida/readme-bcpack

Conversation

@iurysf

@iurysf iurysf commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Claimed in #3574 (item 1 of #3574 (comment)), found in a docs audit.

The README status row for texture dictionaries and world texture pools said BCPack pool entries "are still skipped by the export" and that the clean-room decoder "is not wired into rpf9dump yet". That is out of date:

  • rpf9dump at the pinned submodule (e293917) decodes BCPack BC1, BC3, BC4 and BC5 chunks in strict mode, and skips BC6H, BC7 and chunks that need unconfirmed history (Core/BcpackDecoder.cs, Core/TtpfReader.cs, tools/rpf9dump/Program.cs:63-65).
  • The assets stage then runs tools/ttpf_assets.py, which uses tools/bcpack.py (all six modes, SUPPORTED_REBUILD_CODECS) to complete what it can; without a local calibration the strict profile refuses unconfirmed history, so the rest is marked limited in manifest.json (make_game.py:1255-1264: "… full BCPack DDS written, … limited (see manifest.json)").

The row now says that, and keeps the caveat that most BC6H/BC7 chunks need a local history table the repo does not ship (docs/textures.md:28-34). One line, docs only; docs/i18n has no copy of this table.

Tested on f847748c (Windows 11, Python 3.14): python -I tests/test_docs_design_rows.py, test_docs_links.py, test_docs_list_items.py, test_docs_repo_paths.py, test_i18n_index.py, test_text_write_line_endings.py: all pass; git diff --check clean. No game files: the export behaviour is read from the code, not run.

AI-assisted: written and checked with Claude (via OpenBot), with an independent AI review against the code and the submodule before submitting.

@shdann

shdann commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Read 52c652c against the code and ran the related tests on Windows, CPython 3.14.7, CPU only (no GPU, no game files): no contradiction found in the statements that can be checked without the game.

  • python -m pytest -q tests/test_ttpf_assets.py tests/test_bcpack.py (venv with the pinned tests/requirements.txt): 18 passed, 2 skipped.
  • With an empty work folder, load_profile returns ('v1-strict', None), and SUPPORTED_REBUILD_CODECS is {1, 3, 4, 5, 6, 7}, as the README text implies.
  • Read on this head: pool discovery and the complete_pool dispatch in make_game.py, error recording in tools/ttpf_assets.py, and the strict codec gating in the pinned rpf9-explorer submodule (e2939175). They agree with the new paragraph.

Not checked: the stated share of real BC6H/BC7 chunks that need history (needs the game), and the native C# export was not run. AI-assisted.

@tupacfan04

Copy link
Copy Markdown
Contributor

Docs tests pass and every claim checks out: BcpackDecoder rebuilds BC1/3/4/5 only, with BC6H/BC7 at SupportsRebuild = false (BcpackDecoder.cs:69-70,97); the strict default is in TtpfReader.cs:108-111 and Program.cs:63; and tools/ttpf_assets.py:59-109, tools/bcpack.py:65, make_game.py:1262-1264, docs/textures.md:28-34 and docs/README.md:25 agree. Merge clean against main, #3765 and #3619.

Two small imprecisions: the manifest records BCPackLimitation (ttpf_assets.py:96), not Limitation; and bcpack is called through ttpf_mips.texture_dds, not directly by ttpf_assets.

Approve. AI-assisted review, docs only.

The Texture dictionaries row said BCPack pool entries "are still skipped
by the export" and that tools/bcpack.py "is not wired into rpf9dump yet".
That is out of date:

- rpf9dump at the pinned submodule (e293917) decodes BCPack BC1, BC3, BC4
  and BC5 chunks in strict mode (Core/BcpackDecoder.cs; BC6H and BC7 are
  "not supported" there, Core/TtpfReader.cs);
- BC6H, BC7 and provisional-history chunks are left to the assets stage,
  which runs tools/ttpf_assets.py after the exporter; it calls
  tools/bcpack.py through ttpf_mips.texture_dds, which rebuilds all six
  modes (SUPPORTED_REBUILD_CODECS = 1, 3, 4, 5, 6, 7),
  but without a local calibration the strict profile refuses unconfirmed
  history, so the stage completes what it can and marks the rest as
  limited (a BCPackLimitation in manifest.json, ttpf_assets.py:96;
  make_game.py:1264 logs "... full BCPack DDS
  written, ... limited (see manifest.json)").

Keep the existing caveat that most BC6H/BC7 chunks need a local history
table, which the repository does not ship (docs/textures.md).

Claimed in ItsNotRexed#3574. Written with AI assistance (Claude, via OpenBot).
Tested: python -I tests/test_docs_{design_rows,links,list_items,repo_paths}.py,
tests/test_i18n_index.py and tests/test_text_write_line_endings.py pass;
git diff --check is clean (Windows 11, docs only; no GPU involved).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@iurysf
iurysf force-pushed the leonida/readme-bcpack branch from 52c652c to 0b279fa Compare November 22, 2026 22:06
@iurysf

iurysf commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @tupacfan04 and @shdann. Rebased onto main 4c52ce27 (the conflict was #3292's Models row, kept as on main) and applied both points in 0b279fae: the row now says tools/ttpf_assets.py runs tools/bcpack.py through tools/ttpf_mips.py, and that the rest is recorded as a BCPackLimitation in manifest.json (ttpf_assets.py:96). Docs tests pass.

AI-assisted (Claude, via OpenBot).

@memorypressure

Copy link
Copy Markdown

Reviewed on Linux: the README rewrite checks out against the code — BCPackLimitation and the ttpf_mips import/wiring exist in tools/ttpf_assets.py as described. The "strict mode" phrasing for rpf9dump I could not pin to a flag from the tree here. AI-assisted: yes.

@kapitche

Copy link
Copy Markdown
Contributor

Read 0b279fae against main 03b09a08: accurate. Merge is clean, tests/test_docs_*.py pass, docs/textures.md link resolves.

  • rpf9dump decodes BC1/3/4/5 in strict mode and leaves BC6H/BC7 and provisional-history chunks: matches docs/textures.md:38-41 and the pinned submodule e2939175 (Core/TtpfReader.cs says BC6H/BC7 stay unavailable).
  • Assets stage: tools/ttpf_assets.py imports ttpf_mips, runs bcpack (SUPPORTED_REBUILD_CODECS = {1,3,4,5,6,7}) and writes BCPackLimitation to the manifest rows (ttpf_assets.py:96). The "most BC6H/BC7 need a local history table" wording is as in docs/textures.md.

@bobcatchris bobcatchris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the new row's claims against the repo (CPU only):

  • tools/ttpf_assets.py:96 records BCPackLimitation per row in manifest.json; the file imports bcpack and ttpf_mips exactly as the text says (ttpf_assets.py:14-16).
  • tools/bcpack.py covers all six codecs (BC1/BC3/BC4/BC5/BC6H/BC7, ALL_CODECS) and has the strict mode whose unconfirmed-history behaviour the row describes (BcpackError, bcpack.py:73,969).
  • The rpf9dump wrapper (tools/rpf9dump/Program.cs) shows the skip-with-limitation path (NotSupportedException or InvalidDataException → skip + message) that the row's 'strict mode, skips BC6H/BC7/unconfirmed-history' wording reflects, at the pinned submodule.

The old text's two claims ('pool entries still skipped by the export', 'not wired into rpf9dump yet') are both stale, and the replacement says precisely what each layer does instead of a vague status. README row, no behaviour change. Approving.

AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants