You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
skin_streams: recognize fragments with null optional header pointers - #2379
Claimed in the coordination issue as: new BUILD item (ID pending) — #2078 (comment)
What and why
tools/skin_streams.py::resource_kind classifies resource headers before the skin-stream census can walk them. Its fragment branch still uses the pre-#8 rule: all of +8/+16/+24/+32/+40 had to be system pointers, and the u16 pairs at +48/+50 and +52/+54 had to be equal. The pinned rpf9-explorer decoder (e293917) accepts null optional pointers (+16/+32/+40) and only range-checks the four u16 fields, as measured in breadbbbb/rpf9-explorer#8 over 50,802 fragments in levels.rpf (0 false positives across 326,112 resources). The stale Python rule made skin_streams.py silently skip those fragments.
This changes the fragment branch to match the pinned decoder: required pointers at +8/+24/+168, +16/+32/+40 may be null or a system pointer, +48 in 1..4096, +50 <= 4096, +52 <= +54 <= 4096. Drawables and dictionaries are still checked first.
Tested
python -I tests/test_skin_streams.py — 30 tests pass, including 7 new synthetic tests; I watched the 3 positive ones fail before the fix.
Tested 918e8256 on Windows 11 x64, Python 3.14.8 (CPU-only, no game files): pass. Code review looks clean: len(b) < 192 at the top of resource_kind() keeps u64(b, 168) in bounds, optional pointers at +16/+32/+40 allow 0 or sys_ptr, and the 7 new unit/scan tests cover both positive and negative cases.
Real-data check of 918e825648b52ebc4ed82d58e0e8d655eaf0133f on my own Xbox Series 1.0.2.1 copy (Windows 11 Pro 26300, Python 3.15.2, CPU only): pass. On packs.rpf the relaxed fragment rule finds 2,521 more skinned resources and loses none.
python -I tools/skin_streams.py packs.rpf --json <local> with this PR and with main49475796's tool:
All the new meshes are 4-influence 8-bit ones, about 25 vertices each. The other three layouts don't change by a single mesh or vertex. Note that the sampled validation (the first 64 meshes per layout) comes out identical on both sides, 0 out-of-range components and every weight sum 255, so it doesn't reach the new meshes. 30 more candidates are skipped, too.
python -I tests/test_skin_streams.py: OK. Nothing from the package is attached. AI-assisted (Claude Code).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: new BUILD item (ID pending) — #2078 (comment)
What and why
tools/skin_streams.py::resource_kindclassifies resource headers before the skin-stream census can walk them. Its fragment branch still uses the pre-#8 rule: all of+8/+16/+24/+32/+40had to be system pointers, and the u16 pairs at+48/+50and+52/+54had to be equal. The pinned rpf9-explorer decoder (e293917) accepts null optional pointers (+16/+32/+40) and only range-checks the four u16 fields, as measured in breadbbbb/rpf9-explorer#8 over 50,802 fragments inlevels.rpf(0 false positives across 326,112 resources). The stale Python rule madeskin_streams.pysilently skip those fragments.This changes the fragment branch to match the pinned decoder: required pointers at
+8/+24/+168,+16/+32/+40may be null or a system pointer,+48in 1..4096,+50 <= 4096,+52 <= +54 <= 4096. Drawables and dictionaries are still checked first.Tested
python -I tests/test_skin_streams.py— 30 tests pass, including 7 new synthetic tests; I watched the 3 positive ones fail before the fix.python -m compileall -q make_game.py tools tests— clean.dotnet build tools/rpf9dump/rpf9dump.csproj -c Release— clean (no submodule change).python -m unittest discover -s tests/semantic— 1,671 tests, OK (2 skipped).node --test tests/test_viewer_streaming.cjs— 36 pass.tests/test_cf_ref.py,tests/test_docs_design_rows.py), reproduced on clean4eb6155d.data.rpfcopy: 2,322 → 2,916 resources, +594 fragments, matching upstream CI: Dependabot for GitHub Actions and the rpf9-explorer submodule #8's +594. No bytes, names or offsets from the package are included here.AI-assisted: OpenCode (Big Pickle model). No game data in the diff.
Checklist
docs/design.mdalready records the pinned decoder's model counts.