Repository navigation
bvh_rehydrate: reject invalid leaf vertex orders (BUILD-1581) - #5138
l-CatDemon-l wants to merge 1 commit into
Conversation
|
Tested f119911 on Windows 11, CPython 3.14.7, CPU only: pass.
I ran the head's rehydrate test file against 3faac55. The 160 invalid byte cases raise unexpected exceptions. All 12 CLI cases fail their checks. The valid permutations pass on both commits. All inputs are synthetic. AI-assisted. |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at f11991168 on Windows 11: pytest tests/test_bvh_rehydrate.py -q -> 19 passed, 271 subtests passed; git diff --check clean.
bvh_rehydrate now rejects an invalid leaf vertex order (a repeated or out-of-range slot that cannot be a triangle) with the tool's error instead of rehydrating a malformed leaf; the added cases cover each refused order and the valid permutations. No blocking issue.
|
Independent check — pass (CPU only, no game files). Environment: Windows 11, CPython 3.15.2.
AI-assisted (Devin). |
kacper-serewis
left a comment
There was a problem hiding this comment.
At f119911 the production CLI preserved all 768 output bytes for an independent three-leaf synthetic control. Changing only the last leaf to invalid order 0x55 gave exit 2 with its offset and order, preserving an existing output. Parent raised TypeError on the same input. Head's suite passed 19/19. Cached inventories lacked a BLAS with matching geometry inputs, so this review covered zero retail leaves. AI-assisted, Windows CPU.
|
Independent Windows CPU verification on
|
|
Tested
No game files, no GPU. AI-assisted (Devin). |
|
Tested
Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047. |
Claimed in the coordination issue as: BUILD-1581 — #5032 (comment)
What and why
A malformed leaf vertex-order byte could make
write_leaves()index pastSLOT_OF_ORDERor leave an output vertex slot unset. The API raisedIndexError/TypeError, and the actual CLI exited 1 with a traceback instead of its documented input-error exit 2.Reject a first/second slot outside 0..2 or a repeated slot with a
ValueErrornaming the leaf offset and order byte. The two distinct slots in 0..2 imply the third is the remaining slot, so the existing six permutations remain accepted. Upper order bits and the fourth-vertex selection are unchanged.The regressions exercise all 256 order bytes: 96 valid combinations check the actual output vertices against explicit expected permutations; 160 invalid combinations require a contextual input error. Twelve subprocess CLI cases cover both prior exception types, upper bits, and absent/existing output destinations. Invalid input creates no output and preserves an existing one.
Related CLI-publication work: #3336, #4196 and #4352. This change is confined to leaf decoding and its regressions, based directly on main
3faac557.Tested
Windows 11, CPython 3.13.1; CPU only. Host GPU: NVIDIA GeForce RTX 4070 Ti, driver 616.56 (not used).
python -I tests/test_bvh_rehydrate.py: 19 passed.python -I tests/test_bvh_geometry_check.py: 6 passed.python -I tests/test_bvh_match.py: 19 passed.py_compile, explicit-path no-game-data check andgit diff --checkpassed.All fixtures are hand-built synthetic bytes from the existing test helper. No game files were used.
AI-assisted: yes, with Codex.
Checklist