Skip to content

docs/bvh.md: where the BLAS of the §4a interior's other entities are (ASSET-351) - #4506

Merged
ItsNotRexed merged 4 commits into
ItsNotRexed:mainfrom
Krashgamer:asset-351-interior-blas
Nov 23, 2026
Merged

ItsNotRexed merged 4 commits into
ItsNotRexed:mainfrom
Krashgamer:asset-351-interior-blas

Conversation

@Krashgamer

@Krashgamer Krashgamer commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: ASSET-351 (claim), from NiiRoZz's finding. Docs only.

Depends on: #4265 (ASSET-322). This PR extends the interior paragraphs that #4265 adds to §4a, so its branch is built on #4265's head (e6e53475); the diff shows #4265's commit until that one is merged. The commits after it are this PR.

The question

The interior of the §4a sample pack has 242 entities (143 archetypes), but only 10 of them have a BLAS among the first 10 streams of core_bvh4.rpf. Where are the others: later streams, other packs, or none?

Answer (counts only)

Every BVH stream of core_bvh4.rpf (271,637) and shared_minigame000_bvh4.rpf (1,237) was matched against the interior's 141 exported drawables with the bvh_match.py signature and the bvh_geometry_check.py checks, at all four LODs of each drawable. story000_bvh4.rpf holds no BVH.

archetypes entities
BLAS built from the first LOD 23 32
BLAS built from the second LOD 101 188
2-triangle light proxy, cannot be attributed 1 1
no BLAS, drawable exported 16 19
no BLAS, drawable not in the export 2 2
  • All in core_bvh4.rpf; the shared pack has none at any LOD.
  • Most are built from the second LOD (drawable +0x58), which rpf9dump models does not export: it decodes only the first (+0x50). That is why a whole-archive export finds only the first 10, plus some small props. §7 now says so next to bvh_match.py.
  • One BLAS per drawable, not per entity: the 31 archetypes placed more than once (127 entities, up to 18) have 32 streams.
  • Not one block per interior: the 10 first streams open the pack; the other 115 archetypes' 121 streams lie in a band of streams 231,012 to 261,585 (30,574 streams, 85 runs of 1 to 6), about 0.4 % of that band. Read as nested packs (each 9FPR tag in the data area starts one), the first 10 streams are the whole first nested pack and the other 121 lie in 31 other packs (added after chadatouille's note in the coordination thread).
  • No BLAS: of the 16 exported archetypes without one, 11 use only shaders the matched drawables leave out; 4 keep a shader and still have none (open).
  • The shader rule is not a shader list alone: over the 130 streams, 14 kept and 13 left-out shader hashes, and one hash is kept in 171 geometries (86 drawables) and left out in 3 (3 drawables), with the same render bucket and preset.
  • Specificity: the 12 first-LOD streams with at most 3,000 candidates over the whole export (343,327 models) each have exactly one consistent drawable; the rest were checked against the interior's drawables only, where no stream fits two archetypes. The doc states this limit.

How it was measured

Tested

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md): no names, hashes or keys in the doc or here; counts, offsets and stream ordinals only.
  • A new translator rule is in the contract table of docs/design.md: not applicable.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

NiiRoZz and others added 2 commits November 23, 2026 01:25
…by their interior (ASSET-322)

All 10 sample BLAS of core_bvh4.rpf match exactly one drawable each on a full
levels.rpf export with per-geometry counts; the two read as aggregated rooms are
baked room-dressing drawables. All 10 are entities of one interior archetype
(base list and two entity sets); a BLAS sits in interior space at E * M^-1.
The shader skip covers 7 hashes over these samples, not 2. The descriptor key
at +0x40 always comes with one transform, and distinct keys can share a BLAS
and its transform (whole pack, single-BLAS descriptors). Counts only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(ASSET-351)

The first 10 streams of core_bvh4.rpf cover 10 of the interior's 242 entities.
Matching every BVH stream of core_bvh4.rpf and shared_minigame000_bvh4.rpf
against the interior's drawables, at all four LODs, finds a BLAS for 124 of its
143 archetypes (220 entities), all in core_bvh4.rpf: 23 built from the first
LOD and 101 from the second, which rpf9dump models does not export. One BLAS
per drawable, not per entity; the 115 archetypes past the first 10 streams lie
in a band of streams 231,012 to 261,585. 16 exported archetypes have none, 11
of them as the shader rule predicts, and one shader hash is both kept and left
out. Counts only.

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.

Ran this at 8b0c4767 on Windows 11: test_docs_links.py 6 OK, test_docs_design_rows.py 2 OK; git diff --check clean.

The BVH section now records where the other entities' BLAS live, with counts/offsets only. No blocking issue.

…h4.rpf

The first 10 streams are the whole first nested pack (9FPR tag); the other
121 BLAS of the interior lie in 31 other nested packs. Counts only.

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

Copy link
Copy Markdown

Read on Linux, and ran the repository's doc checks against it: the page still passes, and one sentence reads ambiguously.

  • pytest tests/test_docs_links.py tests/test_docs_table_rows.py tests/test_docs_list_items.py tests/test_docs_repo_paths.py tests/test_docs_design_rows.py -q: 14 passed, 3 subtests. (test_docs_repeated_lines.py only exists in docs: lines merges left twice, two wrong test counts; test_docs_repeated_lines #4490, not on main, so it is not part of this branch's checks.)
  • The addition is a measurement of nested packs inside the same file, and it agrees with the paragraph above it in the one place where it could contradict: "no archetype has a stream in both places" is about the pack's own opening streams versus streams 231,000 later, while the new sentence is about the nested packs among those later streams. Fine, but the two claims sit next to each other and both say "them":
    • "no archetype has a stream in both places. … the other 121 lie in 31 other packs, up to 19 in one; one archetype has streams in two of them."
      A reader parses "two of them" as the places of the previous sentence on first pass. "in two of those 31 packs" (or "in two nested packs") removes the ambiguity for one word of cost.
  • The internal arithmetic is consistent: 10 + 121 = 131 attributed streams across 32 packs, and 1,282 tags with 1,281 16-byte aligned leaves exactly one unaligned.

Docs only, measurement not reproducible here (needs a game copy); no game data in the text. AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested ef7ee74 merged with main 03b09a0 (merge 4f3e433d0, no conflicts) on Linux (WSL2) Python 3.12.16: pass for what can be checked without the game.

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

Copy link
Copy Markdown
Contributor Author

Thanks @mrbean56, fixed in d778482d: "in two of those 31 packs". Thanks @kapitche for the cross-checks.

@kapitche

Copy link
Copy Markdown
Contributor

Tested d778482 merged with main 98fa503 on Linux (Python 3.12.16): pass for what can be checked without the game - tests/test_docs_*.py all 10 OK. Cross-checked the arithmetic in the new text: table skipped geometries sum to 65 and kept to 67; 62,479-leaf BLAS skips 13 and the 273/1,700-leaf ones 4 each (48 + 13 + 4 = 65); 130 streams = 25+103+2 and 9+121; archetypes 23+101+1+16+2 = 143 and entities 32+188+1+19+2 = 242; entity sets 11+2+77+152 = 242, 3+4+3 = 10; 0.4% = 121/30,574. All consistent. The dump-derived values themselves are unchecked.

@memorypressure

Copy link
Copy Markdown

Docs-only; verified on the merged tree (main 3faac55): all five docs guards pass including table_rows over the new placement table, no main commits touched docs/bvh.md since your base, and the findings stay on aggregate game facts with hashes excluded per the docs convention. No CI checks are reported on the branch — the guards exist so a push would exercise them. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

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