Probe: accept the geometry and renderer list counts that Decode accepts #11
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/breadbbbb--rpf9-explorer!11
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/11/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@spidercraft on GitHub · 2026-11-22 05:03 UTC · original
probe-caps→main· +4 −3 · 1 files · 1 commits · merged 2026-11-22 09:44 UTCWhy
ProbeRequiredExtentsrejects two kinds of resources thatDecodereads without trouble:RageModelDecoder.cs:351), whileDecodeallowsMaxMeshes(1,024,:535) and the probe's own running total already stops atMaxMeshes(:358).:387). That count was never used for sizing: the probe covered 1 byte of the list (:388), so the cap only rejected.Both fail as "probe returned null on every split", so recovery never asks for the next block and the candidate is dropped. They are the 29 candidates left in #9's table that are models: 28 in
levels.rpfand 1 inpack/story000.917e9b9917e9b9→ this PRlevels.rpf¹pack/story000/story000.rpfpacks.rpfdata.rpfpack/shared_minigame000pack/core_restofworld¹ One
levels.rpfblock on the machine I measured fails its zlib checksum because of a single flipped bit in my local copy (flipping it back restores the stored Adler-32). It is the same candidate in both columns, so a clean copy has one more recovered candidate and model on each side; #9 reports 205,944 formain.The 29 new candidates hold 41 models: 8,467 meshes, 3,390,847 vertices and 3,246,156 triangles. The largest has 377 meshes. Every candidate was recovered and fully decoded with
mainand with this PR, and the outputs were compared candidate by candidate: name, mesh, vertex and triangle counts, and a hash over positions, indices and texture coordinates. Only the 29 rows change; none of the 238,227 candidates recovered onmainin these six archives is lost or decodes differently. Every scan, recovery and decode was run on the 1.0.2.1 package.Change
:351: the per-model geometry cap isMaxMeshes, the same asDecode.:387–:388: list 4 is no longer capped at 4,096, and the probe coverscount * 80bytes of it instead of 1. The entries are 80 bytes: in 553 of 555 sampled drawables the list's span divided by its count is exactly 80, and the two dictionaries this recovers hold exactly 5,078 × 80 and 5,461 × 80 bytes. Covering the whole list changes no result in any archive (checked against a variant that only drops the cap). A ushort count covers at most 5.2 MiB, well underMaxSystemBytes.Lists 0 to 3 keep their 4,096 cap and 4-byte entries. This PR does not touch the lines changed by #8, #9 or #10.
Tests
mainignoresTests/, so, as in #9, the fixture is below rather than in the PR. It builds a one-entry drawable dictionary whose model has N one-triangle geometries, and optionally a renderer with a long list 4. It checks:On
mainit fails at "the probe accepts 300 geometries". With only the:351change, it fails at "the probe accepts 5,000 entries in renderer list 4". The fixture is generated in code and contains no game data.Copy both files to
Tests/ProbeCapsSmoke/and rundotnet run --project Tests/ProbeCapsSmoke -c Release.Tests/ProbeCapsSmoke/ProbeCapsSmoke.csprojTests/ProbeCapsSmoke/Program.csTesting environment
Tested on Linux x64 (CachyOS) with .NET SDK 8.0.428, CPU only.
Corebuilds with warnings as errors. I could not build the Windows app on this machine, and the app code is unchanged.AI-assisted: an AI agent (Claude, Anthropic) did the investigation, code, tests and measurements on the author's behalf, and a second model (Gemini) reviewed the findings independently. No game data is included here.
🤖 Generated with Claude Code