mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:50:51 +01:00
[PR #1433] glb_skinning: fix partial-axis NaN bbox, leading-zero sets, zero-count offset, normalized IBM, and atomic JSON write (GLB-SKINNING-BBOX-VALIDATION-ATOMIC) #1463
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#1463
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/1433
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/glb-skinning-bbox-validation-atomic📝 Commits (1)
0b736f9glb_skinning: fix partial-axis NaN bbox, leading-zero sets, zero-count offset, normalized IBM, and atomic JSON write (GLB-SKINNING-BBOX-VALIDATION-ATOMIC)📊 Changes
2 files changed (+125 additions, -11 deletions)
View changed files
📝
tests/test_glb_skinning.py(+69 -0)📝
tools/glb_skinning.py(+56 -11)📄 Description
Item ID:
GLB-SKINNING-BBOX-VALIDATION-ATOMICAI-assisted: yes
Summary
Fixes five bugs in
tools/glb_skinning.py:POSITIONcrashedwrite_json(..., allow_nan=False):_bbox()only checked whether any scalar component across all three axes was finite (if not finite:). When one axis had onlyNaN/±infvalues while the other axes were finite,_bbox()returned[inf, ...]/[-inf, ...], causingjson.dumps(..., allow_nan=False)inwrite_json()to raiseValueError._bbox()now tracks finite values per axis and returns(None, None, non_finite)unless all three axes have finite values.JOINTS_00,WEIGHTS_01):ATTRIBUTE_REmatched(\d+), collapsingJOINTS_00into set0(either silently ignored whenJOINTS_0existed, or producing misleading missing-pair errors).ATTRIBUTE_REnow matches canonical0|[1-9]\d*per glTF 2.0 §3.7.2.1, and leading-zero keys emit an explicit validation error.count == 0accessor skippedbyteOffset > view_lengthbounds check:_Reader.read()only checkedbufferViewbounds insideif count:, accepting out-of-rangebyteOffsetvalues on zero-count accessors.inverseBindMatricesnot rejected:_validate_skins()now rejectsnormalized: trueoninverseBindMatrices(consistent with glTF 2.0 §3.6.2.2 and the existingFLOATweight / joint checks).write_json()publishing and early--jsondirectory rejection:write_json()now resolves symlinks, rejects symlink cycles (ELOOP) and existing directories (IsADirectoryError), and stages writes viatempfile.NamedTemporaryFile+file_mode.published_mode+os.replacewith cleanup on failure so existing reports are never truncated on write errors.main()rejects--json <dir>before reading the GLB.Verification (macOS Apple M5, arm64, Python 3.14; no game files)
python3 -m compileall -q make_game.py tools tests— OKpython3 -I scripts/check_no_game_data.py tools/glb_skinning.py tests/test_glb_skinning.py— OKpython3 -I tests/test_glb_skinning.py -v— 32/32 OK (6 new regression tests)python3 -I tests/test_text_write_line_endings.py— 3/3 OKpython3 -I tests/test_ci_registration.py— 16/16 OKtests/test_glb_skinning.pyagainst unpatchedupstream/main1154976d4):Ran 32 tests — FAILED (failures=5)— catches partial-axis[inf, 0.0, 0.0]bbox, leading-zeroJOINTS_00, zero-countbyteOffsetpastbufferView, normalizedinverseBindMatrices, and non-atomicwrite_json.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.