Skip to content

third_party/rpf9-explorer: pin 7793a954 so ttpf export reads the pool index once (ASSET-628) - #7997

Open
KyyYE wants to merge 2 commits into
ItsNotRexed:mainfrom
KyyYE:asset-628-ttpf-index-once
Open

KyyYE wants to merge 2 commits into
ItsNotRexed:mainfrom
KyyYE:asset-628-ttpf-index-once

Conversation

@KyyYE

@KyyYE KyyYE commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

ASSET-628 (claim, found by MaxtorCoder).

TtpfReader.CreateDds started with ReadIndex, so rpf9dump ttpf re-read and re-parsed a texture pool's whole index once per texture. Upstream fixed this in breadbbbb/rpf9-explorer@3196f23 (EdouardSence) and merged it as 7793a954: CreateDds reuses the parsed index, cached by path, length and write time. The merge adds a cancellation check before the cache lookup and re-checks the pool after parsing.

This PR moves the third_party/rpf9-explorer gitlink e293917 → 7793a954 (the merge, not its feature-side parent, per review).

Also included from that upstream merge

  • TtpfReader: one row of the 64 KiB tile Patterns table changes (-3,3 → 3,-3).
  • AWC Opus: durations use 48 kHz frames for 32 kHz streams too (AwcRecovery.DecodedSampleRate, OpusPreview.cpp).
  • New PSIN metadata scanner (Rpf9PsinRecovery) for the desktop app's full scan, with the CHKS checksum checked.

Tested

Windows 11, .NET SDK 10.0.301, Python 3.13.0. Synthetic pools only (single-mip 16×16 BC1 textures written by tests/test_ttpf_mips.py's pack_etpf_record / write_rds5_pool), no game data.

Pool e293917 (old pin) 7793a954 Output
4,000 textures 4.7 s ~2 s byte-identical
16,000 textures 44.0 s 7.2 s byte-identical

7793a954 also gave byte-identical output to 3196f23 on the 16,000-texture pool (7.2 s vs 7.3 s). These pools don't exercise the changed tile-pattern row.

With RPF9DUMP_DLL set to the 7793a954 build: test_ttpf_export_resume OK, test_ttpf_mips OK, test_ttpf_assets OK (2 skipped). The two test_rpf9dump_exit_codes failures seen on Windows also fail at the old pin and are covered by #6999.

Not timed on a retail pool. Upstream's commit reports 81 s → 5 s on an 11,241-texture pool.

AI-assisted: yes

…index once (ASSET-628)

TtpfReader.CreateDds re-read and re-parsed the whole texture pool index for
every texture, so rpf9dump ttpf did the index work once per texture instead
of once per pool. Upstream 3196f23, the direct child of the old pin e293917,
caches the parsed index keyed by path, length and write time.

Synthetic 16,000-texture pool: 44.0 s -> 8.4 s, byte-identical DDS output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@senyurah

Copy link
Copy Markdown

One difference from the upstream merge of PR #14: 3196f23c is its feature-side parent. The merged commit 7793a954 adds a cancellation check before the cache lookup and verifies the file snapshot again after parsing. This PR pins the pre-guard version.

I confirmed the cancellation difference on Windows with a synthetic pool. After warming the cache, CreateDds() with an already-cancelled token returned ArgumentOutOfRangeException for an invalid texture index and IOException for a valid index with the pool held open using FileShare.None. Both calls returned OperationCanceledException at the current pin e2939175, the upstream merge 7793a954, and #4687’s 7ef5c51f. This is a library API check; the CLI currently uses the default token. A locked Release build with 7793a954 passed all four TTPF resume tests.

The two reported exit-code test failures are covered by #6999. The tests blocked the old fixed temporary filename; with that test fix they pass with both decoder versions I compared in #4687. No game data. AI-assisted (Codex).

3196f23 is the feature-side parent of upstream's merge of the index cache.
The merge commit adds a cancellation check before the cache lookup and
re-checks the pool's length and write time after parsing, so pin that.

It also brings in the rest of that upstream merge: one TtpfReader tile
pattern row, 48 kHz Opus durations for 32 kHz AWC streams, and the PSIN
metadata scanner.
@KyyYE KyyYE changed the title third_party/rpf9-explorer: pin 3196f23 so ttpf export reads the pool index once (ASSET-628) third_party/rpf9-explorer: pin 7793a954 so ttpf export reads the pool index once (ASSET-628) Nov 23, 2026
@KyyYE

KyyYE commented Nov 23, 2026

Copy link
Copy Markdown
Author

Thanks, you're right. I moved the pin to the merge commit 7793a954 (now 81be629), so the cancellation check and the file recheck after parsing are both in. That also brings in the other changes merged upstream with it (one TtpfReader tile pattern row, the 48 kHz Opus durations, the PSIN scanner), and the description now lists them. Rebuilt on Windows: 16,000-texture synthetic pool 7.2 s, byte-identical DDS to 3196f23, and ttpf_export_resume, ttpf_mips and ttpf_assets pass. Noted on #6999. 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.

2 participants