offsetToParents = 0x40 - (((offsetToNodes - offsetToElements) / 16) & ~127),
so the first box node's entry lands in [0x40, 0xc0); one entry per box unit
follows, and offsetToElements is their end rounded up to 128. The bytes
from 0x40 to offsetToElements are zero. Holds on all 272,874 streams of
core_bvh4.rpf and shared_minigame000_bvh4.rpf (272,858 box roots for the
extent); counts only.
totalSizeIn64BNodes + 1 also counts the level table's units, which have no
entry: that is why the header-only end missed on about 13,400 streams.
tools/bvh_packing_check.py checks the three rules (parent_offset,
parent_area_nonzero, parent_extent); the synthetic fixture moves to the
console layout for its four leaves and three BOX16 units.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Joined continuation streams are counted as `continuation`; one that starts
in a later window is no longer counted there again as `raw`. Five more
synthetic cases cover too_many_children, child_not_a_node, invalid_child,
root_not_a_box and leaves_past_end. core_bvh4.rpf: kinds now sum to
565,596 as in docs/bvh.md §1, 271,637/271,637 still pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A geometry-free check of the dehydrated packing that bvh_rehydrate reads:
level table, group fit, child counts and override masks, child pointer
targets and widths, one parent per node and leaf, vertex-order bytes and
stored overrides inside sceneBounds. 272,874 of 272,874 streams of
core_bvh4.rpf and shared_minigame000_bvh4.rpf pass; docs/bvh.md gets the
counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>