Repository navigation
Conversation
…ATE) Cuts the per-node and per-leaf Python overhead of tools/bvh_rehydrate.py without changing what it writes. tests/test_bvh_rehydrate_parity.py pins the output of the fast path against the previous implementation on hand-built BVHs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Independent differential check of 9f22a62 against its parent's tools/bvh_rehydrate.py (both loaded in one process, synthetic inputs only, Windows 11, Python 3.11): no differences.
AI-assisted (Claude Code). |
Contributor
|
Tested 9f22a62 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
This was referenced Nov 23, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Claims PERF-BVH-REHYDRATE (#7694 (comment)).
AI-assisted: written with Claude Code (Claude Sonnet 5.5) and the checks below were run on the rebased branch.
What
tools/bvh_rehydrate.pyspends most of its time in per-node and per-leaf Python overhead. This reworks those loops (+245/-87 lines in the tool) without changing what the tool writes. No format or CLI change, no new rule.Measured
Synthetic hand-built BVHs, before -> after:
That is 41-72% faster across the cases measured. No game files were used.
Parity
tests/test_bvh_rehydrate_parity.py(new, 18 tests) holds a copy of the previous algorithm and checks the new output matches it on hand-built inputs. It includes a tracemalloc test that the peak allocation of a dense and a sparse tree stays within the reference's.Tested
Rebased on current
main(dde82f2); all re-run after the rebase, on Windows with Python 3.12 (no GPU needed):python -m compileall -q tools/bvh_rehydrate.py tests: cleanpython -I tests/test_bvh_rehydrate.py: 18 tests OKpython -I tests/test_bvh_rehydrate_parity.py: 18 tests OKpython -I scripts/check_no_game_data.py: cleantest_bvh_geometry_check,test_bvh_match,test_bvh_packing_check: OKtest_bvh_slot_check: 3 errors, the same 3 on unmodifiedmain, so not from this changeNo game data in the diff: the tests build their inputs by hand.
Several open PRs also touch
tools/bvh_rehydrate.py(#5138, #4196, #6391, #4352, #7626); none is a performance change, but whichever lands second may need a rebase.