OLD-7594: bvh_packing_check: fix bvh4-chunk continuation joining and NaN/Inf root checks #879
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/879"
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 narekshaghoyandev on 2026-11-24T14:54:37Z.
Reopening my original upstream PR #7594 (refined per
@Envyreand@kapitche's reviews), cleanly rebased ontomain:bvh4-chunkcontinuation joining (scan_window):ZHDRbytes in padding only within a bounded 16-byte slop (prev_end + 16) after a failed_inflate, so a damaged continuation stops cleanly asshort_inputinstead of skipping ahead to glue an unrelated laterrawstream.rawstream (more_kind != "raw", including XML streams).continuationcounts andconsumedoffsets until the joined stream actually reachesdeclared_bytes, so failed joins do not steal unrelated streams._root_equal, union check): Rejects NaN anywhere in root bounds or child union (min([0.0, nan])silently returned0.0) and rejects infinite vs finite BOX32 bounds.Verification
python3 -I tests/test_bvh_packing_check.py -v: 33/33 pass (both new tests fail againstmain).python3 -I scripts/check_no_game_data.py tools/bvh_packing_check.py tests/test_bvh_packing_check.py: clean.python3 -m compileall -q tools/bvh_packing_check.py tests/test_bvh_packing_check.py: clean.Claimed in the coordination issue as: OLD-7594 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135123647)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-24T19:34:38Z.
Reviewed
4b32bdc: ran tests/test_bvh_packing_check.py (33 OK here, 31 on main) plus a probe script on both main and this head (NaN/Inf root unions, the_root_equalmatrix, eight join inputs, a 2-worker/64-byte-window run, a 25-archive fuzz; no crashes on either side). Reproduced on main, all fixed here: wide(1.0, inf)/(inf, -inf)and narrow nan/nan equalities returned True; a NaN root-union override was order-dependent and could count as equal with no failure; a false78 9cin chunk padding broke a good join and misreported the continuation as raw; a following bvh4/xml stream could be glued into the join and vanish from the report; failed joins recorded bogus continuation counts. Legal BOX16 +/-inf unions still pass, so no regressions found. gh is disabled for me, so I could not check the coordination-issue claim. AI-assisted review.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T13:06:13Z.
Red/green: tests/test_bvh_packing_check.py 16 failed on main, 39 passed with the PR.
Targeted batch of 30 PRs (their tests, the tests importing the changed modules, the docs tests, the translator suite) on main
a997a3c: no new failure, Windows 11 / Python.AI-assisted (Claude Code, Claude Opus 5.5)