Skip to content

third_party/rpf9-explorer: pin 7ef5c51 for large index buffers and mid-page model streams (ASSET-128, ASSET-129) - #4687

Open
Mast3rL wants to merge 4 commits into
ItsNotRexed:mainfrom
Mast3rL:asset-128-rpf9-large-mesh
Open

Mast3rL wants to merge 4 commits into
ItsNotRexed:mainfrom
Mast3rL:asset-128-rpf9-large-mesh

Conversation

@Mast3rL

@Mast3rL Mast3rL commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Items: ASSET-128 and ASSET-129 (claim 128, claim 129).

Depends on: none.

What

Both decoder fixes were already merged upstream, both by @cxchhh, but main still pinned e293917, from before them:

This PR moves third_party/rpf9-explorer to 7ef5c51, upstream main's current tip, as @Krashgamer suggested. That commit also contains ad41e794 (#4638's pin) and 65a9b02a (#4548's pin), so whichever of #4638, #4548 and this lands second only drops its one-line pointer change.

docs/models.md gets a "Re-count at 7ef5c51" section with the numbers below. Five sentences in docs/models.md, docs/world.md and docs/textures_arrays.md that named e293917 as the current pin now say 7ef5c51 or "since e293917".

Measured on my own copy (counts only)

tools/rpf9dump models built at both pins, run on the same input:

Input e293917 7ef5c51 Only at e293917 Only at 7ef5c51
packs.rpf (whole) 26,585 27,484 0 899, all mid-page
pack/shared_minigame000/... (whole) 1,294 1,296 0 2, both mid-page
pack/core_restofworld/... (whole) 936 936 0 0
levels.rpf, bytes 0x10F0000000 + 0x60000000 18,946 18,950 0 4, all at a page start + 0x10
levels.rpf, bytes 0x6B0000000 + 0x40000000 4,712 4,712 0 0
levels.rpf, first 4 GiB 1,230 1,230 0 0
  • Every run: fail=0 skip=0.
  • ASSET-129: all 901 new models in packs.rpf and shared_minigame000 start mid-page, which the old scan never looked at.
  • ASSET-128: the two levels.rpf ranges were chosen around the largest single meshes in the e293917 export (up to 64,288 triangles). Two of the four new models there have a single mesh above 65,535 triangles (66,251 and 76,793). Why the old decoder dropped the other two (largest mesh 56,095) wasn't determined.
  • Not re-run: the rest of levels.rpf (a full export is about 213 GB) and the other archives.

Not covered

Tests

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…d-page model streams (ASSET-128, ASSET-129)

The new pin is upstream main's tip. It brings ItsNotRexed#18 (index buffers with
more than 65,535 triangles or vertex references) and ItsNotRexed#19 (model streams
on every 16-byte boundary, not only page starts), both by cxchhh, and
b3678413, which raises the model index cache schema so old caches are
scanned again. It also contains the commits that ItsNotRexed#4638 (ad41e794) and
ItsNotRexed#4548 (65a9b02a) pin, and ItsNotRexed#13, ItsNotRexed#16, ItsNotRexed#17 and ItsNotRexed#22; those were not
re-measured here.

docs/models.md: a re-count at the new pin. rpf9dump models with both
pins on the same input: packs.rpf 26,585 -> 27,484 (899 new, all
mid-page), shared_minigame000 1,294 -> 1,296, core_restofworld 936 =
936; two levels.rpf byte ranges chosen around the largest meshes gain 4
models, two of them with a single mesh above 65,535 triangles. In the
re-run inputs nothing the old pin found is lost; fail=0 skip=0 in
every run.

docs/models.md, docs/world.md, docs/textures_arrays.md: sentences that
named e293917 as the current pin now name 7ef5c51 or say "since".
docs/textures.md has two such sentences, left alone because ItsNotRexed#4638 and
ItsNotRexed#4050 edit those lines.

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

@Kam471 Kam471 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.

Checked 87a6d239f on Windows 11.

  • git submodule update --init third_party/rpf9-explorer cloned and checked out exactly 7ef5c51fdea346bcd9373a98bb4a427209a25ae3.
  • tests/test_docs_links.py -> 6 OK, tests/test_docs_table_rows.py -> 2 OK; git diff --check clean.

The docs rows move to the new pin's behaviour (large index buffers, mid-page model streams); I cannot re-run the package checks here, but the pointer and docs checks are consistent. No blocking issue.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 87a6d23 merged with main 98fa503 on Linux (Python 3.12.16): pass - docs-only; tests/test_docs_*.py 10 files, 30 tests OK. No new tests, so no negative control. Checked: 7ef5c51 exists in rpf9-explorer, is on its main, and is a descendant of the old pin; b3678413 does change the model index schema 4 -> 5; PRs #13, #15-#19, #22, #24 are merge commits in that range; the table deltas are right (27,484 - 26,585 = 899, 1,296 - 1,294 = 2, 18,950 - 18,946 = 4). The model counts themselves were not re-run (no game data, no .NET here).

@Mast3rL

Mast3rL commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @kapitche for checking the pin and the table.

Full levels.rpf run, to cover what the slices didn't: tools/rpf9dump models at 7ef5c51 over the whole archive (ok=343,641 fail=0 skip=0, 2,702 s), compared model by model with my existing e293917 export of the same archive (343,327 models):

  • 314 models only at 7ef5c51, 0 only at e293917.
  • 32 of the 314 have a single mesh above 65,535 triangles (largest 91,642); the e293917 export has none (ASSET-128).
  • 42 of the 314 start mid-page (ASSET-129).
  • The other 240 start at a page start + 0x10 and have no mesh above 65,535 triangles; why e293917 dropped them was not determined here.
  • No offset produces more than one file in either export, so the 16-byte scan adds no duplicate or overlapping models on this archive.

Counts only, measured on my own copy (Fedora 44, .NET 9 SDK). The docs section in this PR still says the rest of levels.rpf was not re-run; I can update it with these numbers if that's wanted.

AI-assisted (Claude Code).

@Idealism3937

Copy link
Copy Markdown

Independent check at 7ef5c51, at candidate/offset level (complements the model-level run above).

Verified git rev-parse = 7ef5c51fdea346bcd9373a98bb4a427209a25ae3 on a 1.0.2.1 copy; levels.rpf is 76,155,065,056 bytes. The harness called only Rpf9ModelRecovery.FindCandidateOffsets(path, 0, null, progress) and RecoverAtOffsets in 32-offset chunks on all cores; no export, no index cache, archive opened read-only.

Stage Result Time
Candidates 235,580 168.6 s
Recovered distinct offsets 235,573 191.3 s
Rejects 7 —

Total wall 359.9 s. Arithmetic: 235,580 - 235,573 = 7. Against e293917 (235,330 candidates, 71 rejects, 235,259 recovered): candidates +250, all recovered; recovered +314 = 64 from upstream #18 + 250 from #19. Every reject is at page+16, so the 250 mid-page candidates #19 adds are all in the recovered set.

All 7 rejects satisfy offset & 4095 == 16; there are no mid-page rejects. They cluster at three pages:

Page Reject offsets
0x100EF0E 0x100EF0E010
0x110CCB2 0x110CCB2010, 0x110CCB5010, 0x110CCBD010
0x1119F3F 0x1119F3F010, 0x1119F43010, 0x1119F5C010

Offsets only; no model or archive bytes.

Two stale spots the PR does not touch:

  • README.md:245, the "Want to help?" bullet: "Model recovery: investigate the 71 unrecovered fragment candidates in levels.rpf".
  • docs/models.md:101-104, the "Remaining 72 rejects" paragraph: still says 71 and diagnoses ProbeRequiredExtents / MetadataComplete == false on the first zlib block. (The same "71" ask recurs at docs/models.md:692 in What to do next.)

Upstream #18's own body measures 235,259/235,330 -> 235,323/235,330 and attributes 64 of the 71 to ReadMesh's 65,535 triangle/reference caps being hit after a complete probe, not to the probe; the remaining 7 are 6 no-LOD/empty-bounds fragments plus 1 model + 40 bone array that runs 32 bytes past the system page. So the "MetadataComplete on the first block" diagnosis describes the pre-#18 decoder, not the current 7.

Would you rather fold a 71 -> 7 correction into this PR, or land a docs-only follow-up on top of it? Not asking for an export here.

A full levels.rpf scan and recovery at 7ef5c51 (reviewer run, PR ItsNotRexed#4687
comment) gives 235,580 candidates, 235,573 recovered, 7 rejects. Add the
counts and the 7 offsets to the re-count section, relabel the 72-rejects
paragraph as the e293917 state, drop its pre-ItsNotRexed#18 MetadataComplete
diagnosis, and update the README "Want to help?" bullet and next-steps
item 4 to the 7.

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

Mast3rL commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@Idealism3937 Thanks for the full-archive run. I folded the 71 -> 7 correction into this PR in 20933cb8.

  • docs/models.md, "Re-count at 7ef5c51": your levels.rpf scan and recovery counts (235,580 / 235,573 / 7 against 235,330 / 235,259 / 71), credited to your comment and noted as not re-run by me, plus the 7 reject offsets. The "not re-run" sentence above it now says "not exported", since the scan has now been run.
  • The "Remaining 72 rejects" paragraph is now labelled as the e293917 state. It drops the MetadataComplete diagnosis and cites fix(runtime): type D3D12 root signature forwarding #18's attribution of 64 of the 71 to the 65,535 caps.
  • README.md:245 and next-steps item 4 now say 7, and link to the re-count section.

One correction to the offset table: the 7 offsets are on 7 distinct 4 KiB pages (offset >> 12 differs for each), so the doc groups them as three nearby clusters, not three pages. I also hedged the link to #18's 6 + 1 breakdown: #18 measured e293917 + #18 without #19, and the counts agree, but nobody matched the 7 offsets to that breakdown.

Tests: test_docs_links, test_docs_table_rows, test_docs_list_items, test_docs_repo_paths, test_docs_cli_flags, test_check_no_game_data, test_text_encoding, test_text_write_line_endings: OK. Docs-only change, no new real-data run on my side. A fresh reviewer checked the arithmetic, offsets, anchors, attribution and stale-text grep; it found the page grouping and the attribution wording, both fixed.

AI-assisted (Claude Code).

Mast3rL and others added 2 commits November 23, 2026 00:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@memorypressure

Copy link
Copy Markdown

Merges cleanly with current main; the gitlink lands on 7ef5c51 and all docs guards pass at the merged tree, including the new re-count anchor. Upstream submodule content could not be re-verified from this sandbox (no submodule fetch), so the PR #18/#19 claims and re-count numbers are taken as reported. One cross-check for maintainers: #4050 pins a different rpf9-explorer commit (BCPack history) — worth confirming 7ef5c51 subsumes it rather than dropping that pin. CI pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested PR #4687 (52ffe4983134e26b755fc9719bab975b27a71f8c) on Windows 11 / Python 3.12.10.

  • Trial merge against origin/main (d974c88a): clean (exit 0), git diff --cached --check passed.
  • Tests:
    • python -I tests/test_docs_links.py: Ran 6 tests in 0.148s — OK
    • python -I tests/test_docs_table_rows.py: Ran 2 tests in 0.031s — OK
  • Code read: Bumps the third_party/rpf9-explorer submodule pin from e2939175 to 7ef5c51f and updates README.md, docs/models.md, docs/textures_arrays.md, and docs/world.md with the 7ef5c51 re-count table and remaining levels.rpf reject notes.

AI-assisted review (Gemini 4 Neon).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 52ffe49 merged with main 3faac55 on Linux (WSL2), Python 3.12.16: pass.
Ran all 10 tests/test_docs_*.py files (30 tests) plus tests/test_make_game_submodule.py (3) and tests/test_make_game_assets_decoder.py (5) with -I: all OK. The new anchor #re-count-at-7ef5c51-asset-128-asset-129 matches the new heading and test_docs_links passes.
No new tests and no code, so no negative control applies. Focused read of the diff: the README, textures_arrays.md and models.md edits agree with each other and with the gitlink change (e293917 -> 7ef5c51).
Not checked here: the 7ef5c51 counts themselves (need the game data), and that the commit exists on the rpf9-explorer remote. Other docs (README.md models row, docs/design.md, docs/README.md, character_models.md) still say "at the e293917 pin"; those are measurements tied to that pin, so I read that as intended, not a mismatch.

@Mast3rL

Mast3rL commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my breakdown above: the split of the 314 new models was wrong. My comparison read offsets from file names and missed names ending in _child_XXXX, so 208 mid-page dictionary children landed in the "other" group. Grouped by the manifest's recovery offset, the 314 are:

That's 250 + 64, matching @Idealism3937's offset-level count and the "+314" paragraph in docs/models.md. Nothing is left unexplained, and no docs change is needed. Counts only, from my own copy.

AI-assisted (Claude Code).

@senyurah

senyurah commented Nov 23, 2026 •

Copy link
Copy Markdown

I verified that the pin here also covers ASSET-628: 7793a954 (breadbbbb/rpf9-explorer#14, cached texture indexes) is an ancestor of 7ef5c51f. On Windows 11 with .NET SDK 10.0.201, locked Release builds of both pins succeeded with zero warnings.

I exported a synthetic 256-entry BC1 pool using both builds of rpf9dump ttpf. All 256 DDS files matched byte for byte. For the same pool, a TtpfReader.CreateDds() loop measured after one warm-up call allocated a median of 107.4 MB at e2939175 and 3.7 MB at 7ef5c51f (three runs, median elapsed time 400 ms vs. 91 ms). These are synthetic measurements.

With the newer pin and the consumer code from main at dde82f27e, all four test_ttpf_export_resume.py tests passed. Two Windows write-failure tests in test_rpf9dump_exit_codes.py failed identically with either pin. A trial merge of this PR into that main reported conflicts in README.md and docs/models.md. No game data used. AI-assisted (Codex).

Follow-up on the two exit-code tests. They blocked the old fixed .partial path, but the atomic writer now gives each temporary file a unique name. With #6999 (adfd0fdc1) applied to dde82f27e, the tests block the final destination instead. All eight pass with the same consumer code against both e2939175 and 7ef5c51f. Current ci.yml already invokes the suite after building rpf9dump via #1978, so #6999 matters independently of this submodule bump.

Conflict resolution on dde82f27e. I resolved both files in an isolated checkout. In README.md, keep main’s newer D3D12 status and this PR’s seven remaining model candidates. In docs/models.md, keep main’s previously measured e293917 geometry totals and this PR’s 7ef5c51 re-count. The README’s “full export pending” line and the slice-only note can refer to the full export already reported in this thread: 343,641 vs. 343,327 models. The staged gitlink is still 7ef5c51f. Links on all four changed Markdown pages resolve, and the table, list, repository-path and no-game-data test files pass on Windows. The resolution is local.

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.

7 participants