glb_inspect: diagnose broken skin joint and bind matrix references #1745
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1745"
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 kirigayakazima on 2026-11-25T11:03:59Z.
Claimed in the coordination issue as: GLB-INSPECT-SKIN-REFERENCES
What and why
A skin with duplicate joints or a broken skeleton link looked identical to a healthy skin with the same joint count. The inspector now identifies invalid joint slots, missing skeleton or accessor references, non-MAT4 accessors and insufficient matrix counts. The optional inverse bind matrix accessor can still be omitted. glTF skin specification
Tested
The synthetic fixture covers duplicate joints, malformed and unresolved node indices, missing accessors, wrong matrix types, short counts and a valid accessor with extra matrices.
python -I tests/test_glb_inspect.pyon Windows with Python 3.14.7 ran 37 tests on this branch with one platform skip. The new tests also failed against the original inspector.python -I scripts/check_no_game_data.py tools/glb_inspect.py tests/test_glb_inspect.pyandgit diff --checkpassed.bcaa13dapassed 6,287 semantic tests across 488 files.GPUs tested: N/A (CPU-only metadata inspection).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:19:47Z.
Review: COMMENTED
Independent check at "
0eed8e40". Windows: 36 tests reported, 1 platform skip. The extra CLI check uncovered one invalid inverse-bind accessor that the new diagnostics miss. Details inline.AI-assisted review and CPU-only testing with synthetic inputs.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:19:48Z.
Code review location:
tools/glb_inspect.py; line 520The new check accepts an integer MAT4 as a valid inverse-bind accessor. I inspected a synthetic one-joint skin whose accessor declared
type: MAT4,count: 1andcomponentType: 5123. Its skin report had no issues. Could this also checkcomponentType == 5126? Inverse bind matrices require floating-point components. glTF 2.0 skin specificationImported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T12:11:43Z.
Code review location:
tools/glb_inspect.py; line 520Fixed:
_skin_report()now verifiesaccessor.get('componentType') == 5126(FLOAT) forinverseBindMatrices. Added regression test withcomponentType: 5123intests/test_glb_inspect.py.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T15:50:22Z.
Review: COMMENTED
Re-verified at
2d8bce897(merged cleanly ontomainec91d695c)._skin_report()now requirescomponentType == 5126(FLOAT) oninverseBindMatricesaccessors and rejects integerMAT4accessors (verified withcomponentType: 5123and5126, plus the new regression test).python -I -B tests/test_glb_inspect.py -vpassed (37 tests, 1 expected Windows POSIX-permission skip);scripts/check_no_game_data.pyandgit diff --checkclean.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:25:15Z.
#1745 | head
2d8bce8970(merged cleanly with main4a54aedcb) |python -I tests/test_glb_inspect.py| red on main:FAILED (errors=2, skipped=6)(KeyError: 'issues'on broken skin joint, skeleton, and inverseBindMatrices references) | green on PR+main:38 tests OK (skipped=6)| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_skin_reportandformat_reportintools/glb_inspect.py(validating non-emptyjoints, missing/duplicate joint node indices,skeletonnode index, andinverseBindMatricesaccessorMAT4type,FLOAT (5126)componentType, andcount >= joint_count). Also verified clean merge (0conflicts) and combined execution with #1744 (39 tests OK (skipped=6)), plustests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:56:20Z.
Red/green:
pytest tests/test_glb_inspect.pyfails on main (2 failed, 30 passed, 6 skipped, 7 subtests passed) and passes on head2d8bce8970merged with main (32 passed, 6 skipped, 7 subtests passed).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)