mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #748] [MERGED] OLD-7640: restore old upstream PR 7640 - docs/bvh.md: the BVH4 parent table's start and extent (BUILD-1390) #786
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#786
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/748
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:build1390-bvh4-parent-table📝 Commits (1)
2e4ef18docs/bvh.md: the BVH4 parent table's start and extent (BUILD-1390)📊 Changes
3 files changed (+117 additions, -12 deletions)
View changed files
📝
docs/bvh.md(+37 -2)📝
tests/test_bvh_packing_check.py(+46 -10)📝
tools/bvh_packing_check.py(+34 -0)📄 Description
Claimed in the coordination issue as: OLD-7640 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7132777216
Restoration of my original pull request, old upstream PR 7640 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at2d73c242fd. The cherry-pick applied cleanly. Changes in the rebase:#690 and #626 also touch
docs/bvh.md, but both merge cleanly with this branch.What and why
docs/bvh.md§3.1 replaced the console BVH4 parent table's start and size with an "Open:" line. This pull request puts the rules there instead:offsetToParents = 0x40 - (((offsetToNodes - offsetToElements) / 16) & ~127). The leaf entries' whole 128-byte blocks fall below the header end, so the first box node's entry lands in[0x40, 0xc0).offsetToElementsis the end of the last entry, rounded up to 128.offsetToElementsare all zero.totalSizeIn64BNodes + 1also counts the level table's units, which have no entry. That is why an end computed from the header alone missed on about 13,400 streams.bvh4packs. Each rule holds on every stream it applies to. The doc's table has counts only.tools/bvh_packing_check.pychecks three new rules:parent_offset,parent_area_nonzeroandparent_extent. It also gets two helpers,parent_tableandelements_after_parents.tests/test_bvh_packing_check.py:Tested
python -I tests/test_bvh_packing_check.py:tests/test_docs_*.py(12 files): all pass.python -m compileall -q tools tests: ok.git diff --check: clean.python -I scripts/check_no_game_data.pyon the three changed files: clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.