raytracing: fix BVH index building and validation #272
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/272"
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?
Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T02:56:55Z.
Claimed in the coordination issue as: BUILD-1533 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149)
What and why
main(commitccafaeeaa).classify()intools/bvh_index.pyon< 208-byte payloads soinstance208does not crash withstruct.error, falling back todescriptorwhen>= 0x30descriptor header bytes are available, and marks raw< min(size, HEAD)heads withsignature="truncated-head"andtruncated_head=True.test_truncated_head_on_208_byte_payload_does_not_crashand CLI--max-inflate 128checks oninstance_payloadandbvh_payload) intests/test_bvh_index.py.Tested
python -I tests/test_bvh_index.py(45 tests OK, 1 skippedwithout game archive) on commitccafaeeaa.tests/test_docs_*.py(OK) on commitccafaeeaa.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.Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-11-24T03:14:44Z.
Not merging yet. The crash does reproduce:
bvh_index.classify(b'\0'*10, 208)raisesstruct.error, which--max-inflatebelow 208 can reach. Please:tests/test_bvh_index.py;Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T18:33:20Z.
@ubiquitarianism Updated in commit
ccafaeeaa:test_truncated_head_on_208_byte_payload_does_not_crashand CLI--max-inflate 128checks oninstance_payloadandbvh_payload) intests/test_bvh_index.py.len(head) < min(size, HEAD)) withsignature="truncated-head"andtruncated_head=Trueintools/bvh_index.py.Verified:
python -I tests/test_bvh_index.py(45 tests OK, 1 skipped) and all 12tests/test_docs_*.py(OK).Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T08:58:02Z.
Rebased on current ubi/main (
3f81d46ac), no conflicts. The added tests pass locally on this base (python -I).AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:41:50Z.
Verified by OreoFR
Run 1 (win02)
5cb45921e+ PR head070f9521bpython -I tests/test_bvh_index.pyRun 2 (lot O)
4a54aedcb+ PR head070f9521bpython -I tests/test_bvh_index.pyAll runs
AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T21:52:19Z.
Merged after OreoFR's red/green check (check) (RTX 4070 Laptop, driver 621.40, Windows 11) and a local re-check here. Merged after local re-verification: this PR merged onto
main7ef2a485ewithout conflict, and its test file(s) (tests/test_bvh_index.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.